quilt-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Quilt-dev] [PATCH] inspect-wrapper: Resolve links in source path if rpm


From: Jean Delvare
Subject: [Quilt-dev] [PATCH] inspect-wrapper: Resolve links in source path if rpmbuild did so
Date: Mon, 23 Nov 2020 16:56:42 +0100
User-agent: Evolution 3.34.4

Apparently rpmbuild will resolve symbolic links to patch files before
passing them to the patch utility. We need to do the same before we
attempt to turn absolute paths into relative paths for the series
file, otherwise we will fail to match the common path.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
---
 quilt/scripts/inspect-wrapper.in |    8 ++++++++
 1 file changed, 8 insertions(+)

--- a/quilt/scripts/inspect-wrapper.in
+++ b/quilt/scripts/inspect-wrapper.in
@@ -276,6 +276,14 @@ then
        if [ "${inputfile:0:1}" = / ]
        then
                unpackfile=${inputfile/$RPM_SOURCE_DIR}
+               # This may fail if rpmbuild resolved a symbolic link on the
+               # way to the source directory. If so, also resolve symbolic
+               # links to find the matching prefix.
+               if [ "${unpackfile:0:1}" = / ]
+               then
+                       RPM_SOURCE_DIR_P=$(cd -P "$RPM_SOURCE_DIR" && echo 
"$PWD")/
+                       unpackfile=${inputfile/$RPM_SOURCE_DIR_P}
+               fi
        else
                unpackfile=$QUILT_SETUP_PREFIX$(dir_to_dir "$RPM_BUILD_DIR" 
"$inputfile")
        fi

-- 
Jean Delvare
SUSE L3 Support




reply via email to

[Prev in Thread] Current Thread [Next in Thread]