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

Modestas Vainius modax at alioth.debian.org
Thu Apr 22 08:01:55 UTC 2010


The following commit has been merged in the master branch:
commit ac077e4f3e664a0ddaf05dd8b786fff196810b66
Author: Modestas Vainius <modestas at vainius.eu>
Date:   Thu Apr 22 10:05:14 2010 +0300

    Add find_exe_in_path() sub to Debian::PkgKde.
---
 perllib/Debian/PkgKde.pm |   19 ++++++++++++++++++-
 1 files changed, 18 insertions(+), 1 deletions(-)

diff --git a/perllib/Debian/PkgKde.pm b/perllib/Debian/PkgKde.pm
index f7de6ee..8ab7795 100644
--- a/perllib/Debian/PkgKde.pm
+++ b/perllib/Debian/PkgKde.pm
@@ -15,10 +15,12 @@
 
 package Debian::PkgKde;
 
+use File::Spec;
+
 use base qw(Exporter);
 our @EXPORT = qw(get_program_name
     printmsg info warning errormsg error syserr usageerr);
-our @EXPORT_OK = qw(find_datalibdir setup_datalibdir DATALIBDIR);
+our @EXPORT_OK = qw(find_datalibdir setup_datalibdir find_exe_in_path DATALIBDIR);
 
 # Determine datalib for current script. It depends on the context the script
 # was executed from.
@@ -65,6 +67,21 @@ sub setup_datalibdir {
     return $dir;
 }
 
+sub find_exe_in_path {
+    my $exe = (@_);
+    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) {
+		return $path;
+	    }
+	}
+    }
+    return undef;
+}
+
 {
     my $progname;
     sub get_program_name {

-- 
Debian Qt/KDE packaging tools



More information about the pkg-kde-commits mailing list