Hi,

I talked to Junichi and he told me it was fine if I NMU'ed pbuilder to fix these
bugs. This is the debdiff for my NMU.

Regards,
Emilio
diff -Nru pbuilder-0.199+nmu1/debian/changelog 
pbuilder-0.199+nmu2/debian/changelog
--- pbuilder-0.199+nmu1/debian/changelog        2010-12-28 16:19:38.000000000 
+0000
+++ pbuilder-0.199+nmu2/debian/changelog        2011-02-19 19:02:35.000000000 
+0000
@@ -1,3 +1,15 @@
+pbuilder (0.199+nmu2) unstable; urgency=low
+
+  * Non-maintainer upload with maintainer's permission.
+  * pbuilder-satisfydepends-aptitude: Resolve packages from experimental
+    when necessary. Logic stolen from sbuild. Closes: #606699.
+  * pbuilder-buildpackage, pbuilder-buildpackage-funcs: Handle
+    architecture wildcards properly. Patch from Andres Mejia.
+    Closes: #363193.
+  * Makefile: Don't require a UTF-8 encoding to check the manpages.
+
+ -- Emilio Pozuelo Monfort <po...@debian.org>  Sat, 19 Feb 2011 19:02:34 +0000
+
 pbuilder (0.199+nmu1) unstable; urgency=low
 
   * Non-Maintainer Upload.
diff -Nru pbuilder-0.199+nmu1/Makefile pbuilder-0.199+nmu2/Makefile
--- pbuilder-0.199+nmu1/Makefile        2010-01-31 03:52:57.000000000 +0000
+++ pbuilder-0.199+nmu2/Makefile        2011-02-19 19:01:58.000000000 +0000
@@ -184,7 +184,7 @@
 check:
        # syntax check
        $(foreach script,$(CHECK_SCRIPTS),bash -n $(script)$(newline))
-       $(foreach mp,$(CHECK_MANPAGES),LANG=C MANWIDTH=80 man --warnings -E 
UTF-8 -l $(mp) >/dev/null$(newline))
+       $(foreach mp,$(CHECK_MANPAGES),LANG=C MANWIDTH=80 man --warnings -l 
$(mp) >/dev/null$(newline))
        # testsuite
        $(foreach test,$(wildcard ./test_*),$(test)$(newline))
 
diff -Nru pbuilder-0.199+nmu1/pbuilder-buildpackage 
pbuilder-0.199+nmu2/pbuilder-buildpackage
--- pbuilder-0.199+nmu1/pbuilder-buildpackage   2010-01-23 04:39:06.000000000 
+0000
+++ pbuilder-0.199+nmu2/pbuilder-buildpackage   2011-02-19 18:16:49.000000000 
+0000
@@ -31,6 +31,9 @@
     exit 1;
 fi;
 
+# check if this package should be built at all
+checkarchitecture "$PACKAGENAME"
+
 if [ -n "$BUILDUSERNAME" -a -n "$BUILDUSERID" ]; then
     SUTOUSER="env LOGNAME=$BUILDUSERNAME su -p $BUILDUSERNAME"
     DEBBUILDOPTS="${DEBBUILDOPTS:+$DEBBUILDOPTS }-rfakeroot"
diff -Nru pbuilder-0.199+nmu1/pbuilder-buildpackage-funcs 
pbuilder-0.199+nmu2/pbuilder-buildpackage-funcs
--- pbuilder-0.199+nmu1/pbuilder-buildpackage-funcs     2010-07-05 
14:09:09.000000000 +0100
+++ pbuilder-0.199+nmu2/pbuilder-buildpackage-funcs     2011-02-19 
18:16:49.000000000 +0000
@@ -30,6 +30,25 @@
     done
 }
 
+function checkarchitecture () {
+    local DSCFILE="$1"
+    local ARCHES="$(cat $DSCFILE | grep Architecture | sed 's/^[^:]\+:\s*//')"
+    local ARCH=$(dpkg-architecture -qDEB_HOST_ARCH)
+    local VALID_ARCH
+    for d in $ARCHES; do
+        if dpkg-architecture -a$ARCH -i$d; then
+            VALID_ARCH="yes"
+            break
+        fi
+    done
+    if [ ! $VALID_ARCH ] && [ ! "$ARCHES" = "all" ]; then
+        local msg="E: $ARCH not in arch list or does not match any "
+        msg="$msg arch wildcards: $ARCHES"
+        log $msg
+        exit 2
+    fi
+}
+
 function checkbuilddep () {
     # call satisfydepends
     local BUILDOPT="--binary-all"
diff -Nru pbuilder-0.199+nmu1/pbuilder-satisfydepends-aptitude 
pbuilder-0.199+nmu2/pbuilder-satisfydepends-aptitude
--- pbuilder-0.199+nmu1/pbuilder-satisfydepends-aptitude        2010-07-05 
14:34:29.000000000 +0100
+++ pbuilder-0.199+nmu2/pbuilder-satisfydepends-aptitude        2011-02-19 
18:13:34.000000000 +0000
@@ -88,8 +88,8 @@
     fi
     $CHROOTEXEC sh -c "cat \"$BUILD_DEP_DEB_CONTROL\""
     $CHROOTEXEC sh -c "dpkg-deb -b 
\"$BUILD_DEP_DEB_DIR/pbuilder-satisfydepends-dummy\""
-    $CHROOTEXEC dpkg -i "$BUILD_DEP_DEB_DIR/pbuilder-satisfydepends-dummy.deb" 
|| true
-    $CHROOTEXEC aptitude -y --without-recommends -o 
APT::Install-Recommends=false "${PBUILDER_APTITUDE_CHECK_OPTS[@]}" -o 
Aptitude::ProblemResolver::StepScore=100 install pbuilder-satisfydepends-dummy
+    $CHROOTEXEC dpkg --force-depends --force-conflicts -i 
"$BUILD_DEP_DEB_DIR/pbuilder-satisfydepends-dummy.deb" || true
+    $CHROOTEXEC aptitude -y --without-recommends -o 
APT::Install-Recommends=false "${PBUILDER_APTITUDE_CHECK_OPTS[@]}" -o 
Aptitude::ProblemResolver::StepScore=100 -o 
"Aptitude::ProblemResolver::Hints::KeepDummy=reject 
pbuilder-satisfydepends-dummy :UNINST" -o 
Aptitude::ProblemResolver::Keep-All-Level=55000 -o 
Aptitude::ProblemResolver::Remove-Essential-Level=maximum install 
pbuilder-satisfydepends-dummy
     # check whether the aptitude's resolver kept the package
     if ! $CHROOTEXEC dpkg -l pbuilder-satisfydepends-dummy 2>/dev/null | grep 
-q ^ii; then
         echo "Aptitude couldn't satisfy the build dependencies"
diff -Nru pbuilder-0.199+nmu1/pbuilder-satisfydepends-funcs 
pbuilder-0.199+nmu2/pbuilder-satisfydepends-funcs
--- pbuilder-0.199+nmu1/pbuilder-satisfydepends-funcs   2010-06-20 
04:49:52.000000000 +0100
+++ pbuilder-0.199+nmu2/pbuilder-satisfydepends-funcs   2011-02-19 
18:16:44.000000000 +0000
@@ -123,19 +123,32 @@
     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() {

Reply via email to