| 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 |
|
|
| 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 |
|
|
| 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" |