summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorAllan McRae <allan@archlinux.org>2012-09-29 08:44:36 +0200
committerAllan McRae <allan@archlinux.org>2012-11-27 06:16:15 +0100
commitdbbe3e7cb4ad2ebc45d12acf4427635142165e6e (patch)
treed2233e113f1d31f9320c943c4ab0860466441cff /scripts
parent13667fd4b132c655e300535e787ebcf9cbc29cd7 (diff)
downloadpacman-dbbe3e7cb4ad2ebc45d12acf4427635142165e6e.tar.gz
pacman-dbbe3e7cb4ad2ebc45d12acf4427635142165e6e.tar.xz
makepkg: assign debugging symbol directory to a variable
Simplifies the stripping of files a lot. Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/makepkg.sh.in27
1 files changed, 13 insertions, 14 deletions
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 915ee897..9c98d7eb 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -1438,38 +1438,36 @@ strip_file() {
# has this file already been stripped
if [[ -n "$bid" ]]; then
- if [[ -f "$pkgdir-@DEBUGSUFFIX@"/usr/lib/debug/.build_id/${bid:0:2}/${bid:2}.debug ]]; then
+ if [[ -f "$dbgdir/.build_id/${bid:0:2}/${bid:2}.debug" ]]; then
return
fi
- elif [[ -f "$pkgdir-@DEBUGSUFFIX@/usr/lib/debug/$binary.debug" ]]; then
+ elif [[ -f "$dbgdir/$binary.debug" ]]; then
return
fi
- mkdir -p "$pkgdir-@DEBUGSUFFIX@/usr/lib/debug/${binary%/*}"
- objcopy --only-keep-debug "$binary" "$pkgdir-@DEBUGSUFFIX@/usr/lib/debug/$binary.debug"
- objcopy --add-gnu-debuglink="$pkgdir-@DEBUGSUFFIX@/usr/lib/debug/${binary#/}.debug" "$binary"
+ mkdir -p "$dbgdir/${binary%/*}"
+ objcopy --only-keep-debug "$binary" "$dbgdir/$binary.debug"
+ objcopy --add-gnu-debuglink="$dbgdir/${binary#/}.debug" "$binary"
# create any needed hardlinks
while read -d '' file ; do
- if [[ "${binary}" -ef "${file}" &&
- ! -f "$pkgdir-@DEBUGSUFFIX@/usr/lib/debug/${file}.debug" ]]; then
- mkdir -p "$pkgdir-@DEBUGSUFFIX@/usr/lib/debug/${file%/*}"
- ln "$pkgdir-@DEBUGSUFFIX@/usr/lib/debug/${binary}.debug" \
- "$pkgdir-@DEBUGSUFFIX@/usr/lib/debug/${file}.debug"
+ if [[ "${binary}" -ef "${file}" && ! -f "$dbgdir/${file}.debug" ]]; then
+ mkdir -p "$dbgdir/${file%/*}"
+ ln "$dbgdir/${binary}.debug" "$dbgdir/${file}.debug"
fi
done < <(find . -type f -perm -u+w -print0 2>/dev/null)
if [[ -n "$bid" ]]; then
local target
- mkdir -p "$pkgdir-@DEBUGSUFFIX@/usr/lib/debug/.build_id/${bid:0:2}"
+ mkdir -p "$dbgdir/.build_id/${bid:0:2}"
target="../../../../../${binary#./}"
target="${target/..\/..\/usr\/lib\/}"
target="${target/..\/usr\/}"
- ln -s "$target" "$pkgdir-@DEBUGSUFFIX@/usr/lib/debug/.build_id/${bid:0:2}/${bid:2}"
+ ln -s "$target" "$dbgdir/.build_id/${bid:0:2}/${bid:2}"
target="../../${binary#./}.debug"
- ln -s "$target" "$pkgdir-@DEBUGSUFFIX@/usr/lib/debug/.build_id/${bid:0:2}/${bid:2}.debug"
+ ln -s "$target" "$dbgdir/.build_id/${bid:0:2}/${bid:2}.debug"
fi
fi
@@ -1532,7 +1530,8 @@ tidy_install() {
[[ -z ${STRIP_STATIC+x} ]] && STRIP_STATIC="-S"
if check_option "debug" "y"; then
- mkdir -p $pkgdir-@DEBUGSUFFIX@/usr/lib/debug
+ dbgdir="$pkgdir-@DEBUGSUFFIX@/usr/lib/debug"
+ mkdir -p "$dbgdir"
fi
local binary strip_flags