[pacman-dev] makepkg: unsetting variables
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 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
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@zwerg:~] $ CFLAGS="-O2" [crazy@zwerg:~] $ export CFLAGS="${CFLAGS} -mno-tls-direct-seg-refs" [crazy@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@archlinux.org http://www.archlinux.org/mailman/listinfo/pacman-dev
Gabriel C wrote:
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 ?
Obviously, this was an visualized example taken from a PKGBUILD not a shell. Thanks anyways, but let me assure you that I know that my box works cos I maintain it from the ground up. -P
On 12/6/06, Alexander Baldeck <kth5@archlinuxppc.org> wrote:
Hey again,
sorry for being such a nagger today.
Then again, I have a problem with this change - see attachment - to makepkg.
Yeah, I think this is one of those that I thought of while driving somewhere and just never wrote it down. The intent was to replace around 30 or so "unset foo" entries with a loop. Problem is that all the fun stuff inside build() gets included, which we don't want. A simple fix would be to add a ^ to the regex, and enforce that all PKGBUILD vars begin at column 0.
participants (3)
-
Aaron Griffin
-
Alexander Baldeck
-
Gabriel C