Bug#483253: pbuilder: please properly support arch aliases (dpkg-architecture -i)

Modestas Vainius modestas at vainius.eu
Tue May 27 23:04:30 UTC 2008


Package: pbuilder
Version: 0.181
Severity: normal
Tags: patch

Hello,

current pbuilder checkbuilddep_archdeps() function does not support
architecture aliases like 'linux-any' which are supported by buildds.
Aliases can be checked by dpkg-architecture -i. The attached patch
resolves the problem.

-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (101, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.25-2-amd64 (SMP w/1 CPU core)
Locale: LANG=lt_LT.UTF-8, LC_CTYPE=lt_LT.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages pbuilder depends on:
ii  cdebconf [debconf-2.0]        0.131      Debian Configuration Management Sy
ii  cdebootstrap                  0.5.2      Bootstrap a Debian system
ii  coreutils                     6.10-6     The GNU core utilities
ii  debconf [debconf-2.0]         1.5.22     Debian configuration management sy
ii  debianutils                   2.28.6     Miscellaneous utilities specific t
ii  debootstrap                   1.0.9      Bootstrap a basic Debian system
ii  gcc                           4:4.2.3-9  The GNU C compiler
ii  wget                          1.11.2-1   retrieves files from the web

Versions of packages pbuilder recommends:
ii  cowdancer                     0.47       Copy-on-write directory tree utili
ii  devscripts                    2.10.28    scripts to make the life of a Debi
ii  fakeroot                      1.9.5      Gives a fake root environment
ii  sudo                          1.6.9p15-2 Provide limited super user privile

-- debconf information excluded
-------------- next part --------------
--- /usr/lib/pbuilder/pbuilder-satisfydepends-funcs	2008-05-24 16:12:35.000000000 +0300
+++ pbuilder-satisfydepends-funcs	2008-05-28 01:59:48.000000000 +0300
@@ -71,19 +71,25 @@
     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 arch
+    
+    echo "$DEP_ARCHES" | sed "s/[[:space:]/]\+/\n/g" | 
+    while read arch; do
+        local narch=`expr "$arch" : "^!\(.*\)"`
+        if [ -n "$narch" ]; then arch="$narch"; fi
+        if dpkg-architecture -a$ARCH -i$arch; then
+            test -n "$narch"; return $(($?+2));
+        fi
+    done
+    ret=$?
+    if [ "$ret" -ge 2 ]; then
+        # Match found. If 2, it was negated, if 3 - normal one.
+        test "$ret" -eq 2; return;
+    else
+        # check for a "!" which would mean there's a !<otherarch> and
+        # hence our arch is included
+        ! echo "$DEP_ARCHES" | grep -q "!"; return;
     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
-    fi
-    return 1;
 }
 
 function checkbuilddep_provides () {


More information about the Pbuilder-maint mailing list