From b82c625202cbb0a46f47bb4eb7c25eac8eb8bb54 Mon Sep 17 00:00:00 2001 From: Emilio Pozuelo Monfort Date: Sat, 19 Feb 2011 19:29:19 +0000 Subject: Bug#606699: pbuilder NMU 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 --- pbuilder-satisfydepends-funcs | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) (limited to 'pbuilder-satisfydepends-funcs') 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 ! 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() { -- cgit v1.2.3