[pacman-dev] [patch] makepkg3 -- makepkg doesn't stop on build failure.
Dan McGee
dpmcgee at gmail.com
Sun Mar 25 13:11:00 EDT 2007
On 3/25/07, Andrew Fyfe <andrew at neptune-one.net> wrote:
> Dan McGee wrote:
> > On 3/25/07, Andrew Fyfe <andrew at neptune-one.net> wrote:
> >> Andrew Fyfe wrote:
> >>> Hi
> >>>
> >>> Found a small bug. When running 'makepkg --log' makepkg doesn't stop if
> >>> build() fails. Patch attached, see the header for an example.
> >>>
> >>> Andrew
> >
> > So should I be applying both patches?
> >
> > -Dan
> >
> > _______________________________________________
> > pacman-dev mailing list
> > pacman-dev at archlinux.org
> > http://www.archlinux.org/mailman/listinfo/pacman-dev
> No just the second one.
>
> Andrew
I applied both and don't know why I shouldn't. It also allowed me to
simplify the code a bit, I'll put my current diff below.
On a side note, do you have jabber or get on IRC much? If so, feel
free to add my jabber (dpmcgee at gmail.com) and/or join us on freenode
at #archlinux-pacman.
-Dan
Index: makepkg
===================================================================
RCS file: /home/cvs-pacman/pacman-lib/scripts/makepkg,v
retrieving revision 1.64
diff -u -u -r1.64 makepkg
--- makepkg 24 Mar 2007 17:11:18 -0000 1.64
+++ makepkg 25 Mar 2007 17:10:25 -0000
@@ -883,6 +883,7 @@
echo $SHELLOPTS | grep errexit 2>&1 >/dev/null
set_e=$?
+ ret=0
if [ "$LOGGING" = "1" ]; then
BUILDLOG="${startdir}/${pkgname}-${pkgver}-${pkgrel}-${CARCH}.log"
if [ -f "$BUILDLOG" ]; then
@@ -899,24 +900,18 @@
#use 'errexit' to bail on syntax error
[ $set_e -eq 1 ] && set -e
- build 2>&1 | tee "$BUILDLOG"
+ build 2>&1 | tee "$BUILDLOG"; ret=${PIPESTATUS[0]}
[ $set_e -eq 1 ] && set +e
-
- if [ ${PIPESTATUS[0]} -gt 0 ]; then
- error "Build Failed. Aborting..."
- removedeps
- exit 2
- fi
else
#use 'errexit' to bail on syntax error
[ $set_e -eq 1 ] && set -e
- build 2>&1
+ build 2>&1; ret=$?
[ $set_e -eq 1 ] && set +e
- if [ $? -gt 0 ]; then
- error "Build Failed. Aborting..."
- removedeps
- exit 2
- fi
+ fi
+ if [ $ret -gt 0 ]; then
+ error "Build Failed. Aborting..."
+ removedeps
+ exit 2
fi
fi
More information about the pacman-dev
mailing list