[pacman-dev] [PATCH] makepkg: exit on error during build() or package()

Henning Garus henning.garus at googlemail.com
Sun Aug 23 11:07:19 EDT 2009


On Sun, Aug 23, 2009 at 02:17:25PM +0200, Xavier wrote:
> On Sun, Aug 23, 2009 at 12:56 PM, Allan McRae<allan at archlinux.org> wrote:
> > Henning Garus wrote:
> >>
> >> Set the ERR trap to abort upon encountering an error during the execution
> >> of a build or package function.
> >>
> >> Activate set -E, which lets functions inherit the ERR trap.
> >>
> >>
> >>
> >
> > <snip>
> >
> > Just a quick query...  does this work with split packages and variables
> > defined in the package_foo() functions, especially when using the -L flag?
> >  I am too busy to test at the moment, but that has been the main issue in
> > getting this working in the past.
> >
> 
> If I understood correctly, all the problems came from the piping.
> Actually that's why you had to find an alternative to " | tee " in
> run_package.
> This patch does not introduce any piping so it should be fine on this side.

You are right, commands in a pipeline are executed in a subshell, so we don't
get the changed variables back when running the package functions. I also had
to treat the build function with logging differently because of this.

> I tested it now and it seems to work fine.

I tested again and found one minor issue: I forgot to delete the named pipe on
error. I will send a new patch.


More information about the pacman-dev mailing list