/[qa]/trunk/data/watch/update-sf-list
ViewVC logotype

Diff of /trunk/data/watch/update-sf-list

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2727 by geissert, Wed Mar 14 03:03:34 2012 UTC revision 2741 by geissert, Tue Apr 17 01:14:06 2012 UTC
# Line 17  Line 17 
17  #    along with this file.  If not, see <http://www.gnu.org/licenses/>.  #    along with this file.  If not, see <http://www.gnu.org/licenses/>.
18  ####################  ####################
19    
20  set -e  set -eu
21    
22    scratch=/srv/scratch/qa.debian.org/sf-list
23    export scratch
24    
25    mkdir -p "$scratch"
26    
27  ret=0  ret=0
28  rsync -Pvan --log-file=/dev/null --list-only ftp.heanet.ie::sourceforge > rsync-stdout.txt || ret=$?  rsync -Pvan --log-file=/dev/null --list-only ftp.heanet.ie::sourceforge > "$scratch/rsync-stdout.txt" || ret=$?
29  if [ $ret -ne 0 -a $ret -ne 23 -a $ret -ne 24 ] ; then  if [ $ret -ne 0 -a $ret -ne 23 -a $ret -ne 24 ] ; then
30          exit $ret          exit $ret
31  fi  fi
32    
33  sed -rn 's/^-.+[0-9]{4}\/[0-9]{2}\/[0-9]{2}[[:space:]]+[0-9]{2}:[0-9]{2}:[0-9]{2}[[:space:]]+(.+)$/\1/;T;p' < rsync-stdout.txt > sf-list.new  sed -rn 's/^-.+[0-9]{4}\/[0-9]{2}\/[0-9]{2}[[:space:]]+[0-9]{2}:[0-9]{2}:[0-9]{2}[[:space:]]+(.+)$/\1/;T;p' < "$scratch/rsync-stdout.txt" > "$scratch/sf-list.new"
34    
35    unlink "$scratch/rsync-stdout.txt"
36    
37  perl -w <<'PCODE'  perl -w <<'PCODE'
38    
# Line 42  tie %db, 'BerkeleyDB::Btree', Line 49  tie %db, 'BerkeleyDB::Btree',
49    
50  sub gen_html;  sub gen_html;
51    
52  open(LIST, '< sf-list.new')  open(LIST, '<', "$ENV{scratch}/sf-list.new")
53          or die("Failed to open sf-list.new: $!\n");          or die("Failed to open sf-list.new: $!\n");
54    
55  my $cur_project = undef;  my $cur_project = undef;
56  my @files;  my @files;
57    
58  while(<LIST>) {  while(<LIST>) {
59      next unless(m,^\w/project/.{2}/([^/]+)/(?:([^/]+)|([^/]+)/(?:[^/]+/)*(.+))?$,);      next unless(m,^\w/.{2}/([^/]+)/(?:([^/]+)|([^/]+)/(?:[^/]+/)*(.+))?$,);
60      my ($project, $file1, $mdir, $file2) = ($1, $2, $3, $4);      my ($project, $file1, $mdir, $file2) = ($1, $2, $3, $4);
61      my $file = $file1 || $file2;      my $file = $file1 || $file2;
62    
# Line 87  sub gen_html { Line 94  sub gen_html {
94    
95  PCODE  PCODE
96    
97  gzip -n sf-list.new  gzip -n "$scratch/sf-list.new"
98  mv sf-list.db-new sf-list.db  mv sf-list.db-new sf-list.db
99  mv sf-list.new.gz sf-list.gz  mv "$scratch/sf-list.new.gz" "$scratch/sf-list.gz"

Legend:
Removed from v.2727  
changed lines
  Added in v.2741

  ViewVC Help
Powered by ViewVC 1.1.5