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"