summaryrefslogtreecommitdiff
path: root/Debian/Debhelper/Dh_Lib.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Debian/Debhelper/Dh_Lib.pm')
-rw-r--r--Debian/Debhelper/Dh_Lib.pm16
1 files changed, 14 insertions, 2 deletions
diff --git a/Debian/Debhelper/Dh_Lib.pm b/Debian/Debhelper/Dh_Lib.pm
index a909335b..53e86eb9 100644
--- a/Debian/Debhelper/Dh_Lib.pm
+++ b/Debian/Debhelper/Dh_Lib.pm
@@ -12,7 +12,8 @@ use vars qw(@ISA @EXPORT %dh);
@ISA=qw(Exporter);
@EXPORT=qw(&init &doit &complex_doit &verbose_print &error &warning &tmpdir
&pkgfile &pkgext &isnative &autoscript &filearray &GetPackages
- &basename &dirname &xargs %dh &compat &addsubstvar &delsubstvar);
+ &basename &dirname &xargs %dh &compat &addsubstvar &delsubstvar
+ &excludefile);
my $max_compat=4;
@@ -199,7 +200,8 @@ sub warning {
# Returns the basename of the argument passed to it.
sub basename {
my $fn=shift;
-
+
+ $fn=~s/\/$//g; # ignore trailing slashes
$fn=~s:^.*/(.*?)$:$1:;
return $fn;
}
@@ -208,6 +210,7 @@ sub basename {
sub dirname {
my $fn=shift;
+ $fn=~s/\/$//g; # ignore trailing slashes
$fn=~s:^(.*)/.*?$:$1:;
return $fn;
}
@@ -450,6 +453,15 @@ sub filearray {
return @ret;
}
+# Passed a filename, returns true if -X says that file should be excluded.
+sub excludefile {
+ my $filename = shift;
+ foreach my $f (@{$dh{EXCLUDE}}) {
+ return 1 if $filename =~ /\Q$f\E/;
+ }
+ return 0;
+}
+
# Returns the build architecture. (Memoized)
{
my $arch;