]> err.no Git - dpkg/commitdiff
dpkg-buildpackage: Make the testcommand more sensible
authorFrank Lichtenheld <djpig@debian.org>
Sat, 29 Sep 2007 14:36:18 +0000 (16:36 +0200)
committerFrank Lichtenheld <djpig@debian.org>
Sat, 29 Sep 2007 14:36:18 +0000 (16:36 +0200)
Instead of testing /usr/bin/$cmd, test `which $cmd`.

ChangeLog
scripts/dpkg-buildpackage.pl

index 1eef0d535ff64ebe6946174d8db5d696c0566419..6fa71cc0208333afe8b4b2c89cfe2c35cc2487ae 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2007-09-29  Frank Lichtenheld  <djpig@debian.org>
 
+       * scripts/dpkg-buildpackage.pl (testcommand):
+       Make the check more sensible. Instead of testing
+       /usr/bin/$cmd, test `which $cmd`.
+
        * scripts/dpkg-buildpackage.pl (signfile): Call
        gpg with --utf8-strings since otherwise the key
        lookup fails with non-ASCII UTF8-encoded names.
index 88b3d12324dba8cbece18694ea049fd07a06db72..1387cab8ee6c653f0b9a64bb7a077638817a94fb 100644 (file)
@@ -79,7 +79,9 @@ Options:
 sub testcommand {
     my ($cmd) = @_;
 
-    return -x "/usr/bin/$cmd";
+    my $fullcmd = `which $cmd`;
+    chomp $fullcmd;
+    return $fullcmd && -x $fullcmd;
 }
 
 my $rootcommand = '';