diff options
author | Patrick McDermott <patrick.mcdermott@libiquity.com> | 2024-02-21 21:53:06 (EST) |
---|---|---|
committer | Patrick McDermott <patrick.mcdermott@libiquity.com> | 2024-02-21 21:53:06 (EST) |
commit | 5e9bdfaebd234423df81992317e7c2a46bc315c6 (patch) | |
tree | be80db1a38c9912edd66dbc68cfb614010bbef7c /src | |
parent | 91863a2f944400f11e16d039f2e9270af34bb8a1 (diff) |
ob-gencontrol: Improve docs pkg dep versions
Also use "<<" ".~" instead of "<=" "-z".
Diffstat (limited to 'src')
-rw-r--r-- | src/ob-gencontrol.sh | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/src/ob-gencontrol.sh b/src/ob-gencontrol.sh index a05ba64..f88508c 100644 --- a/src/ob-gencontrol.sh +++ b/src/ob-gencontrol.sh @@ -1,6 +1,6 @@ # Generate a control directory with a control file and scripts # -# Copyright (C) 2012, 2019 Patrick McDermott +# Copyright (C) 2012, 2019, 2023-2024 Patrick McDermott # # This file is part of opkbuild. # @@ -131,7 +131,7 @@ gen_control_bin() local binary_qual= local value= local doc_pkg= - local upstream_ver= + local doc_pkg_q= local doc_dep= local name= local homepage= @@ -163,19 +163,23 @@ gen_control_bin() ob_error "$(ob_get_msg 'cant_get_doc_pkg')" return 1 fi - doc_pkg="$(ob_qualify_package_name "${doc_pkg}" "${OPK_HOST_ARCH}")" - if ! ob_parse_version -u upstream_ver "${OPK_SOURCE_VERSION}"; then - ob_error "$(ob_get_msg 'bad_source_version')" - return 1 + doc_pkg_q="$(ob_qualify_package_name "${doc_pkg}" "${OPK_HOST_ARCH}")" + if [ x"$(ob_get_binary_parameter "${doc_pkg}" 'Architecture')" \ + = x'all' ]; then + doc_dep="${doc_pkg_q} (= ${OPK_SOURCE_VERSION})" + elif [ x"$(ob_get_binary_parameter "${binary}" 'Architecture')" \ + = x'all' ]; then + doc_dep="${doc_pkg_q} (>= ${OPK_SOURCE_VERSION}), $(: \ + )${doc_pkg_q} (<< ${OPK_SOURCE_VERSION}.~)" + else + doc_dep="${doc_pkg_q} (= ${OPK_BINARY_VERSION})" fi - doc_dep="${doc_pkg} (>= ${upstream_ver}), $(: \ - )${doc_pkg} (<= ${upstream_ver}-z)" for name in Essential Depends Recommends Suggests Pre-Depends \ Conflicts Provides Replaces; do value="$(ob_get_binary_parameter "${binary}" "${name}")" if [ x"${name}" = x'Depends' ] && - [ x"${binary_qual}" != x"${doc_pkg}" ]; then + [ x"${binary_qual}" != x"${doc_pkg_q}" ]; then value="${doc_dep}, ${value}" fi if [ -z "${value}" ]; then |