diff -Nru /tmp/MWAqJMfVFu/dpkg-1.14.4/debian/changelog /tmp/V6mOrMQZzb/dpkg-1.14.4/debian/changelog --- /tmp/MWAqJMfVFu/dpkg-1.14.4/debian/changelog 2007-05-24 09:30:41.000000000 -0700 +++ /tmp/V6mOrMQZzb/dpkg-1.14.4/debian/changelog 2007-07-02 12:28:01.000000000 -0700 @@ -1,3 +1,14 @@ +dpkg (1.14.4-0.1) unstable; urgency=low + + * Non-maintainer upload. + * Detect 'build-arch' target if present using make -f debian/rules -qn, and + use it instead of 'build' when called with -B. This allows maintainers + who have a build-arch target to use Build-Depends-Indep for any + build-dependencies that are only used in the build/binary-indep/binary + targets, with no further coordination required. Closes: #229357. + + -- Steve Langasek Mon, 02 Jul 2007 10:14:20 -0700 + dpkg (1.14.4) unstable; urgency=low [ Guillem Jover ] diff -Nru /tmp/MWAqJMfVFu/dpkg-1.14.4/scripts/dpkg-buildpackage.sh /tmp/V6mOrMQZzb/dpkg-1.14.4/scripts/dpkg-buildpackage.sh --- /tmp/MWAqJMfVFu/dpkg-1.14.4/scripts/dpkg-buildpackage.sh 2007-05-08 20:09:33.000000000 -0700 +++ /tmp/V6mOrMQZzb/dpkg-1.14.4/scripts/dpkg-buildpackage.sh 2007-07-02 12:09:11.000000000 -0700 @@ -226,7 +226,33 @@ cd ..; withecho dpkg-source $passopts $diffignore $tarignore -b "$dirn"; cd "$dirn" fi if [ x$sourceonly = x ]; then - withecho debian/rules build + USE_BUILD_ARCH=0 + if [ "$binarytarget" = "binary-arch" ]; then + set +e + make -f debian/rules -qn build-arch 2>/dev/null + MAKE_RETVAL=$? + set -e + # either make returned success (meaning we have a valid + # makefile, a valid invocation of make, and an + # up-to-date target of the given name) or it returned 1 + # (meaning we have a target of the given name which is + # not up-to-date, or we have a non-GNU make that happens + # to return 1 on an invalid make invocation or an + # invalid makefile). This means dpkg-buildpackage will + # be looking for a build-arch target instead of build + # target in some corner-case systems that are so + # un-Debian-like that half of Debian's packages don't + # build anyway due to GNU make assumptions in + # debian/rules. + if [ "$MAKE_RETVAL" = 1 ] || [ "$MAKE_RETVAL" = 0 ]; then + USE_BUILD_ARCH=1 + fi + fi + if [ "$USE_BUILD_ARCH" = 1 ]; then + withecho debian/rules build-arch + else + withecho debian/rules build + fi withecho $rootcommand debian/rules $binarytarget fi if [ "$usepause" = "true" ] && \