diff options
Diffstat (limited to 'src/2')
-rw-r--r-- | src/2/ppt-mkpkgs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/2/ppt-mkpkgs b/src/2/ppt-mkpkgs index 80d65cd..0567346 100644 --- a/src/2/ppt-mkpkgs +++ b/src/2/ppt-mkpkgs @@ -3,6 +3,7 @@ set -eu PLAT= +MAKE_SUBSTVARS=false info() { @@ -40,6 +41,9 @@ make_base_pkg() \${Config-Base-Depends} Description: "${PLAT}" platform configuration - base package EOF + if ${MAKE_SUBSTVARS}; then + printf 'Config-Base-Depends:\n' >>'substvars' + fi info 'Metadata for package "%s" generated.' "config-base" } @@ -60,6 +64,9 @@ make_build_time_pkgs() \${Config-${pkg}-Depends} Description: "${PLAT}" platform configuration for ${pkg} EOF + if ${MAKE_SUBSTVARS}; then + printf 'Config-%s-Depends:\n' "${pkg}" >>'substvars' + fi info 'Metadata for package "%s" generated.' \ "config-${pkg}-${PLAT}" done @@ -82,6 +89,9 @@ make_run_time_pkgs() \${Config-${pkg}-Depends} Description: "${PLAT}" platform configuration for ${pkg} EOF + if ${MAKE_SUBSTVARS}; then + printf 'Config-%s-Depends:\n' "${pkg}" >>'substvars' + fi info 'Metadata for package "%s" generated.' \ "config-${pkg}" done @@ -91,10 +101,21 @@ main() { PLAT="$(sed '1{s/^config-\([^ ][^ ]*\) (.*$/\1/;};1!q;' changelog)" + if ! [ -e 'substvars' ]; + MAKE_SUBSTVARS=true + printf '# Generated by ppt-mkpkgs. DO EDIT.\n' >'substvars' + fi make_common_pkg make_base_pkg make_build_time_pkgs make_run_time_pkgs + if ${MAKE_SUBSTVARS}; then + info 'Stub "substvars" file generated. Set variables as '$(: \ + )'needed.' + else + info 'Ensure "substvars" contains Config-*-Depends '$(: \ + )'variables as needed.' + fi } main "${@}" |