Package: debhelper
Version: 7.0.15
Severity: normal
Tags: patch, lenny
lenny's debhelper looks for output from '$ENV{MAKE} -s -n $target' to
see if a given make target exists before calling it. However, if the
build itself was initiated via make, this test will get false
positives due to the the "Entering <directory>" and "Leaving
<directory>" messages.
The make argument '--no-print-directory' is an easy fix for this, see
attached.
This can be demonstrated on a lenny system by building the debhelper
source with the following makefile.
da...@lart:/tmp/dannf$ cat Makefile
all:
cd debhelper-7.0.15 && dpkg-buildpackage -rfakeroot -uc -us
da...@lart:/tmp/dannf$ make
cd debhelper-7.0.15 && dpkg-buildpackage -rfakeroot -uc -us
dpkg-buildpackage: set CFLAGS to default value: -g -O2
dpkg-buildpackage: set CPPFLAGS to default value:
dpkg-buildpackage: set LDFLAGS to default value:
dpkg-buildpackage: set FFLAGS to default value: -g -O2
dpkg-buildpackage: set CXXFLAGS to default value: -g -O2
dpkg-buildpackage: source package debhelper
dpkg-buildpackage: source version 7.0.15
dpkg-buildpackage: source changed by Joey Hess <[email protected]>
dpkg-buildpackage: host architecture i386
fakeroot debian/rules clean
make[1]: Entering directory `/tmp/dannf/debhelper-7.0.15'
./run dh clean
dh_testdir
dh_auto_clean
make[2]: Entering directory `/tmp/dannf/debhelper-7.0.15'
make[2]: *** No rule to make target `distclean'. Stop.
make[2]: Leaving directory `/tmp/dannf/debhelper-7.0.15'
dh_auto_clean: command returned error code 512
make[1]: *** [clean] Error 1
make[1]: Leaving directory `/tmp/dannf/debhelper-7.0.15'
dpkg-buildpackage: failure: fakeroot debian/rules clean gave error
exit status 2
make: *** [all] Error 2
I personally don't think this issue is severe enough to warrant a
stable update, but I wouldn't be sad if a fix slipped in should a
stable update occur for other reasons :)
diff -urpN debhelper-7.0.15.orig/dh_auto_clean debhelper-7.0.15/dh_auto_clean
--- debhelper-7.0.15.orig/dh_auto_clean 2008-06-04 12:38:54.000000000 -0600
+++ debhelper-7.0.15/dh_auto_clean 2010-06-03 11:25:33.000000000 -0600
@@ -45,7 +45,7 @@ if (-e "Makefile" || -e "makefile" || -e
foreach my $target (qw{distclean realclean clean}) {
# Use make -n to check to see if the target would do
# anything. There's no good way to test if a target exists.
- my $ret=`$ENV{MAKE} -s -n $target 2>/dev/null`;
+ my $ret=`$ENV{MAKE} -s -n --no-print-directory $target 2>/dev/null`;
chomp $ret;
if (length $ret) {
doit($ENV{MAKE}, $target, @{$dh{U_PARAMS}});
diff -urpN debhelper-7.0.15.orig/dh_auto_install debhelper-7.0.15/dh_auto_install
--- debhelper-7.0.15.orig/dh_auto_install 2008-06-25 10:24:21.000000000 -0600
+++ debhelper-7.0.15/dh_auto_install 2010-06-03 11:25:55.000000000 -0600
@@ -70,7 +70,7 @@ if (-e "Makefile" || -e "makefile" || -e
foreach my $target (qw{install}) {
# Use make -n to check to see if the target would do
# anything. There's no good way to test if a target exists.
- my $ret=`$ENV{MAKE} -s -n $target 2>/dev/null`;
+ my $ret=`$ENV{MAKE} -s -n --no-print-directory $target 2>/dev/null`;
chomp $ret;
if (length $ret) {
doit($ENV{MAKE}, $target,
diff -urpN debhelper-7.0.15.orig/dh_auto_test debhelper-7.0.15/dh_auto_test
--- debhelper-7.0.15.orig/dh_auto_test 2008-05-19 10:40:23.000000000 -0600
+++ debhelper-7.0.15/dh_auto_test 2010-06-03 11:25:44.000000000 -0600
@@ -46,7 +46,7 @@ if (-e "Makefile" || -e "makefile" || -e
foreach my $target (qw{test check}) {
# Use make -n to check to see if the target would do
# anything. There's no good way to test if a target exists.
- my $ret=`$ENV{MAKE} -s -n $target 2>/dev/null`;
+ my $ret=`$ENV{MAKE} -s -n --no-print-directory $target 2>/dev/null`;
chomp $ret;
if (length $ret) {
doit($ENV{MAKE}, $target, @{$dh{U_PARAMS}});