From 78c12e2cfe056b94112e3207b7dc2305265bc727 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Minier?= Date: Sat, 31 Mar 2007 19:20:58 +0200 Subject: * Rework regular expressions in checkbuilddep_archdeps() to strip the [] enclosure early on and to permit spaces or slashes since some pbuilder-satisfydepends* implementations use tr to map spaces to slashes. --- pbuilder-satisfydepends-funcs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'pbuilder-satisfydepends-funcs') diff --git a/pbuilder-satisfydepends-funcs b/pbuilder-satisfydepends-funcs index d819698..7e4367d 100755 --- a/pbuilder-satisfydepends-funcs +++ b/pbuilder-satisfydepends-funcs @@ -55,14 +55,16 @@ function checkbuilddep_archdeps () { local INSTALLPKG="$1" local ARCH="$2" # architectures listed between [ and ] for this dep - local DEP_ARCHES="$(echo "$INSTALLPKG" | sed 's/.*\(\[.*\]\)/\1/')" + local DEP_ARCHES="$(echo "$INSTALLPKG" | sed 's/.*\[\(.*\)\].*/\1/')" # check for !$ARCH in DEP_ARCHES - if echo "$DEP_ARCHES" | grep -q "[[/]\!\($ARCH\)[]/]"; then + if echo "$DEP_ARCHES" | egrep -q "(^|[[:space:]/]+)\![[:space:]/]*$ARCH($|[[:space:]/]+)"; then return 0; fi + # check for a "!" which would mean there's a ! and hence $ARCH + # is included if ! echo "$DEP_ARCHES" | grep -q '!'; then - # check for arch in $ARCH in DEP_ARCHES - if ! echo "$DEP_ARCHES" | grep -q "[[/]\($ARCH\)[]/]"; then + # check for $ARCH in DEP_ARCHES + if ! echo "$DEP_ARCHES" | egrep -q "(^|[[:space:]/]+)$ARCH($|[[:space:]/]+)"; then return 0; fi fi -- cgit v1.2.3