summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scripts/find-debuginfo.sh14
1 files changed, 9 insertions, 5 deletions
diff --git a/scripts/find-debuginfo.sh b/scripts/find-debuginfo.sh
index efcc72ed2..8b7a6c44a 100644
--- a/scripts/find-debuginfo.sh
+++ b/scripts/find-debuginfo.sh
@@ -142,12 +142,16 @@ debug_link()
# this should correspond to what brp-symlink is doing
case $t in
/usr*)
- link_relative "$t" "$l" "$RPM_BUILD_ROOT"
- ;;
+ link_relative "$t" "$l" "$RPM_BUILD_ROOT"
+ ;;
*)
- mkdir -p "$(dirname "$RPM_BUILD_ROOT$l")" && \
- ln -snf "$t" "$RPM_BUILD_ROOT$l"
- ;;
+ if [ ! -e $t ]; then
+ link_relative "$t" "$l" "$RPM_BUILD_ROOT"
+ else
+ mkdir -p "$(dirname "$RPM_BUILD_ROOT$l")" && \
+ ln -snf "$t" "$RPM_BUILD_ROOT$l"
+ fi
+ ;;
esac
}