summaryrefslogtreecommitdiffstats
path: root/scripts/lib/ptxd_make_xpkg_common.sh
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2018-10-12 14:57:08 +0200
committerMichael Olbrich <m.olbrich@pengutronix.de>2018-10-17 15:48:03 +0200
commita73b00a7195584f7c94fee0101bc35f81f74a402 (patch)
treef528824151c1e2857b47f101bdcda03b6c3e7c7e /scripts/lib/ptxd_make_xpkg_common.sh
parenta35fa2b5f2b7f727c52585f984e8de077856d3ce (diff)
downloadptxdist-a73b00a7195584f7c94fee0101bc35f81f74a402.tar.gz
ptxdist-a73b00a7195584f7c94fee0101bc35f81f74a402.tar.xz
ptxd_do_xpkg_map: validate package list
A ptxdist package may not create an ipkg so we ignore packages that do not have a .xpkg.map file. For manual package lists this can mean that invalid package names are ignored. Add a check to make sure that only selected packages a used. Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'scripts/lib/ptxd_make_xpkg_common.sh')
-rw-r--r--scripts/lib/ptxd_make_xpkg_common.sh6
1 files changed, 6 insertions, 0 deletions
diff --git a/scripts/lib/ptxd_make_xpkg_common.sh b/scripts/lib/ptxd_make_xpkg_common.sh
index 864f325d6..4bdcb1e6d 100644
--- a/scripts/lib/ptxd_make_xpkg_common.sh
+++ b/scripts/lib/ptxd_make_xpkg_common.sh
@@ -56,6 +56,12 @@ export -f ptxd_dopermissions
# ptxd_reply (array)
#
ptxd_do_xpkg_map() {
+ local pkg
+ for pkg in "${@}"; do
+ if ! [[ " ${ptx_packages_selected} " =~ " ${pkg} " ]]; then
+ ptxd_bailout "${pkg} is not a package or not selected"
+ fi
+ done
set -- "${@/#/${ptx_state_dir}/}"
ptxd_reply=( $(cat "${@/%/.xpkg.map}" 2>/dev/null) )