summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick McDermott <patrick.mcdermott@libiquity.com>2020-12-09 12:44:35 (EST)
committer Patrick McDermott <patrick.mcdermott@libiquity.com>2020-12-09 12:44:35 (EST)
commit58940e7e9ee1b02c454b6164c60e6333307b6ba3 (patch)
treef13d210fbb9329a7589d5d7a66e9c24ee05f911e
parentc18744dc6fcc5a0a82338ab218001d0994c79571 (diff)
ob-gencontrol: Reduce deps after substvars
-rw-r--r--NEWS4
-rw-r--r--src/ob-gencontrol.sh4
2 files changed, 6 insertions, 2 deletions
diff --git a/NEWS b/NEWS
index 01165fc..5a78d08 100644
--- a/NEWS
+++ b/NEWS
@@ -10,6 +10,10 @@ Utilities:
because BusyBox's gzip doesn't preserve modification times.
* ob-buildenv now adds "-ffile-prefix-map" options to CFLAGS and
CXXFLAGS.
+ * ob-gencontrol now reduces and normalizes binary package dependencies
+ after substituting variables. Otherwise, substitution variables may
+ contain dependency restrictions or newline characters that are
+ passed through to the binary package's control file.
opkbuild version 4.2.1
----------------------
diff --git a/src/ob-gencontrol.sh b/src/ob-gencontrol.sh
index 1c0da12..5a103a0 100644
--- a/src/ob-gencontrol.sh
+++ b/src/ob-gencontrol.sh
@@ -164,18 +164,18 @@ gen_control_bin()
'Essential')
;;
'Depends' | 'Recommends' | 'Suggests' | 'Pre-Depends')
+ value="$(ob_substvars "${value}" "${binary}")"
value="$(ob_reduce_deps \
-a "${OPK_HOST_ARCH}" \
-p "${OPK_HOST_PLAT}" \
-- "${value}")"
- value="$(ob_substvars "${value}" "${binary}")"
;;
'Conflicts' | 'Provides' | 'Replaces')
+ value="$(ob_substvars "${value}" "${binary}")"
value="$(ob_reduce_deps \
-a "${OPK_HOST_ARCH}" \
-p "${OPK_HOST_PLAT}" \
-u -- "${value}")"
- value="$(ob_substvars "${value}" "${binary}")"
;;
esac
printf '%s: %s\n' "${name}" "${value}" | sed 's/[, ]*$//' >&3