Bug#874052: pbuilder: B20autopkgtest, hook script fails within a Jessie chroot due bashism

Guido Günther agx at sigxcpu.org
Wed Oct 4 19:05:35 UTC 2017


control: -1 tags +patch

Hi,
On Sat, Sep 02, 2017 at 03:00:04PM +0200, Carsten Schoenert wrote:
> Package: pbuilder
> Version: 0.228.8
> Severity: normal
> 
> Dear Maintainer,
> 
> I heavily use the hook script B20autopkgtest from the shipped examples scripts
> within pbuilder package within my local builds to test potentially uploads of
> packages.
> 
> And this works perfectly within current chroot environments for unstable
> ans also for Stretch. But within a Jessie chroot the hook script is
> failing due some bashism inside without a shebang of /bin/bash
> 
> > ...
> > dpkg-genchanges: not including original source code in upload
> > I: copying local configuration
> > I: user script /home/pbuilder/build/cow.13852/tmp/hooks/B20autopkgtest starting
> > + cd /build/icedove-52.3.0/debian/..
> > + [ ! -f debian/tests/control ]
> > + [ ! -f debian/files ]
> > + [ -n  ]
> > + unset newpid_name
> > + apt-cache policy newpid
> > + grep -q newpid:
> > + echo The newpid package seems to be available, considering for installation
> > The newpid package seems to be available, considering for installation
> > + newpid_name=newpid
> > /tmp/hooks/B20autopkgtest: 65: /tmp/hooks/B20autopkgtest: Bad substitution
> 
> Using checkbashism is showing exactly this line using Bash syntax.
> 
> > carsten at i5:/usr/share/doc/pbuilder/examples  $ checkbashisms B20autopkgtest 
> > possible bashism in B20autopkgtest line 65 (bash arrays, ${name[0|*|@]}):
> > apt-get install -y "${APTGETOPT[@]}" autopkgtest apt-utils pbuilder $newpid_name
> 
> I changed the shebang to using /bin/bash and the script is also working in a
> Jessie chroot again.

The script used APTGETOPT which is also used in other scripts as array
but all use /bin/bash so lets use that for B20autopkgtest too. Patch
attached.
Cheers,
 -- Guido
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-B20autopkgtest-Use-bin-bash.patch
Type: text/x-diff
Size: 767 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pbuilder-maint/attachments/20171004/93fbbfb4/attachment-0001.patch>


More information about the Pbuilder-maint mailing list