Update potfiles script so that it works again without the cvsignore

files.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@11933 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Christian Stimming
2005-11-14 20:36:33 +00:00
parent a166027cb9
commit 036c77f923
3 changed files with 52 additions and 153 deletions

View File

@@ -10,34 +10,41 @@ use strict;
use File::Basename;
my @cvsignores = `find src -name '.cvsignore'`;
my @possible_files = `find src -name '*.c' -o -name '*.glade' -o -name '*.desktop.in' -o -name '*.keys.in' -o -name '*.pl' |sort`;
push @possible_files, qw( lib/libqof/backend/file/qsf-backend.c);
my @possible_files = `find src -name '*.c' -o -name '*.glade' -o -name '*.desktop.in' -o -name '*.keys.in' |sort`;
## For perl files add the following:
# -o -name '*.pl'
chomp(my $cwd = `pwd`);
# Since we don't have any cvsignore files anymore, add patterns here
# that will emulate the old behaviour. Note: These are perl regexp
# patterns, *not* normal shell wildcards!
my @ignorepatterns = ('gw-', 'test', 'experimental');
my %ignores;
foreach my $one_ignore (@cvsignores) {
chomp($one_ignore);
my ($name, $path) = fileparse($one_ignore);
$path =~ s/^\.\///;
open (IG, $one_ignore);
chdir $path;
foreach my $fl (<IG>) {
chomp $fl;
next unless $fl;
my @matches = glob ($fl);
foreach my $match (@matches) {
chomp($match);
next unless $match;
$ignores{$path . $match} = 1;
}
}
close (IG);
chdir $cwd;
}
## Unfortunately this won't work anymore since we don't have .cvsignore
## files anymore.
# my @cvsignores = `find src -name '.cvsignore'`;
# foreach my $one_ignore (@cvsignores) {
# chomp($one_ignore);
# my ($name, $path) = fileparse($one_ignore);
# $path =~ s/^\.\///;
# open (IG, $one_ignore);
# chdir $path;
# foreach my $fl (<IG>) {
# chomp $fl;
# next unless $fl;
# my @matches = glob ($fl);
# foreach my $match (@matches) {
# chomp($match);
# next unless $match;
# $ignores{$path . $match} = 1;
# }
# }
# close (IG);
# chdir $cwd;
# }
print "# List of files which containing translatable strings.\n";
print "# This file was generated by ../make-gnucash-potfiles.in.\n";
@@ -48,10 +55,25 @@ foreach my $file (@possible_files) {
my ($name, $path) = fileparse($file);
$path =~ s/^\.\///;
foreach my $one_ignore (@ignorepatterns) {
chomp($one_ignore);
next unless $one_ignore;
if ($name =~ m/$one_ignore/) {
$ignores{$path . $name} = 1;
#print "not $name\n";
}
if ($path =~ m/$one_ignore/) {
$ignores{$path . $name} = 1;
#print "not $name\n";
}
}
next if $ignores{$path . $name};
print $path . $name . "\n";
}
# These are additionally added in any case
print "lib/libqof/backend/file/qsf-backend.c\n";
print "intl-scm/guile-strings.c\n";
print "doc/tip_of_the_day.list.in"
print "doc/tip_of_the_day.list.in\n"