From 5221e81cc5f195b32758617409cdc39e12277b82 Mon Sep 17 00:00:00 2001 From: joey Date: Sun, 17 Feb 2002 17:52:47 +0000 Subject: r510: * Thanks to Benjamin Drieu , 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 --- Debian/Debhelper/Dh_Lib.pm | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'Debian') 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; -- cgit v1.2.3