summaryrefslogtreecommitdiffstats
path: root/scripts/pkg-config-wrapper
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2017-06-12 19:55:20 +0200
committerMichael Olbrich <m.olbrich@pengutronix.de>2017-06-21 09:34:50 +0200
commitb2ab2eb421f308c29961730037472e6e40ffa1fb (patch)
treee1cf2e7f1338e17ebd9b99abc694734b9c6a6464 /scripts/pkg-config-wrapper
parent457fd335ccbea618895cbdd21cfd9b426bd09368 (diff)
downloadptxdist-b2ab2eb421f308c29961730037472e6e40ffa1fb.tar.gz
ptxdist-b2ab2eb421f308c29961730037472e6e40ffa1fb.tar.xz
pkg-config-wrapper: only allow packages that are selected
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'scripts/pkg-config-wrapper')
-rwxr-xr-xscripts/pkg-config-wrapper8
1 files changed, 8 insertions, 0 deletions
diff --git a/scripts/pkg-config-wrapper b/scripts/pkg-config-wrapper
index b19a845d0..e3f1638cc 100755
--- a/scripts/pkg-config-wrapper
+++ b/scripts/pkg-config-wrapper
@@ -54,6 +54,14 @@ else
args=( ${args[@]} ${sysroot_prefix[@]/#/-e s~-I} -e "s~\s\+~ ~g" -e "s~^\s\+$~~")
fi
+if [ -n "${PKGCONFIG_WHITELIST_SRC}" ]; then
+ for pkg in $("${PKG_CONFIG}" --print-provides "${@}" 2>/dev/null | awk '{print $1}'); do
+ if [[ ! " ${PKGCONFIG_WHITELIST} " =~ " ${pkg} " && ! "${pkg}" =~ '-uninstalled' ]]; then
+ echo "$(basename ${0}): warning: blocking '${pkg}': not selected by '${PKGCONFIG_WHITELIST_SRC}'" >&${PTXDIST_FD_LOGERR}
+ exit 1
+ fi
+ done
+fi
"${PKG_CONFIG}" "${@}" | sed "${args[@]}"
for _pipe_status in "${PIPESTATUS[@]}"; do
if [ ${_pipe_status} -ne 0 ]; then