mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH] pkg-config-wrapper: remove sysroot only from specified variables
@ 2019-10-08  9:58 Michael Tretter
  0 siblings, 0 replies; only message in thread
From: Michael Tretter @ 2019-10-08  9:58 UTC (permalink / raw)
  To: ptxdist; +Cc: Michael Tretter

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 <m.tretter@pengutronix.de>
---
 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
     #
-- 
2.20.1


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-10-08  9:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-08  9:58 [ptxdist] [PATCH] pkg-config-wrapper: remove sysroot only from specified variables Michael Tretter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox