FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > ArchLinux > ArchLinux Pacman Development

 
 
LinkBack Thread Tools
 
Old 09-23-2012, 03:53 PM
Dave Reisner
 
Default makepkg: move debug symbol stripping to separate function

On Mon, Sep 24, 2012 at 12:44:31AM +1000, Allan McRae wrote:
> 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

"$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);;

This is a little strange since $STRIP_SHARED and friends are simple
variables. Why not just leave it as a simple string assignment?

> *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[@]}

"$binary"

> done
> fi
>
> --
> 1.7.12.1
>
>
 

Thread Tools




All times are GMT. The time now is 08:47 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org