index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Eli Schwartz <eschwartz@archlinux.org> | 2021-02-07 23:09:42 -0500 |
---|---|---|
committer | Allan McRae <allan@archlinux.org> | 2021-02-08 14:22:55 +1000 |
commit | 88d054093c1c99a697d95b26bd9aad5bc4d8e170 (patch) | |
tree | 77395a5c18d560c2e9a007ef6036dcff200e0a72 /scripts/libmakepkg | |
parent | ab549c846707230e44e2b7e08c6a04d44af916cd (diff) |
-rw-r--r-- | scripts/libmakepkg/tidy/strip.sh.in | 11 |
diff --git a/scripts/libmakepkg/tidy/strip.sh.in b/scripts/libmakepkg/tidy/strip.sh.in index 868b96f3..9cb0fd8d 100644 --- a/scripts/libmakepkg/tidy/strip.sh.in +++ b/scripts/libmakepkg/tidy/strip.sh.in @@ -69,7 +69,10 @@ strip_file() { # copy debug symbols to debug directory mkdir -p "$dbgdir/${binary%/*}" objcopy --only-keep-debug "$binary" "$dbgdir/$binary.debug" - objcopy --add-gnu-debuglink="$dbgdir/${binary#/}.debug" "$binary" + local tempfile=$(mktemp "$binary.XXXXXX") + objcopy --add-gnu-debuglink="$dbgdir/${binary#/}.debug" "$binary" "$tempfile" + cat "$tempfile" > "$binary" + rm "$tempfile" # create any needed hardlinks while IFS= read -rd '' file ; do @@ -93,7 +96,11 @@ strip_file() { fi fi - strip $@ "$binary" + local tempfile=$(mktemp "$binary.XXXXXX") + if strip "$@" "$binary" -o "$tempfile"; then + cat "$tempfile" > "$binary" + fi + rm -f "$tempfile" } |