[license-reconcile] 02/05: Fix exclusion of .git, .pc, and now also .svn directories.
gregor herrmann
gregoa at debian.org
Mon Feb 22 23:20:55 UTC 2016
This is an automated email from the git hooks/post-receive script.
gregoa pushed a commit to branch master
in repository license-reconcile.
commit d066e96ea245022cbf2f75e208a1884abe7262bd
Author: gregor herrmann <gregoa at debian.org>
Date: Mon Feb 22 23:34:48 2016 +0100
Fix exclusion of .git, .pc, and now also .svn directories.
Thanks: Michael Prokop for the bug report.
Closes: #703498
---
lib/Debian/LicenseReconcile/Utils.pm | 7 ++++---
t/data/example/.pc/dummy | 0
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/lib/Debian/LicenseReconcile/Utils.pm b/lib/Debian/LicenseReconcile/Utils.pm
index 79831c2..d4235dd 100644
--- a/lib/Debian/LicenseReconcile/Utils.pm
+++ b/lib/Debian/LicenseReconcile/Utils.pm
@@ -12,9 +12,10 @@ sub get_files {
my $directory = shift;
my @files = ();
find(sub {
- return if $File::Find::name =~ m{\A\.git};
- return if $File::Find::name =~ m{\A\.pc};
- push @files, substr($File::Find::name,length($directory)+1) if ! -d $_;
+ return if -d $_; # avoids warnings with substr() for $_ eq $directory
+ my $shortenedname = substr($File::Find::name,length($directory)+1);
+ return if $shortenedname =~ m{\A(?:\.git|\.svn|\.pc)};
+ push @files, $shortenedname;
}, $directory);
return sort @files;
}
diff --git a/t/data/example/.pc/dummy b/t/data/example/.pc/dummy
new file mode 100644
index 0000000..e69de29
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/license-reconcile.git
More information about the Pkg-perl-cvs-commits
mailing list