FS#12812 - makepkg3.2.2 crash, if PKGBUILD losed arch=() line.

Attached to Project: Pacman
Opened by Road Tang (roadtang) - Friday, 16 January 2009, 05:40 GMT
Last edited by Allan McRae (Allan) - Monday, 03 August 2009, 03:30 GMT
Task Type Bug Report
Category makepkg
Status Closed
Assigned To Allan McRae (Allan)
Architecture i686
Severity Medium
Priority Normal
Reported Version 3.2.2
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Summary and Info:
when make the PKGBUILD of squirm from the ABS.
the makepkg crash with message
"/usr/bin/makepkg: line 113: printf: `$': invalid format character"

I found the PKGBUILD losed arch=() line. after add arch=(i686),
the makepkg works.

Steps to Reproduce:
1. get the squirm PKGBUILD, put it into current directory.
------------- start---------------
# Maintainer: Spider.007 <archPackage@spider007.net>
# Contributor: Spider.007 <archPackage@spider007.net>
packager="Spider.007 <archPackage@spider007.net>"
pkgname=squirm
pkgver=1.26
pkgrel=1
pkgdesc="Squirm is a fast & configurable redirector for squid. This package includes an adzap2squirm script"
url="http://squirm.foote.com.au/"
groups=
provides=
depends=('squid')
source=("$url/$pkgname-$pkgver.tgz")
md5sums=('54ac1d208620ec1e4419f97315d38848')

build() {
cp $startdir/Makefile $startdir/src/$pkgname-$pkgver
cd $startdir/src/$pkgname-$pkgver

make || return 1
sed "s|PREFIX=|PREFIX=$startdir/pkg|g" Makefile > Makefile.new && mv Makefile.new Makefile

make install
}
-------------------- end -------------------------

2. run makepkg version3.2.2, errors take places.
3. add arch=(i686) to PKGBUILD
4. run makepkg again. It's good.


   PKGBUILD (0.7 KiB)
This task depends upon

Closed by  Allan McRae (Allan)
Monday, 03 August 2009, 03:30 GMT
Reason for closing:  Fixed
Additional comments about closing:  pacman-3.3.0
Comment by Allan McRae (Allan) - Friday, 16 January 2009, 05:50 GMT
I get:

> makepkg
==> ERROR: squirm is not available for the 'i686' architecture.
Note that many packages may need a line added to their PKGBUILD
such as arch=('i686').

The line that is causing the issue is:
printf "\033[1;31m==> $(gettext "ERROR:")\033[1;0m\033[1;1m ${mesg}\033[1;0m\n" "$@" >&2
That looks fine to me...

A long shot, but what locale are you using?
Comment by Road Tang (roadtang) - Friday, 16 January 2009, 05:59 GMT

Not en_US. my local is zh_CN.gb2312..

I changed LC_ALL to en_US. the problem disappeared.

$ makepkg
/usr/bin/makepkg: line 113: printf: `$': invalid format character
==> 错误:
$ env LC_ALL=en_US makepkg
==> ERROR: squirm is not available for the 'i686' architecture.
Note that many packages may need a line added to their PKGBUILD
such as arch=('i686').

but why?
Comment by Allan McRae (Allan) - Friday, 16 January 2009, 06:44 GMT
Well, here is the translation:

msgid "%s is not available for the '%s' architecture."
msgstr "%1$s 不具备 '%2$s' 架构。"

If I get rid of the "1$" and "2$: it works... Someone with translation experience will need to chime in here.
Comment by Allan McRae (Allan) - Friday, 16 January 2009, 10:24 GMT
Hmmm... I do not think printf in bash even handles order arguments.
Comment by Dan McGee (toofishes) - Friday, 16 January 2009, 13:15 GMT
Looks like it- we should maybe make a note of this in translation-help and then patch these out?
Comment by Allan McRae (Allan) - Friday, 16 January 2009, 13:39 GMT
It would take more work, but should we separate out the script translations into a different file?
Comment by Xavier (shining) - Friday, 16 January 2009, 13:40 GMT
I am not sure what we could say in translation-help. It might be easier to give a clear message to translators if C and bash code was not mixed in the same .po file. Or maybe not, I admit I didn't give this a deep thinking so I could miss something obvious :)

Loading...