Explorar el Código

dpkg-buildpackage: Allow specifying absolute and relative paths on -r

Rregression introduced in 7106a2d148ace7ea1e786e41e11f84081b47fec8.

Closes: #591010
Guillem Jover hace 16 años
padre
commit
c0f7fae149
Se han modificado 2 ficheros con 11 adiciones y 3 borrados
  1. 2 0
      debian/changelog
  2. 9 3
      scripts/Dpkg/Path.pm

+ 2 - 0
debian/changelog

@@ -5,6 +5,8 @@ dpkg (1.15.8.2) UNRELEASED; urgency=low
     because older update-alternatives and dpkg-divert require Dpkg.pm and
     because older update-alternatives and dpkg-divert require Dpkg.pm and
     Dpkg/Gettext.pm which will disappear due to the Replaces. Closes: #590867
     Dpkg/Gettext.pm which will disappear due to the Replaces. Closes: #590867
     Thanks to Sven Joachim <svenjoac@gmx.de> for the analysis.
     Thanks to Sven Joachim <svenjoac@gmx.de> for the analysis.
+  * Allow specifying again absolute and relative paths for dpkg-buildpackage
+    -r option. Closes: #591010
 
 
  -- Guillem Jover <guillem@debian.org>  Fri, 30 Jul 2010 04:35:25 +0200
  -- Guillem Jover <guillem@debian.org>  Fri, 30 Jul 2010 04:35:25 +0200
 
 

+ 9 - 3
scripts/Dpkg/Path.pm

@@ -193,14 +193,20 @@ sub resolve_symlink($) {
 
 
 =item my $cmdpath = find_command($command)
 =item my $cmdpath = find_command($command)
 
 
-Return the path of the command if available on the $PATH, undef otherwise.
+Return the path of the command if available on an absolute or relative
+path or on the $PATH, undef otherwise.
 
 
 =cut
 =cut
 
 
 sub find_command($) {
 sub find_command($) {
     my $cmd = shift;
     my $cmd = shift;
-    foreach my $dir (split(/:/, $ENV{'PATH'})) {
-	return "$dir/$cmd" if -x "$dir/$cmd";
+
+    if ($cmd =~ m{/}) {
+	return "$cmd" if -x "$cmd";
+    } else {
+	foreach my $dir (split(/:/, $ENV{'PATH'})) {
+	    return "$dir/$cmd" if -x "$dir/$cmd";
+	}
     }
     }
     return undef;
     return undef;
 }
 }