You are not logged in.
I noticed we usually use || return 1 to break the build function in case or errors.
It works, but you have to recall to put it almost everywhere.
I was thinking, what about using `set -e' at the start of the function? *
So the build() function would fail automatically if any subcommand returns non zero,
if a command can return nonzero we will add `|| true', but it is much rarer.
this snipped from one of the PKBUILD protos
build() {
cd "$srcdir/***-$pkgver"
# install module in vendor directories.
PERL_MM_USE_DEFAULT=1 perl Makefile.PL INSTALLDIRS=vendor || return 1
make || return 1
make install DESTDIR="$pkgdir/" || return 1
}would become:
build() {
set -e
cd "$srcdir/***-$pkgver"
# install module in vendor directories.
PERL_MM_USE_DEFAULT=1 perl Makefile.PL INSTALLDIRS=vendor
make
make install DESTDIR="$pkgdir/"
}*Seek '^ +set \[\+' (no quotes of course) in the bash manual.
Last edited by ezzetabi (2010-01-29 10:05:33)
Offline
Sounds not bad. But don't forget to add `set +e` at the end of build()
This silver ladybug at line 28...
Offline
Or wait for the next pacman release where this is done automatically.
git commit: http://projects.archlinux.org/pacman.gi … d=545eac14
Offline
Oh... :S
Offline