diff options
author | Patrick McDermott <patrick.mcdermott@libiquity.com> | 2019-07-15 21:51:29 (EDT) |
---|---|---|
committer | Patrick McDermott <patrick.mcdermott@libiquity.com> | 2019-07-15 21:51:29 (EDT) |
commit | 7d158c3e4f7cb4ea637126ec4aebb1782cd96a7a (patch) | |
tree | 1c9a1c2a714c654b53e53d4529d4437905aac514 | |
parent | 6751b5e57b3adc5883b65548cc2733e9fce5bc11 (diff) |
src/*/ppt-mkpkgs: Generate stub substvars file
-rw-r--r-- | changelog | 2 | ||||
-rw-r--r-- | src/2/ppt-mkpkgs | 21 | ||||
-rw-r--r-- | src/3/ppt-mkpkgs | 21 |
3 files changed, 44 insertions, 0 deletions
@@ -10,6 +10,8 @@ platconf-pkg-tools (3.0.0) trunk "# Generated by ppt-mkpkgs. Do not edit." * build.mk files now provide "ppt-mkpkgs" and "ppt-rmpkgs" targets to conveniently run these tools through (prokit and) opkbuild. + * ppt-mkpkgs now generates a stub "substvars" file if one does not yet + exist. -- Patrick McDermott <patrick.mcdermott@libiquity.com> Mon, 15 Jul 2019 17:59:07 -0400 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 "${@}" diff --git a/src/3/ppt-mkpkgs b/src/3/ppt-mkpkgs index 20ee33f..41121f9 100644 --- a/src/3/ppt-mkpkgs +++ b/src/3/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" } @@ -62,6 +66,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 @@ -84,6 +91,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 @@ -93,10 +103,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 "${@}" |