summaryrefslogtreecommitdiff
path: root/packaging/eu-strip.patch
blob: 7b535a1c50290832c4997098d855edbdc82d76c4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
Index: rpm-4.9.1/scripts/find-debuginfo.sh
===================================================================
--- rpm-4.9.1.orig/scripts/find-debuginfo.sh	2012-08-02 14:00:14.103432963 -0700
+++ rpm-4.9.1/scripts/find-debuginfo.sh	2012-08-02 14:38:44.723358399 -0700
@@ -95,13 +95,9 @@
 
 strip_to_debug()
 {
-  local g=
   local r=
   $strip_r && r=--reloc-debug-sections
-  $strip_g && case "$(file -bi "$2")" in
-  application/x-sharedlib*) g=-g ;;
-  esac
-  eu-strip --remove-comment $r $g -f "$1" "$2" || exit
+  eu-strip --remove-comment $r -g -f "$1" "$2" || exit
   chmod 444 "$1" || exit
 }
 
@@ -229,8 +225,6 @@
   fi
 
   echo "extracting debug info from $f"
-  mode=$(stat -c %a "$f")
-  chmod +w "$f"
   id=$($(DEBUGEDIT=$(which debugedit 2>/dev/null); \
       echo ${DEBUGEDIT:-/usr/lib/rpm/debugedit}) -b "$RPM_BUILD_DIR" \
       -d /usr/src/debug -i -l "$SOURCEFILE" "$f") || exit
@@ -250,25 +244,13 @@
   esac
 
   mkdir -p "${debugdn}"
-  objcopy --only-keep-debug $f $debugfn || :
-  (
-    shopt -s extglob
-    strip_option="--strip-all"
-    case "$f" in
-      *.ko)
-	strip_option="--strip-debug" ;;
-      *$STRIP_KEEP_SYMTAB*)
-	if test -n "$STRIP_KEEP_SYMTAB"; then
-	  strip_option="--strip-debug"
-        fi
-        ;;
-    esac
-    if test "$NO_DEBUGINFO_STRIP_DEBUG" = true ; then
-      strip_option=
-    fi
-    objcopy --add-gnu-debuglink=$debugfn -R .comment -R .GCC.command.line $strip_option $f
-    chmod $mode $f
-  ) || :
+  if test -w "$f"; then
+    strip_to_debug "${debugfn}" "$f"
+  else
+    chmod u+w "$f"
+    strip_to_debug "${debugfn}" "$f"
+    chmod u-w "$f"
+  fi
 
   if [ -n "$id" ]; then
     make_id_link "$id" "$dn/$(basename $f)"