From 309af2d59e0d9fb1c6181386643ec22e7c54a196 Mon Sep 17 00:00:00 2001 From: Vitaly Chikunov Date: Thu, 12 Nov 2020 22:02:42 +0300 Subject: [PATCH] debuginfo: Create empty src/debug directories for paths with `..' Create empty directories under `/usr/src/debug` tree for source paths containing `..` (for example `../../src` in elfutils). This should fix debuginfo sources for autotools builds in subdir. Fixes: https://bugzilla.altlinux.org/39175 --- scripts/process-debuginfo.in | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/scripts/process-debuginfo.in b/scripts/process-debuginfo.in index ba34b09..6dbfb7d 100755 --- a/scripts/process-debuginfo.in +++ b/scripts/process-debuginfo.in @@ -96,10 +96,15 @@ fi mkdir -p .debuginfo/src/"${f%/*}" awk 'BEGIN{RS="\0";ORS="\n"}{print}' .tmp/src.$$ |LC_ALL=C sort -u | while read -r src; do - [ -f "$RPM_BUILD_DIR"/"$src" ] || continue - if [ ! -f ./usr/src/debug/"$src" ]; then - install -pD -m644 "$RPM_BUILD_DIR"/"$src" ./usr/src/debug/"$src".$$ - mv -f ./usr/src/debug/"$src".$$ ./usr/src/debug/"$src" + if [ -f "$RPM_BUILD_DIR"/"$src" ]; then + if [ ! -f ./usr/src/debug/"$src" ]; then + install -pD -m644 "$RPM_BUILD_DIR"/"$src" ./usr/src/debug/"$src".$$ + mv -f ./usr/src/debug/"$src".$$ ./usr/src/debug/"$src" + fi + elif [ -d "$RPM_BUILD_DIR"/"$src" ]; then + mkdir -p ./usr/src/debug/"$src" + else + continue fi printf '%s\n' /usr/src/debug/"$src" done >.debuginfo/src/"$f"