[pacman-dev] [PATCH v2] libmakepkg: when stripping split debug symbols, warn on duplicate paths

Eli Schwartz eschwartz at archlinux.org
Mon Oct 7 01:29:51 UTC 2019

Trying to strip multiple files installed to the same filepath (in
different components of a split package) can produce surprising results
if those files are built using different options. Per FS#63356 this is
not a supported PKGBUILD configuration. Instead, warn about such cases
when producing debug packages.

Fixes FS#63366

Signed-off-by: Eli Schwartz <eschwartz at archlinux.org>

v2: fix leading "./" in reported paths

 scripts/libmakepkg/tidy/strip.sh.in | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/scripts/libmakepkg/tidy/strip.sh.in b/scripts/libmakepkg/tidy/strip.sh.in
index 5bc0a842..892daf49 100644
--- a/scripts/libmakepkg/tidy/strip.sh.in
+++ b/scripts/libmakepkg/tidy/strip.sh.in
@@ -46,7 +46,13 @@ strip_file() {
 	if check_option "debug" "y"; then
 		local bid=$(build_id "$binary")
-		# has this file already been stripped
+		# has this filepath been stripped before under a different Build Id
+		if [[ -f "$dbgdir/$binary.debug" ]]; then
+			if [[ -n $bid && $bid != $(build_id "$dbgdir/$binary.debug") ]]; then
+				warning "Split package with multiple copies of the file '%s' have different Build Ids" "${binary#./}"
+			fi
+		fi
+		# has this file's hardlink already been stripped
 		if [[ -n "$bid" ]]; then
 			if [[ -f "$dbgdir/.build-id/${bid:0:2}/${bid:2}.debug" ]]; then

More information about the pacman-dev mailing list