summaryrefslogtreecommitdiff
path: root/Debian
diff options
context:
space:
mode:
authorjoey <joey>2002-02-17 17:52:47 +0000
committerjoey <joey>2002-02-17 17:52:47 +0000
commit5221e81cc5f195b32758617409cdc39e12277b82 (patch)
tree16cca2fc42f87c00168665693b0626e5d09f72d0 /Debian
parent8e0691a21799ddf303419876e0681df88cfcf56e (diff)
downloaddebhelper-5221e81cc5f195b32758617409cdc39e12277b82.tar.gz
r510: * Thanks to Benjamin Drieu <benj@debian.org>, dh_installdocs -X now works.
I had to modify his patch to use cp --parents, since -P spews warnings now. Also, I made it continue to use cp -a if nothing is excluded, which is both faster, and means this patch is less likely to break anything if it turns out to be buggy. Also, stylistic changes. Closes: #40649 * Implemented -X for dh_installexamples as well. * dh_clean -X substvars will also work now. Closes: #66890
Diffstat (limited to 'Debian')
-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;