Use perl instead of grep to scan POTFILES.ignore and POTFILES.skip

No point in shelling out of perl to do what perl does best; besides, grep
has environment settings that can break our parsing of the result.
This commit is contained in:
John Ralls 2014-08-08 13:31:29 -07:00
parent 367b608fad
commit 0ddd9db0a2

View File

@ -14,9 +14,18 @@ use File::Basename;
# Note: These are perl regexp patterns, *not* normal shell wildcards! # Note: These are perl regexp patterns, *not* normal shell wildcards!
my @ignorepatterns = ('gw-', 'test', 'experimental', 'python-bindings', 'swig-.*\.c'); my @ignorepatterns = ('gw-', 'test', 'experimental', 'python-bindings', 'swig-.*\.c');
my (@skipped_files, @ignored_files);
open(IN, "< @-SRCDIR-@/po/POTFILES.skip");
while (<IN>) {
push @skipped_files, $_ unless $_ =~ /^\#/;
}
close IN;
open(IN, "< @-SRCDIR-@/po/POTFILES.ignore");
while (<IN>) {
push @ignored_files, $_ unless $_ =~ /^\#/;
}
close IN;
my @skipped_files = `grep -v \# @-SRCDIR-@/po/POTFILES.skip`;
my @ignored_files = `grep -v \# @-SRCDIR-@/po/POTFILES.ignore`;
my @possible_files = `cd @-SRCDIR-@ && find src -name '*.c' -o -name '*.glade' \\ my @possible_files = `cd @-SRCDIR-@ && find src -name '*.c' -o -name '*.glade' \\
-o -name '*.desktop.in' -o -name '*.keys.in' \\ -o -name '*.desktop.in' -o -name '*.keys.in' \\