summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/control.sh16
-rw-r--r--src/ob-checkbuilddeps.sh2
2 files changed, 13 insertions, 5 deletions
diff --git a/lib/control.sh b/lib/control.sh
index 22ed8a5..ddd7cc9 100644
--- a/lib/control.sh
+++ b/lib/control.sh
@@ -256,15 +256,16 @@ ob_set_binary_substvar()
## variable substitutions is \fI${var}\fP, and substitutions can be
## nested.
## @operand string req The string in which to substitute variables.
-## @operand package req The binary package for which to substitute variables.
+## @operand package opt The binary package for which to substitute variables.
## @return Returns 0 on success or 1 on possible recursion.
## @stderr Prints a warning on possible recursion.
## @pure yes This function has no side effects.
ob_substvars()
{
local string="${1}"
- local package="${2}"
- shift 2 || _ob_abort
+ shift 1 || _ob_abort
+ local check_bin=
+ local package=
local depth=
local lhs=
local name=
@@ -272,6 +273,13 @@ ob_substvars()
local old_rhs=
local value=
+ check_bin=false
+ if [ ${#} -eq 1 ]; then
+ package="${1}"
+ shift 1
+ check_bin=true
+ fi
+
# Logic inspired by that of dpkg's Dpkg::Substvars::substvars()
# subroutine.
@@ -318,7 +326,7 @@ ob_substvars()
if eval "[ x\"\${_OB_SUBSTVAR_SRC_${name}:+set}\" = x'set' ]"
then
name="_OB_SUBSTVAR_SRC_${name}"
- elif [ -n "${package}" ] && eval "[ x\"\${_OB_SUBSTVAR_BIN_$(: \
+ elif ${check_bin} && eval "[ x\"\${_OB_SUBSTVAR_BIN_$(: \
)${package}__${name}:+set}\" = x'set' ]"; then
name="_OB_SUBSTVAR_BIN_${package}__${name}"
else
diff --git a/src/ob-checkbuilddeps.sh b/src/ob-checkbuilddeps.sh
index f75cf43..39d7e60 100644
--- a/src/ob-checkbuilddeps.sh
+++ b/src/ob-checkbuilddeps.sh
@@ -60,7 +60,7 @@ check_build_deps()
deps="$(ob_get_source_parameter 'Build-Depends')"
deps="$(ob_reduce_deps -a "${OPK_HOST_ARCH}" \
-p "${OPK_HOST_PLAT}" -- "${deps}")"
- deps="$(ob_substvars "${deps}" '')"
+ deps="$(ob_substvars "${deps}")"
missing=''
IFS=','