From 477fa96806cde885e20a4fbabe8ac80d51ce9617 Mon Sep 17 00:00:00 2001 From: Michael Tretter Date: Tue, 8 Oct 2019 11:58:24 +0200 Subject: pkg-config-wrapper: remove sysroot only from specified variables The PTXDIST_PKG_CONFIG_VAR_NO_SYSROOT variable allows to specify pkg-config variable that shall be relative to the target rootfs and not contain the sysroot path. This is important for variables that are used for writing files to the target rootfs, e.g., systemduserunitdir. Currently, the sysroot is removed from all pkg-config variables, if PTXDIST_PKG_CONFIG_VAR_NO_SYSROOT is set, but packages already specify the name of the variable that must not include the sysroot. Add a check to remove the sysroot only from variables that are actually contained in PTXDIST_PKG_CONFIG_VAR_NO_SYSROOT. Signed-off-by: Michael Tretter Signed-off-by: Michael Olbrich --- scripts/pkg-config-wrapper | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/pkg-config-wrapper b/scripts/pkg-config-wrapper index d9e111d6c..79018c63c 100755 --- a/scripts/pkg-config-wrapper +++ b/scripts/pkg-config-wrapper @@ -41,7 +41,7 @@ IFS="${orig_IFS}" for ((i = 1; i <= ${#}; i++)); do case "${!i}" in --variable*) - found_var=true + found_var=${!i#"--variable="} break ;; *) @@ -61,8 +61,8 @@ args=( \ "-e" "s~/lib/pkgconfig/\.\./\.\.~~g" \ ) -if [ -n "${PTXDIST_PKG_CONFIG_VAR_NO_SYSROOT}" -a \ - -n "${found_var}" ]; then +if [ -n "${found_var}" -a \ + "${PTXDIST_PKG_CONFIG_VAR_NO_SYSROOT#*${found_var}}" != "${PTXDIST_PKG_CONFIG_VAR_NO_SYSROOT}" ]; then # # remove sysroot for variables that return a path # -- cgit v1.2.3