summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorPatrick McDermott <patrick.mcdermott@libiquity.com>2020-07-05 23:01:13 (EDT)
committer Patrick McDermott <patrick.mcdermott@libiquity.com>2020-07-05 23:01:13 (EDT)
commit088a61c64c29acb17ea9a097d644418f90635496 (patch)
tree858897a3a9929f87d860ef97c56dac43d420c7ac /lib
parent137700f42f49ed0ed30ebe3c3bce6092635a0ece (diff)
_ob_parse_package_metadata_2(): Validate section
On ob_get_binary_packages()'s first run, binary package control files haven't yet been parsed.
Diffstat (limited to 'lib')
-rw-r--r--lib/package.sh8
-rw-r--r--lib/package/2.sh6
2 files changed, 7 insertions, 7 deletions
diff --git a/lib/package.sh b/lib/package.sh
index 772fdc0..8ed6645 100644
--- a/lib/package.sh
+++ b/lib/package.sh
@@ -93,7 +93,6 @@ ob_get_binary_packages()
local host_plat=
local pkg=
local pkgs_clean=
- local sect=
local pkg_clean=
local pkgs=
@@ -121,16 +120,11 @@ ob_get_binary_packages()
for pkg in ${_ob_binary_packages}; do
- # Validate the name and section.
+ # Validate the name.
if ! ob_validate_binary_name "${pkg}"; then
_ob_warn_msg 'bad_binary_name' "${pkg}"
continue
fi
- sect="$(ob_get_binary_parameter "${pkg}" 'Section')"
- if ! ob_validate_section "${sect}"; then
- _ob_warn_msg 'bad_section' "${pkg}" "${sect}"
- continue
- fi
# Make sure the "clean" name is unique.
pkg_clean="$(printf '%s' "${pkg}" | tr 'a-z' 'A-Z' | \
diff --git a/lib/package/2.sh b/lib/package/2.sh
index 1ed7466..3e7bc0a 100644
--- a/lib/package/2.sh
+++ b/lib/package/2.sh
@@ -28,6 +28,7 @@ _ob_source_substvars_set_2=false
_ob_parse_package_metadata_2()
{
local pkg=
+ local sect=
ob_parse_control "${_ob_package_dir}/control" _ob_srcfield_2 '' \
"${_OB_SOURCE_FIELDS_REQUIRED_2}" \
@@ -39,6 +40,11 @@ _ob_parse_package_metadata_2()
_ob_binfield_2 "${pkg}" \
"${_OB_BINARY_FIELDS_REQUIRED_2}" \
"${_OB_BINARY_FIELDS_OPTIONAL_2}"
+ sect="$(ob_get_binary_parameter "${pkg}" 'Section')"
+ if ! ob_validate_section "${sect}"; then
+ _ob_warn_msg 'bad_section' "${pkg}" "${sect}"
+ continue
+ fi
done
return 0