@@ -, +, @@ - check provenance of strings - only files with normarc in their names must be present - repeat check - check name of created files - check provenance - there must be no results - check provenance - check files - there must be no results --- misc/translator/tmpl_process3.pl | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) --- a/misc/translator/tmpl_process3.pl +++ a/misc/translator/tmpl_process3.pl @@ -24,6 +24,7 @@ use VerboseWarnings qw( :warn :die ); use vars qw( @in_dirs @filenames $str_file $out_dir $quiet ); use vars qw( @excludes $exclude_regex ); +use vars qw( $match $nomatch ); use vars qw( $recursive_p ); use vars qw( $pedantic_p ); use vars qw( $href ); @@ -144,9 +145,11 @@ sub listfiles { || (defined $exclude_regex && $dirent =~ /^(?:$exclude_regex)$/)) { ; } elsif (-f $path) { - my $basename = basename $path; + my $basename = fileparse( $path ); push @it, $path if ( not @$filenames or ( grep { $path =~ /$_/ } @$filenames ) ) + and ( not defined $match or $basename =~ /($match)/i ) # files to include + and ( not defined $nomatch or $basename !~ /($nomatch)/i ) # files not to include and (!defined $type || $dirent =~ /\.(?:$type)$/) || $action eq 'install'; } elsif (-d $path && $recursive_p) { push @it, listfiles($path, $type, $action, $filenames); @@ -167,7 +170,7 @@ sub mkdir_recursive ($) { my ($prefix, $basename) = ($dir =~ /\/([^\/]+)$/s)? ($`, $1): ('.', $dir); mkdir_recursive($prefix) if $prefix ne '.' && !-d $prefix; if (!-d $dir) { - print STDERR "Making directory $dir..." unless $quiet; + print STDERR "Making directory $dir...\n" unless $quiet; # creates with rwxrwxr-x permissions mkdir($dir, 0775) || warn_normal "$dir: $!", undef; } @@ -196,7 +199,11 @@ Create or update PO files from templates, or install translated templates. If given, only these files will be processed. -s, --str-file=FILE Specify FILE as the translation (po) file for input (install) or output (create, update) - -x, --exclude=REGEXP Exclude files matching the given REGEXP + -x, --exclude=REGEXP Exclude dirs matching the given REGEXP + -m, --match=STRING Pipe (|) separated list. Include only files + with names matching the given REGEXP + -n, --nomatch=STRING Pipe (|) separated list. Exclude all files + with names matching the given STRING --help Display this help and exit -q, --quiet no output to screen (except for errors) @@ -225,6 +232,8 @@ GetOptions( 'recursive|r' => \$recursive_p, 'str-file|s=s' => \$str_file, 'exclude|x=s' => \@excludes, + 'match|m=s' => \$match, + 'nomatch|n=s' => \$nomatch, 'quiet|q' => \$quiet, 'pedantic-warnings|pedantic' => sub { $pedantic_p = 1 }, 'help' => \&usage, --