summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick McDermott <patrick.mcdermott@libiquity.com>2020-11-08 13:20:37 (EST)
committer Patrick McDermott <patrick.mcdermott@libiquity.com>2020-11-08 13:30:12 (EST)
commit54019239f9261b29142a41fc9d35fd1987c6572d (patch)
treeb19e7f282f98b9ef0a776a0895c41fc47359a768
parent3a00326d2ebaede5710fef4a7d8869caf650170f (diff)
src/*/ppt-mkpkgs: Always use valid substvar names
-rw-r--r--changelog3
-rw-r--r--src/2/ppt-mkpkgs12
-rw-r--r--src/3/ppt-mkpkgs12
3 files changed, 19 insertions, 8 deletions
diff --git a/changelog b/changelog
index 7296b8c..15199cc 100644
--- a/changelog
+++ b/changelog
@@ -2,6 +2,9 @@ platconf-pkg-tools (3.0.1) trunk
* build.mk files no longer throw an error when <src/build/> or
<src/run/> is missing.
+ * ppt-mkpkgs now always generates valid substitution variable names.
+ Previously, package names like "linux-libre-4.19" caused invalid
+ substvar names to be generated.
-- Patrick McDermott <patrick.mcdermott@libiquity.com> Sun, 08 Nov 2020 13:08:46 -0500
diff --git a/src/2/ppt-mkpkgs b/src/2/ppt-mkpkgs
index 27cc483..006bdde 100644
--- a/src/2/ppt-mkpkgs
+++ b/src/2/ppt-mkpkgs
@@ -52,11 +52,13 @@ make_base_pkg()
make_build_time_pkgs()
{
local pkg=
+ local var=
# Make each config-*-* package.
for pkg in src/build/*; do
[ -d "${pkg}" ] || continue
pkg="${pkg#src/build/}"
+ var="$(printf '%s' "${pkg}" | tr -C 'A-Za-z0-9-' '-')"
mkdir -p "config-${pkg}-${PLAT}.pkg"
cat >"config-${pkg}-${PLAT}.pkg/control" <<-EOF
# Generated by ppt-mkpkgs. Do not edit.
@@ -64,11 +66,11 @@ make_build_time_pkgs()
Platform: all
Section: dev
Depends: config-${PLAT}-common (= \${Binary-Version}),
- \${Config-${pkg}-Depends}
+ \${Config-${var}-Depends}
Description: "${PLAT}" platform configuration for ${pkg}
EOF
if ${MAKE_SUBSTVARS}; then
- printf 'Config-%s-Depends:\n' "${pkg}" >>'substvars'
+ printf 'Config-%s-Depends:\n' "${var}" >>'substvars'
fi
info 'Metadata for package "%s" generated.' \
"config-${pkg}-${PLAT}"
@@ -78,11 +80,13 @@ make_build_time_pkgs()
make_run_time_pkgs()
{
local pkg=
+ local var=
# Make each config-* package.
for pkg in src/run/*; do
[ -d "${pkg}" ] || continue
pkg="${pkg#src/run/}"
+ var="$(printf '%s' "${pkg}" | tr -C 'A-Za-z0-9-' '-')"
mkdir -p "config-${pkg}.pkg"
cat >"config-${pkg}.pkg/control" <<-EOF
# Generated by ppt-mkpkgs. Do not edit.
@@ -90,11 +94,11 @@ make_run_time_pkgs()
Platform: ${PLAT}
Section: share
Depends: config-${PLAT}-common (= \${Binary-Version}),
- \${Config-${pkg}-Depends}
+ \${Config-${var}-Depends}
Description: "${PLAT}" platform configuration for ${pkg}
EOF
if ${MAKE_SUBSTVARS}; then
- printf 'Config-%s-Depends:\n' "${pkg}" >>'substvars'
+ printf 'Config-%s-Depends:\n' "${var}" >>'substvars'
fi
info 'Metadata for package "%s" generated.' \
"config-${pkg}"
diff --git a/src/3/ppt-mkpkgs b/src/3/ppt-mkpkgs
index d69fb2a..4234acd 100644
--- a/src/3/ppt-mkpkgs
+++ b/src/3/ppt-mkpkgs
@@ -53,12 +53,14 @@ make_build_time_pkgs()
{
local pkg_ver=
local pkg=
+ local var=
# Make each config-*-* package.
for pkg_ver in src/build/*; do
[ -d "${pkg_ver}" ] || continue
pkg_ver="${pkg_ver#src/build/}"
pkg="${pkg_ver%_*}"
+ var="$(printf '%s' "${pkg}" | tr -C 'A-Za-z0-9-' '-')"
mkdir -p "config-${pkg}-${PLAT}.pkg"
cat >"config-${pkg}-${PLAT}.pkg/control" <<-EOF
# Generated by ppt-mkpkgs. Do not edit.
@@ -66,11 +68,11 @@ make_build_time_pkgs()
Platform: all
Section: dev
Depends: config-${PLAT}-common (= \${Binary-Version}),
- \${Config-${pkg}-Depends}
+ \${Config-${var}-Depends}
Description: "${PLAT}" platform configuration for ${pkg}
EOF
if ${MAKE_SUBSTVARS}; then
- printf 'Config-%s-Depends:\n' "${pkg}" >>'substvars'
+ printf 'Config-%s-Depends:\n' "${var}" >>'substvars'
fi
info 'Metadata for package "%s" generated.' \
"config-${pkg}-${PLAT}"
@@ -80,11 +82,13 @@ make_build_time_pkgs()
make_run_time_pkgs()
{
local pkg=
+ local var=
# Make each config-* package.
for pkg in src/run/*; do
[ -d "${pkg}" ] || continue
pkg="${pkg#src/run/}"
+ var="$(printf '%s' "${pkg}" | tr -C 'A-Za-z0-9-' '-')"
mkdir -p "config-${pkg}.pkg"
cat >"config-${pkg}.pkg/control" <<-EOF
# Generated by ppt-mkpkgs. Do not edit.
@@ -92,11 +96,11 @@ make_run_time_pkgs()
Platform: ${PLAT}
Section: share
Depends: config-${PLAT}-common (= \${Binary-Version}),
- \${Config-${pkg}-Depends}
+ \${Config-${var}-Depends}
Description: "${PLAT}" platform configuration for ${pkg}
EOF
if ${MAKE_SUBSTVARS}; then
- printf 'Config-%s-Depends:\n' "${pkg}" >>'substvars'
+ printf 'Config-%s-Depends:\n' "${var}" >>'substvars'
fi
info 'Metadata for package "%s" generated.' \
"config-${pkg}"