diff options
author | Allan McRae <allan@archlinux.org> | 2012-09-23 13:28:03 +0200 |
---|---|---|
committer | Allan McRae <allan@archlinux.org> | 2012-11-27 06:16:15 +0100 |
commit | 6be96e7612877adb76fcf7b212765c387388597d (patch) | |
tree | 7b28e7a5d36d253fd061caaeda21a1e59b21a77b /scripts/makepkg.sh.in | |
parent | 6c22ef2c8287ef16f57fba08077520ad0c68dff8 (diff) | |
download | pacman-6be96e7612877adb76fcf7b212765c387388597d.tar.gz pacman-6be96e7612877adb76fcf7b212765c387388597d.tar.xz |
makepkg: move debug symbol stripping to separate function
Move stripping of files to a spearate function that will be expanded
for the handling of creating debug symbol packages.
Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'scripts/makepkg.sh.in')
-rw-r--r-- | scripts/makepkg.sh.in | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index 238d3408..5f96f08d 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -1426,6 +1426,11 @@ run_package() { run_function_safe "$pkgfunc" } +strip_file() { + local binary=$1; shift + strip $@ "$binary" +} + tidy_install() { cd_safe "$pkgdir" msg "$(gettext "Tidying install...")" @@ -1480,16 +1485,19 @@ tidy_install() { # make sure library stripping variables are defined to prevent excess stripping [[ -z ${STRIP_SHARED+x} ]] && STRIP_SHARED="-S" [[ -z ${STRIP_STATIC+x} ]] && STRIP_STATIC="-S" - local binary + local binary strip_flags find . -type f -perm -u+w -print0 2>/dev/null | while read -d '' binary ; do case "$(file -bi "$binary")" in *application/x-sharedlib*) # Libraries (.so) - strip $STRIP_SHARED "$binary";; + strip_flags="$STRIP_SHARED";; *application/x-archive*) # Libraries (.a) - strip $STRIP_STATIC "$binary";; + strip_flags="$STRIP_STATIC";; *application/x-executable*) # Binaries - strip $STRIP_BINARIES "$binary";; + strip_flags="$STRIP_BINARIES";; + *) + continue ;; esac + strip_file "$binary" ${strip_flags} done fi |