FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > ArchLinux > ArchLinux Pacman Development

 
 
LinkBack Thread Tools
 
Old 09-11-2011, 03:22 AM
Dave Reisner
 
Default makepkg: unset errexit when sourcing /etc/profile

This is a fix for a bash3 specific bug, where a file sourced by
/etc/profile would exit non-zero and make its way back up to makepkg,
forcing it to exit after package installation. Along with unsetting the
ERR handler, temporarily unset errexit to avoid this.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
---
scripts/makepkg.sh.in | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 5981603..a130557 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -474,11 +474,13 @@ handle_deps() {
fi

# we might need the new system environment
- # avoid triggering the ERR trap
+ # avoid triggering the ERR trap and exiting
+ set +x
local restoretrap=$(trap -p ERR)
trap - ERR
source /etc/profile &>/dev/null
eval $restoretrap
+ set -x

return $R_DEPS_SATISFIED
}
--
1.7.6.1
 
Old 09-11-2011, 03:34 AM
Dave Reisner
 
Default makepkg: unset errexit when sourcing /etc/profile

On Sat, Sep 10, 2011 at 11:22:49PM -0400, Dave Reisner wrote:
> This is a fix for a bash3 specific bug, where a file sourced by
> /etc/profile would exit non-zero and make its way back up to makepkg,
> forcing it to exit after package installation. Along with unsetting the
> ERR handler, temporarily unset errexit to avoid this.
>
> Signed-off-by: Dave Reisner <dreisner@archlinux.org>
> ---
> scripts/makepkg.sh.in | 4 +++-
> 1 files changed, 3 insertions(+), 1 deletions(-)
>
> diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
> index 5981603..a130557 100644
> --- a/scripts/makepkg.sh.in
> +++ b/scripts/makepkg.sh.in
> @@ -474,11 +474,13 @@ handle_deps() {
> fi
>
> # we might need the new system environment
> - # avoid triggering the ERR trap
> + # avoid triggering the ERR trap and exiting
> + set +x

Blonde moment. We're fiddling with the 'e' flag here, not the 'x' flag.
Fixed on my 'makepkg' branch.

> local restoretrap=$(trap -p ERR)
> trap - ERR
> source /etc/profile &>/dev/null
> eval $restoretrap
> + set -x
>
> return $R_DEPS_SATISFIED
> }
> --
> 1.7.6.1
>
 

Thread Tools




All times are GMT. The time now is 07:22 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org