[SCM] Debian Qt/KDE packaging tools branch, master, updated. debian/0.7.2

Modestas Vainius modax at alioth.debian.org
Thu Apr 22 21:18:18 UTC 2010


The following commit has been merged in the master branch:
commit ce81e0b208dd656bb3485c1a2efcbd3ec40f6ca8
Author: Modestas Vainius <modestas at vainius.eu>
Date:   Fri Apr 23 00:06:09 2010 +0300

    Make it possible to exclude a program from path in find_exe_in_path().
---
 perllib/Debian/PkgKde.pm |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/perllib/Debian/PkgKde.pm b/perllib/Debian/PkgKde.pm
index 2f8b974..41f31ff 100644
--- a/perllib/Debian/PkgKde.pm
+++ b/perllib/Debian/PkgKde.pm
@@ -16,6 +16,7 @@
 package Debian::PkgKde;
 
 use File::Spec;
+use Cwd qw(realpath);
 
 use base qw(Exporter);
 our @EXPORT = qw(get_program_name
@@ -68,13 +69,21 @@ sub setup_datalibdir {
 }
 
 sub find_exe_in_path {
-    my ($exe) = @_;
+    my ($exe, @exclude) = @_;
+    my @realexclude;
+
+    # Canonicalize files to exclude
+    foreach my $exc (@exclude) {
+	if (my $realexc = realpath($exc)) {
+	    push @realexclude, $realexc;
+	}
+    }
     if (File::Spec->file_name_is_absolute($exe)) {
 	return $exe;
     } elsif ($ENV{PATH}) {
 	foreach my $dir (split /:/, $ENV{PATH}) {
-	    my $path = File::Spec->catfile($dir, $exe);
-	    if (-x $path) {
+	    my $path = realpath(File::Spec->catfile($dir, $exe));
+	    if (-x $path && ! grep({ $path eq $_ } @realexclude)) {
 		return $path;
 	    }
 	}

-- 
Debian Qt/KDE packaging tools



More information about the pkg-kde-commits mailing list