From 09b3b4b2cc75ac96af62e9865c7d4bccc6f767b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Pr=C3=A9vot?= Date: Tue, 3 May 2011 20:01:01 +0000 Subject: Push exceptions where they belong (and thus stop removing every Spanish l10n files each time they are built), and activate the cleanup for every languages CVS version numbers remove_stale.pl: 1.21 -> 1.22 --- remove_stale.pl | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'remove_stale.pl') diff --git a/remove_stale.pl b/remove_stale.pl index 970480f7a64..7d9a0bd6070 100755 --- a/remove_stale.pl +++ b/remove_stale.pl @@ -45,8 +45,6 @@ use constant INSTALLDIR => '../www'; # Read the list of languages my @languages = sort Webwml::Langs->new()->names(); - #@languages = ('spanish'); - @languages = ('dutch','spanish'); # check all subdirs to find stale html files my @files; @@ -121,12 +119,6 @@ sub find_stale_files # started translations return 0 unless -d $dir; - # Don't try to do anything in subdirectories of l10n. - return 0 if $dir =~ m'l10n/[^/]+$'; - - # Don't try to do anything in stats either. - return 0 if $dir =~ m'stats$'; - # create a list of *.html files and a hash of *.wml files in this translation #my (%wmlfiles,@htmlfiles); #find( sub { $wmlfiles{$File::Find::name}++ if -f and /\.wml$/ }, $dir ); @@ -146,6 +138,15 @@ sub find_stale_files $source =~ s/(?:\.[-\w]+)?\.html$/.wml/ or die("Can't determine WML source file for `$htmlfile'"); + # Don't try to do anything in subdirectories of l10n. + next if $htmlfile =~ m{/international/l10n/po[-\w]*/[\w_\@]+\.[-\w]+\.html$}; + + # Don't try to do anything in stats either. + next if $htmlfile =~ m{/devel/website/stats/[-\w]+\.[-\w]+\.html$}; + + # Don't try to remove yaboot-howto. + next if $htmlfile =~ m{/ports/powerpc/inst/yaboot-howto.html}; + # does the wml source file exist? my $haswml = exists( $wmlfiles{$source} ) || -f $source || 0; -- cgit v1.2.3