[PATCH] Apply arch-wildcard-part1.patch

Matt Palmer mpalmer at hezmatt.org
Wed Dec 15 03:41:03 UTC 2010


By Andres Mejia <mcitadel at gmail.com>, taken from
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=363193#159
---
 pbuilder-satisfydepends-funcs |   35 ++++++++++++++++++++++++-----------
 1 files changed, 24 insertions(+), 11 deletions(-)

diff --git a/pbuilder-satisfydepends-funcs b/pbuilder-satisfydepends-funcs
index f4cae2d..64436a0 100755
--- a/pbuilder-satisfydepends-funcs
+++ b/pbuilder-satisfydepends-funcs
@@ -123,19 +123,32 @@ checkbuilddep_archdeps() {
     local ARCH="$2"
     # 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" | egrep -q "(^|[[:space:]/]+)\![[:space:]/]*$ARCH($|[[:space:]/]+)"; then
-	return 0;
+    local PKG="$(echo "$INSTALLPKG" | cut -d ' ' -f 1)"
+    local USE_IT
+    local IGNORE_IT
+    local INCLUDE
+    # Use 'dpkg-architecture' to support architecture wildcards.
+    for d in $DEP_ARCHES; do
+        if echo "$d" | grep -q '!'; then
+            d="$(echo $d | sed 's/!//')"
+            if dpkg-architecture -a$ARCH -i$d; then
+                IGNORE_IT="yes"
+            fi
+        else
+            if dpkg-architecture -a$ARCH -i$d; then
+                USE_IT="yes"
+            fi
+            INCLUDE="yes"
+        fi
+    done
+    if [ $IGNORE_IT ] && [ $USE_IT ]; then
+        printf "W: inconsistent arch restriction on $PKG: " >&2
+        printf "$DEP_ARCHES depedency\n" >&2
     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 DEP_ARCHES
-	if ! echo "$DEP_ARCHES" | egrep -q "(^|[[:space:]/]+)$ARCH($|[[:space:]/]+)"; then
-	    return 0;
-	fi
+    if [ $IGNORE_IT ] || ( [ $INCLUDE ] && [ ! $USE_IT ] ); then
+        return 0
     fi
-    return 1;
+    return 1
 }
 
 checkbuilddep_provides() {
-- 
1.5.6.5


--qjNfmADvan18RZcF
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment; filename="0002-Add-a-little-more-verbosity-to-test-runs.patch"



More information about the Pbuilder-maint mailing list