Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   ArchLinux Pacman Development (http://www.linux-archive.org/archlinux-pacman-development/)
-   -   makepkg: move debug symbol stripping to separate function (http://www.linux-archive.org/archlinux-pacman-development/706644-makepkg-move-debug-symbol-stripping-separate-function.html)

Allan McRae 09-23-2012 02:44 PM

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>
---
scripts/makepkg.sh.in | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 7b516ff..5283d73 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -1421,6 +1421,11 @@ run_package() {
run_function_safe "$pkgfunc"
}

+strip_file() {
+ local binary=$1; shift
+ strip $@ $binary
+}
+
tidy_install() {
cd_safe "$pkgdir"
msg "$(gettext "Tidying install...")"
@@ -1475,16 +1480,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

--
1.7.12.1


All times are GMT. The time now is 03:17 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.