diff options
author | P. J. McDermott <pj@pehjota.net> | 2014-09-01 14:30:06 (EDT) |
---|---|---|
committer | P. J. McDermott <pj@pehjota.net> | 2014-09-01 14:30:06 (EDT) |
commit | 507b84ae78a186b489b0da80994b6aa378b6f962 (patch) | |
tree | b3c89ead5955682769bef7d814c49738bd63b40c | |
parent | e6e3feb7b2a88b68e882e0572cc09e82b52da6e1 (diff) |
package_set_substvars(): New function
-rw-r--r-- | lib/package.sh | 8 | ||||
-rw-r--r-- | lib/package/2.sh | 27 |
2 files changed, 35 insertions, 0 deletions
diff --git a/lib/package.sh b/lib/package.sh index ce95f41..5c494ba 100644 --- a/lib/package.sh +++ b/lib/package.sh @@ -58,3 +58,11 @@ package_get_build_deps() "package_${package_format}_get_build_deps" "${arch}" "${plat}" } + +package_set_substvars() +{ + local arch="${1}" + local plat="${2}" + + "package_${package_format}_set_substvars" "${arch}" "${plat}" +} diff --git a/lib/package/2.sh b/lib/package/2.sh index cd9e29a..e57c1d2 100644 --- a/lib/package/2.sh +++ b/lib/package/2.sh @@ -23,6 +23,7 @@ _PACKAGE_2_SM=1 use control use deps +use substvars package_2_build_deps= @@ -54,3 +55,29 @@ package_2_build_deps_field_cb() return 0 } + +package_2_set_substvars() +{ + local arch="${1}" + local plat="${2}" + + if [ -f "${package_dir}/substvars" ]; then + ob_parse_control "${package_dir}/substvars" \ + package_2_substvar_cb + fi + + ob_set_substvar 'Host-Arch' "${arch}" + ob_set_substvar 'Host-Plat' "${plat}" + + return 0 +} + +package_2_substvar_cb() +{ + local name="${1}" + local value="${2}" + + set_substvar "${name}" "${value}" + + return 0 +} |