admin: distfiles/file-fetcher.pl - allow commas in url - don't die...
sparky
sparky at pld-linux.org
Tue Mar 20 20:08:39 CET 2007
Author: sparky Date: Tue Mar 20 19:08:39 2007 GMT
Module: admin Tag: HEAD
---- Log message:
- allow commas in url
- don't die, add errors to email instead
---- Files affected:
admin/distfiles:
file-fetcher.pl (1.42 -> 1.43)
---- Diffs:
================================================================
Index: admin/distfiles/file-fetcher.pl
diff -u admin/distfiles/file-fetcher.pl:1.42 admin/distfiles/file-fetcher.pl:1.43
--- admin/distfiles/file-fetcher.pl:1.42 Tue Mar 13 18:06:28 2007
+++ admin/distfiles/file-fetcher.pl Tue Mar 20 20:08:34 2007
@@ -60,11 +60,16 @@
$problems .= $_;
next;
}
- /^([a-f0-9]{32})\s+((ftp|http|https|no-url|no-url-copy):\/\/([=\@\?a-z0-9A-Z:\+\~\.\-\/_]|\%[0-9])+)\s*$/
- or die "$file: corrupted";
- push @md5, $1;
- push @url, $2;
- /\/$/ and die "$file: cannot fetch dir";
+ if (/^([a-f0-9]{32})\s+((ftp|http|https|no-url|no-url-copy):\/\/([=\@\?a-z0-9A-Z:\+\~\.,\-\/_]|\%[0-9])+)\s*$/) {
+ if (/\/$/) {
+ $problems .= "$file: cannot fetch dir";
+ } else {
+ push @md5, $1;
+ push @url, $2;
+ }
+ } else {
+ $problems .= "FILE: $file: corrupted";
+ }
}
close(F);
@@ -188,7 +193,10 @@
{
my ($md5, $url) = @_;
- $url =~ m|://([^/]+)| or die "corrupted! (no-url)";
+ unless ($url =~ m#://([^/]+)#) {
+ $problems .= "$url: corrupted! (no-url)";
+ return;
+ }
my $basename = $1;
my $file = "$no_url_dir/$req_login/$basename";
================================================================
---- CVS-web:
http://cvs.pld-linux.org/admin/distfiles/file-fetcher.pl?r1=1.42&r2=1.43&f=u
More information about the pld-cvs-commit
mailing list