[arch-projects] [devtools][PATCH] archbuild: explicitly exit with makechrootpkg's return

Dave Reisner d at falconindy.com
Sun Dec 4 12:00:38 EST 2011


On Sun, Dec 04, 2011 at 05:41:22PM +0100, Lukas Fleischer wrote:
> On Sun, Dec 04, 2011 at 11:13:46AM -0500, Dave Reisner wrote:
> > This fixes a compound command such as the one below from continuing even
> > if the first fails.
> > 
> >   extra-x86_64-build && extra-i686-build
> > 
> > The problem is that the EXIT trap is fired if we let the script run to
> > completion. Instead, explicitly call cleanup with the return of the
> > makechrootpkg call to properly exit with error.
> > 
> > Signed-off-by: Dave Reisner <dreisner at archlinux.org>
> > ---
> >  archbuild.in |    1 +
> >  1 files changed, 1 insertions(+), 0 deletions(-)
> > 
> 
> Signed-off-by: Lukas Fleischer <archlinux at cryptocrack.de>
> 
> > diff --git a/archbuild.in b/archbuild.in
> > index 502654c..733a79a 100644
> > --- a/archbuild.in
> > +++ b/archbuild.in
> > @@ -84,3 +84,4 @@ fi
> >  
> >  msg "Building in chroot for [${repo}] (${arch})..."
> >  setarch "${arch}" makechrootpkg -c -n -r "${chroots}/${repo}-${arch}"
> > +cleanup $?
> > -- 
> > 1.7.8

I'm having second thoughts about this, actually... the debug output
shows that we call the cleanup routine in makechrootpkg, and then fall
out and call the cleanup routine in archbuild. We should just exec the
last command here and let it replace the shell so that it exits
properly. I'll send a new patch.

d
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://mailman.archlinux.org/pipermail/arch-projects/attachments/20111204/6346531d/attachment.asc>


More information about the arch-projects mailing list