diff options
author | Loïc Minier <lool@dooz.org> | 2007-03-31 19:20:58 +0200 |
---|---|---|
committer | Loïc Minier <lool@dooz.org> | 2007-03-31 19:20:58 +0200 |
commit | 78c12e2cfe056b94112e3207b7dc2305265bc727 (patch) | |
tree | 5339bc62cbd52ad47550b475795b1b12fe0a0a33 | |
parent | 95f46bd66aa9d8eb8a81a6149b13d9f275c6a089 (diff) | |
download | pbuilder-78c12e2cfe056b94112e3207b7dc2305265bc727.tar pbuilder-78c12e2cfe056b94112e3207b7dc2305265bc727.tar.gz |
* 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.
-rwxr-xr-x | pbuilder-satisfydepends-funcs | 10 |
1 files changed, 6 insertions, 4 deletions
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 !<otherarch> 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 |