diff options
author | Laura Arjona Reina <larjona@debian.org> | 2019-10-15 17:02:49 +0200 |
---|---|---|
committer | Laura Arjona Reina <larjona@debian.org> | 2019-10-15 17:02:49 +0200 |
commit | b2467c3afdc5885859ef66e84f8b6607ea9d8274 (patch) | |
tree | 8fa8a4b000b222fccbb5c78560711650fb38094e /english/mirror | |
parent | 4b70ec5b01d527ace2a3a31759b5cb2e197e2ad5 (diff) |
If we have no sponsor URL, produce a warning but continue building the file, showing at least the name of the sponsor
Diffstat (limited to 'english/mirror')
-rwxr-xr-x | english/mirror/mirror_list.pl | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/english/mirror/mirror_list.pl b/english/mirror/mirror_list.pl index f19e23b024e..91597cf9de8 100755 --- a/english/mirror/mirror_list.pl +++ b/english/mirror/mirror_list.pl @@ -600,10 +600,15 @@ END $sponsorname = $1; $sponsorurl = $2; } else { - die "can't find sponsor URL for sponsor $sponsor of $subsite"; + warn "can't find sponsor URL for sponsor $sponsor of $subsite"; + $sponsorname = $sponsor; } encode_entities($sponsorname, $encode); - print "<a href=\"$sponsorurl\">$sponsorname</a>"; + if ($sponsorurl) { + print "<a href=\"$sponsorurl\">$sponsorname</a>"; + } else { + print "$sponsorname"; + } $num++; print ", " unless ($num >= $numsponsors); } @@ -619,11 +624,16 @@ END if ($sponsor =~ /^(.+) (http:.*)$/) { $sponsorname = $1; $sponsorurl = $2; - } else { - die "can't find sponsor URL for sponsor $sponsor of $mirror[$id]{site}"; + } else { + warn "can't find sponsor URL for sponsor $sponsor of $mirror[$id]{site}"; + $sponsorname = $sponsor; } encode_entities($sponsorname, $encode); - print "<a href=\"$sponsorurl\">$sponsorname</a>"; + if ($sponsorurl) { + print "<a href=\"$sponsorurl\">$sponsorname</a>"; + } else { + print "$sponsorname"; + } $num++; print ", " unless ($num >= $numsponsors); } @@ -674,10 +684,15 @@ END $sponsorname = $1; $sponsorurl = $2; } else { - die "can't find sponsor URL for sponsor $sponsor of $mirror[$id]{site}"; + warn "can't find sponsor URL for sponsor $sponsor of $mirror[$id]{site}"; + $sponsorname = $sponsor; } encode_entities($sponsorname, $encode); - print "<a href=\"$sponsorurl\">$sponsorname</a>"; + if ($sponsorurl) { + print "<a href=\"$sponsorurl\">$sponsorname</a>"; + } else { + print "$sponsorname"; + } $num++; print ",\n" unless ($num >= $numsponsors); } |