summaryrefslogtreecommitdiffstats
path: root/lib/control.sh
diff options
context:
space:
mode:
authorPatrick McDermott <patrick.mcdermott@libiquity.com>2023-09-25 09:59:14 (EDT)
committer Patrick McDermott <patrick.mcdermott@libiquity.com>2023-09-25 11:37:56 (EDT)
commitef9da61736858fc1ffb3b6deab8b6057daefc6d8 (patch)
treec5fb739e632533f33b4f1aa0804d9ec5e987dd17 /lib/control.sh
parentdfc2e98ae678073977cd66a41592aee25454d757 (diff)
metadata, package: Encode binary package names
Remove restriction on duplicate "clean" names.
Diffstat (limited to 'lib/control.sh')
-rw-r--r--lib/control.sh6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/control.sh b/lib/control.sh
index 35913aa..76ba516 100644
--- a/lib/control.sh
+++ b/lib/control.sh
@@ -245,8 +245,7 @@ ob_set_binary_substvar()
value="$(printf '%s' "${value}" | sed -n "${_OB_SUBSTVAR_TRIM_SED}")"
# Convert package name to clean form.
- package="$(printf '%s' "${package}" | tr 'A-Z' 'a-z' | \
- tr -C 'a-z0-9' '_')"
+ package="$(ob_clean_name "${package}")"
# TODO: Maybe disallow variable names beginning with hyphens, and/or
# otherwise make this safer.
@@ -326,8 +325,7 @@ ob_substvars()
# Perform the substitution.
name_tr="$(printf '%s' "${name}" | tr 'A-Z-' 'a-z_')"
- package="$(printf '%s' "${package}" | tr 'A-Z' 'a-z' | \
- tr -C 'a-z0-9' '_')"
+ package="$(ob_clean_name "${package}")"
if eval "[ x\"\${_ob_substvar_src_${name_tr}:+set}\" = x'set' ]"
then
name_tr="_ob_substvar_src_${name_tr}"