summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess <joey@gnu.kitenet.net>2010-01-03 14:51:05 -0500
committerJoey Hess <joey@gnu.kitenet.net>2010-01-03 14:51:05 -0500
commit9afe080c5ee27e6e9170d09c9dc5c72cccbdc27e (patch)
tree2ce974864bf0392433df16c5f45f725c3a31afa6
parent854494c6481e69350d2e1ea73b8aa2fdf12c749e (diff)
downloaddebhelper-9afe080c5ee27e6e9170d09c9dc5c72cccbdc27e.tar.gz
makefile: Support the (asking for trouble) case of MAKE being set to something with a space in it. Closes: #563557
-rw-r--r--Debian/Debhelper/Buildsystem/makefile.pm23
-rw-r--r--debian/changelog2
2 files changed, 12 insertions, 13 deletions
diff --git a/Debian/Debhelper/Buildsystem/makefile.pm b/Debian/Debhelper/Buildsystem/makefile.pm
index 47814296..2c14c151 100644
--- a/Debian/Debhelper/Buildsystem/makefile.pm
+++ b/Debian/Debhelper/Buildsystem/makefile.pm
@@ -10,24 +10,21 @@ use strict;
use Debian::Debhelper::Dh_Lib qw(escape_shell clean_jobserver_makeflags);
use base 'Debian::Debhelper::Buildsystem';
-sub get_makecmd_C {
- my $this=shift;
- my $buildpath = $this->get_buildpath();
- if ($buildpath ne '.') {
- return $this->{makecmd} . " -C " . escape_shell($buildpath);
- }
- return $this->{makecmd};
-}
-
sub exists_make_target {
my ($this, $target) = @_;
- my $makecmd=$this->get_makecmd_C();
# 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=`$makecmd -s -n --no-print-directory $target 2>/dev/null | head -n 1`;
- chomp $ret;
- return length($ret);
+ my @opts=("-s", "-n", "--no-print-directory");
+ my $buildpath = $this->get_buildpath();
+ unshift @opts, "-C", $buildpath if $buildpath ne ".";
+ open(SAVEDERR, ">&STDERR");
+ close STDERR;
+ open(MAKE, "-|", $this->{makecmd}, @opts, $target);
+ my $output=<MAKE>;
+ close MAKE;
+ open(STDERR, ">&SAVEDERR");
+ return defined $output && length $output;
}
sub do_make {
diff --git a/debian/changelog b/debian/changelog
index 0f60a0d0..bb8563cc 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,8 @@
debhelper (7.4.12) UNRELEASED; urgency=low
* dh_bugfiles: Doc typo. Closes: #563269
+ * makefile: Support the (asking for trouble) case of MAKE being set to
+ something with a space in it. Closes: #563557
-- Joey Hess <joeyh@debian.org> Fri, 01 Jan 2010 13:00:22 -0500