diff options
author | Michael Olbrich <m.olbrich@pengutronix.de> | 2017-06-12 19:55:20 +0200 |
---|---|---|
committer | Michael Olbrich <m.olbrich@pengutronix.de> | 2017-06-21 09:34:50 +0200 |
commit | b2ab2eb421f308c29961730037472e6e40ffa1fb (patch) | |
tree | e1cf2e7f1338e17ebd9b99abc694734b9c6a6464 /scripts/pkg-config-wrapper | |
parent | 457fd335ccbea618895cbdd21cfd9b426bd09368 (diff) | |
download | ptxdist-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-x | scripts/pkg-config-wrapper | 8 |
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 |