diff --git a/charting/Months.pm b/charting/Months.pm new file mode 100755 index 00000000..31a11175 --- /dev/null +++ b/charting/Months.pm @@ -0,0 +1,19 @@ +#!/usr/bin/perl -w + +# +# Months.pm +# +use File::stat; + +@months = ( + '2006-12', + '2007-01', '2007-02', '2007-03', '2007-04', '2007-05', '2007-06', + '2007-07', '2007-08', '2007-09', '2007-10', '2007-11', '2007-12', + '2008-01', '2008-02', '2008-03', '2008-04', '2008-05', '2008-06', + '2008-07', '2008-08', '2008-09', '2008-10', '2008-11', '2008-12', + '2009-01', '2009-02', '2009-03', '2009-04', '2009-05', '2009-06', + '2009-07', '2009-08', '2009-09', '2009-10', '2009-11', '2009-12', + '2010-01', +); + +1; diff --git a/charting/fetch.pl b/charting/fetch.pl index 47fbe8b5..2dac9738 100755 --- a/charting/fetch.pl +++ b/charting/fetch.pl @@ -4,25 +4,25 @@ # fetch.pl # use File::stat; +use Months; $fn = '../xml/ukfederation-metadata.xml'; $fn2 = '../xml/ukfederation-stats.html'; -@months = ( - '2006-12', - '2007-01', '2007-02', '2007-03', '2007-04', '2007-05', '2007-06', - '2007-07', '2007-08', '2007-09', '2007-10', '2007-11', '2007-12', - '2008-01', '2008-02', '2008-03', '2008-04', '2008-05', '2008-06', - '2008-07', '2008-08', '2008-09', '2008-10', '2008-11', '2008-12', - '2009-01', '2009-02', '2009-03', '2009-04', '2009-05', '2009-06', - '2009-07', '2009-08', '2009-09', '2009-10', '2009-11', '2009-12', -); - foreach $month (@months) { print "Fetching $month..."; - system("svn update $fn --quiet --revision \\{$month-01T00:00:00Z\\}"); - system("cp $fn cache/$month.xml"); - system("svn update $fn2 --quiet --revision \\{$month-01T00:00:00Z\\}"); - system("cp $fn2 cache/$month.html"); + + my $dest1 = "cache/$month.xml"; + if (!-e $dest1) { + system("svn update $fn --quiet --revision \\{$month-01T00:00:00Z\\}"); + system("cp $fn $dest1"); + } + + my $dest2 = "cache/$month.html"; + if (!-e $dest2) { + system("svn update $fn2 --quiet --revision \\{$month-01T00:00:00Z\\}"); + system("cp $fn2 $dest2"); + } + print "\n"; } diff --git a/charting/saml2.pl b/charting/saml2.pl index 4b590f6a..dbc61908 100755 --- a/charting/saml2.pl +++ b/charting/saml2.pl @@ -7,16 +7,7 @@ # use lib "../build"; use Xalan; - -@months = ( - '2006-12', - '2007-01', '2007-02', '2007-03', '2007-04', '2007-05', '2007-06', - '2007-07', '2007-08', '2007-09', '2007-10', '2007-11', '2007-12', - '2008-01', '2008-02', '2008-03', '2008-04', '2008-05', '2008-06', - '2008-07', '2008-08', '2008-09', '2008-10', '2008-11', '2008-12', - '2009-01', '2009-02', '2009-03', '2009-04', '2009-05', '2009-06', - '2009-07', '2009-08', '2009-09', '2009-10', '2009-11', '2009-12', -); +use Months; # ingest files foreach $month (@months) { diff --git a/charting/sizes.pl b/charting/sizes.pl index 0b9d9be6..fd5ed7ac 100755 --- a/charting/sizes.pl +++ b/charting/sizes.pl @@ -4,16 +4,7 @@ # sizes.pl # use File::stat; - -@months = ( - '2006-12', - '2007-01', '2007-02', '2007-03', '2007-04', '2007-05', '2007-06', - '2007-07', '2007-08', '2007-09', '2007-10', '2007-11', '2007-12', - '2008-01', '2008-02', '2008-03', '2008-04', '2008-05', '2008-06', - '2008-07', '2008-08', '2008-09', '2008-10', '2008-11', '2008-12', - '2009-01', '2009-02', '2009-03', '2009-04', '2009-05', '2009-06', - '2009-07', '2009-08', '2009-09', '2009-10', '2009-11', '2009-12', -); +use Months; # ingest files foreach $month (@months) {