[pacman-dev] makepkg: unsetting variables

Gabriel C nix.or.die at googlemail.com
Wed Dec 6 09:05:03 EST 2006


Alexander Baldeck schrieb:
> Hey again,
>
> sorry for being such a nagger today.
>
> Then again, I have a problem with this change - see attachment - to makepkg.
>
> Imagine you want to build glibc from Archlinux ABS. I have two cases for 
> you in which it starts messing things up:
>
> 1) comparisons in if-clauses make makepkg freak out
>
> The following example:
>
> if [ "${CARCH}" = "i686" ]; then
>      # Hack to fix NPTL issues with Xen, only required on 32bit platforms
>      export CFLAGS="${CFLAGS} -mno-tls-direct-seg-refs"
> fi
>
>
> causes:
>
> /usr/bin/makepkg: line 415: unset: `[': not a valid identifier
> /usr/bin/makepkg: line 415: unset: `"${CARCH}"': not a valid identifier
> /usr/bin/makepkg: line 415: unset: `=': not a valid identifier
> /usr/bin/makepkg: line 415: unset: `"i686"': not a valid identifier
>
>
> 2) appending strings in bash-style does not work anymore
>
> After getting rid of the if-clauses in the PKGBUILD for the sake of 
> testing, a line like this:
>
> $ CFLAGS="-O2"
> $ export CFLAGS="${CFLAGS} -mno-tls-direct-seg-refs"
>
> will result in:
>
> $ echo $CFLAGS
> $ -mno-tls-direct-seg-refs
>   

fix your box ?

[crazy at zwerg:~] $ CFLAGS="-O2"
[crazy at zwerg:~] $ export CFLAGS="${CFLAGS} -mno-tls-direct-seg-refs"
[crazy at zwerg:~] $ echo $CFLAGS
-O2 -mno-tls-direct-seg-refs

>
> This can't be right... sorry. Since the commit message shows that frugal 
> changes were merged at that time plus that they may still be incomplete, 
> I understand the fact that it might not be ready for general use but at 
> least import something that doesn't fail so obviously. :)
>
> BTW, is there no bug tracker for pacman?
>
>
> Cheers,
>
> -O
>   
> ------------------------------------------------------------------------
>
> --- /root/pacman-lib/scripts/makepkg	2006-12-05 07:43:42.000000000 +0000
> +++ /usr/bin/makepkg	2006-12-06 13:38:13.000000000 +0000
> @@ -409,11 +409,6 @@
>  if [ ! -f $BUILDSCRIPT ]; then
>  	error "$BUILDSCRIPT does not exist."
>  	exit 1
> -else
> -    #this is fun.... we'll unset
> -    for var in $(grep "=" $BUILDSCRIPT | sed "s|.*\(\<.*\>\)=.*|\1|g"); do
> -        unset $var
> -    done
>  fi
>  
>  source $BUILDSCRIPT
>   
> ------------------------------------------------------------------------
>
> _______________________________________________
> pacman-dev mailing list
> pacman-dev at archlinux.org
> http://www.archlinux.org/mailman/listinfo/pacman-dev
>   





More information about the pacman-dev mailing list