2008-11-21 15:08:47 +01:00
|
|
|
From: Jan Blunck <jblunck@suse.de>
|
|
|
|
Subject: Do the symbolic links right in the first place
|
|
|
|
|
|
|
|
Since brp-symlink relinks symbolic links to enforce a certain policy we should
|
|
|
|
do it right in the first place. So this patch changes find-debuginfo.sh scripts
|
|
|
|
behavior to reflect that policy.
|
|
|
|
|
|
|
|
Signed-off-by: Jan Blunck <jblunck@suse.de>
|
|
|
|
|
2012-08-28 15:31:44 +02:00
|
|
|
--- ./scripts/find-debuginfo.sh.orig 2012-06-01 13:12:04.000000000 +0000
|
|
|
|
+++ ./scripts/find-debuginfo.sh 2012-06-01 13:12:17.000000000 +0000
|
|
|
|
@@ -133,7 +133,17 @@ debug_link()
|
2008-11-21 15:08:47 +01:00
|
|
|
local l="/usr/lib/debug$2"
|
|
|
|
local t="$1"
|
|
|
|
echo >> "$LINKSFILE" "$l $t"
|
|
|
|
- link_relative "$t" "$l" "$RPM_BUILD_ROOT"
|
|
|
|
+
|
|
|
|
+ # this should correspond to what brp-symlink is doing
|
|
|
|
+ case $t in
|
|
|
|
+ /usr*)
|
|
|
|
+ link_relative "$t" "$l" "$RPM_BUILD_ROOT"
|
|
|
|
+ ;;
|
|
|
|
+ *)
|
|
|
|
+ mkdir -p "$(dirname "$RPM_BUILD_ROOT$l")" && \
|
|
|
|
+ ln -snf "$t" "$RPM_BUILD_ROOT$l"
|
|
|
|
+ ;;
|
|
|
|
+ esac
|
|
|
|
}
|
|
|
|
|
2012-08-28 15:31:44 +02:00
|
|
|
# Provide .2, .3, ... symlinks to all filename instances of this build-id.
|
|
|
|
@@ -186,8 +196,8 @@ make_id_link()
|
2008-11-28 14:34:30 +01:00
|
|
|
|
|
|
|
local other=$(readlink -m "$root_idfile")
|
|
|
|
other=${other#$RPM_BUILD_ROOT}
|
|
|
|
- if cmp -s "$root_idfile" "$RPM_BUILD_ROOT$file" ||
|
|
|
|
- elfcmp "$root_idfile" "$RPM_BUILD_ROOT$file" ; then
|
|
|
|
+ if cmp -s "$RPM_BUILD_ROOT$other" "$RPM_BUILD_ROOT$file" ||
|
|
|
|
+ elfcmp "$RPM_BUILD_ROOT$other" "$RPM_BUILD_ROOT$file" ; then
|
|
|
|
# Two copies. Maybe one has to be setuid or something.
|
|
|
|
echo >&2 "*** WARNING: identical binaries are copied, not linked:"
|
|
|
|
echo >&2 " $file"
|