summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorPatrick McDermott <patrick.mcdermott@libiquity.com>2020-06-13 11:27:33 (EDT)
committer Patrick McDermott <patrick.mcdermott@libiquity.com>2020-06-13 11:27:33 (EDT)
commit445e3d6e43c55ddeb19322918e016c63f91c1958 (patch)
treeecc6c57a8854ec9a43c47fd413d7f7a70c3f20bc /lib
parentbc7912ee552446471dadc49893b1a821f1acb1c4 (diff)
ob-gencontrol: Generate a "Format" field
And add the needed support to ob_get_source_parameter().
Diffstat (limited to 'lib')
-rw-r--r--lib/package.sh8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/package.sh b/lib/package.sh
index 27ea8cb..8ed6645 100644
--- a/lib/package.sh
+++ b/lib/package.sh
@@ -18,6 +18,7 @@
# along with opkbuild. If not, see <http://www.gnu.org/licenses/>.
_ob_package_dir=
+_ob_package_format_full=
_ob_package_format=
_ob_binary_packages=
_ob_got_binary_packages=false
@@ -50,8 +51,9 @@ ob_init_package()
_ob_package_dir="$(cd -- "${dir}" && pwd)"
+ _ob_package_format_full="$(cat -- "${_ob_package_dir}/format")"
if [ -r "${_ob_package_dir}/format" ]; then
- case "$(cat -- "${_ob_package_dir}/format")" in
+ case "${_ob_package_format_full}" in
2.0)
_ob_package_format='2'
;;
@@ -184,6 +186,10 @@ ob_get_source_parameter()
EOF
)"
+ case "${name}" in 'FORMAT')
+ printf '%s' "${_ob_package_format_full}"
+ esac
+
# TODO: Return error on no such field?
eval "printf '%s' \"\${_OB_SRCFIELD_${name}-}\""