From e60c7421cdc7b48bec0f67a0a21cdbc7325bbb2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Minier?= Date: Sat, 31 Mar 2007 16:55:32 +0200 Subject: * Misc cleanups in checkbuilddep_archdeps(). --- pbuilder-satisfydepends-funcs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'pbuilder-satisfydepends-funcs') diff --git a/pbuilder-satisfydepends-funcs b/pbuilder-satisfydepends-funcs index f78e237..a59905e 100755 --- a/pbuilder-satisfydepends-funcs +++ b/pbuilder-satisfydepends-funcs @@ -54,13 +54,15 @@ function checkbuilddep_archdeps () { # returns FALSE on INSTALL local INSTALLPKG="$1" local ARCH="$2" - if echo "$INSTALLPKG" | sed 's/.*\(\[.*\]\)/\1/' | grep "[[/][!]\($ARCH\)[]/]" > /dev/null; then - # if !$ARCH exists in there, ERROR. + # architectures listed between [ and ] for this dep + local DEP_ARCHES="$(echo "$INSTALLPKG" | sed 's/.*\(\[.*\]\)/\1/')" + # check for !$ARCH in DEP_ARCHES + if echo "$DEP_ARCHES" | grep -q "[[/][!]\($ARCH\)[]/]"; then return 0; fi - if ! echo "$INSTALLPKG" | sed 's/.*\(\[.*\]\)/\1/' | grep "[!]" > /dev/null; then - if ! echo "$INSTALLPKG" | sed 's/.*\(\[.*\]\)/\1/' | grep "[[/]\($ARCH\)[]/]" > /dev/null; then - # if $ARCH does not exist, ERROR. + if ! echo "$DEP_ARCHES" | grep "[!]" > /dev/null; then + # check for arch in $ARCH in DEP_ARCHES + if ! echo "$DEP_ARCHES" | grep "[[/]\($ARCH\)[]/]" > /dev/null; then return 0; fi fi -- cgit v1.2.3