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 06-23-2010, 03:20 AM
"Allan McRae"
 
Default makepkg: prevent error trap activation in bash-3.2

Running "pacman -T foo" is expected to return a non-zero value when
"foo" is not installed. This sets of the error trap in bash-3.2 but
not bash 4.x. Work around this by disabling the error trap around
this pacman call as we are manually checking the return value anyway.

Signed-off-by: Allan McRae <allan@archlinux.org>
---
scripts/makepkg.sh.in | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 4f9f89b..2699f63 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -382,11 +382,15 @@ run_pacman() {
}

check_deps() {
- (( $# > 0 )) || return
+ (( $# > 0 )) || return 0

+ # Disable error trap in pacman subshell call as this breaks bash-3.2 compatibility
+ # Also, a non-zero return value is not unexpected and we are manually dealing them
+ set +E
local ret=0
- pmout=$(run_pacman -T "$@")
- ret=$?
+ pmout=$(run_pacman -T "$@") || ret=$?
+ set -E
+
if (( ret == 127 )); then #unresolved deps
echo "$pmout"
elif (( ret )); then
--
1.7.1
 
Old 06-23-2010, 03:24 AM
Andres P
 
Default makepkg: prevent error trap activation in bash-3.2

On Tue, Jun 22, 2010 at 10:50 PM, Allan McRae <allan@archlinux.org> wrote:
> Running "pacman -T foo" is expected to return a non-zero value when
> "foo" is not installed. *This sets of the error trap in bash-3.2 but
> not bash 4.x. *Work around this by disabling the error trap around
> this pacman call as we are manually checking the return value anyway.
>
> Signed-off-by: Allan McRae <allan@archlinux.org>

What repo?

Andres P
 
Old 06-23-2010, 03:51 AM
"Allan McRae"
 
Default makepkg: prevent error trap activation in bash-3.2

On 23/06/10 13:24, Andres P wrote:

On Tue, Jun 22, 2010 at 10:50 PM, Allan McRae<allan@archlinux.org> wrote:

Running "pacman -T foo" is expected to return a non-zero value when
"foo" is not installed. This sets of the error trap in bash-3.2 but
not bash 4.x. Work around this by disabling the error trap around
this pacman call as we are manually checking the return value anyway.

Signed-off-by: Allan McRae<allan@archlinux.org>


What repo?



On my working-maint branch, which will be pulled to maint and the merged
into master. The patches you want to rebase are destined for then
master branch and need to be rebased on this patch and those already on
master. So I would wait the couple of days before Dan does all that
merging and pushes it to the main repo.


Allan
 

Thread Tools




All times are GMT. The time now is 09:16 PM.

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