changes to the script producing the mirror sponsors list - Sponsor URL not "mandatory" anymore

Laura Arjona Reina <[email protected]> Tue, 15 Oct 2019 17:25:19 +0200
Newsgroups gmane.linux.debian.devel.www,gmane.linux.debian.user.mirrors
Message-ID <[email protected]>
Dear all
Since one day or so the Debian website was failing to build
www.debian.org/mirror/sponsors because one of the entries in the list of
sponsor was not including an URL together with the name of the sponsor,
and we also couldn't find a good one by ourselves.

I have committed a change to the Perl script to workaround this making
it produce a message but continue the build ("warn" function instead of
"die"). See the mail message below for the commit and the diff.

The output of those warnings, for now, will be recorded and can be seen at
https://www-master.debian.org/build-logs/webwml/wml_run.log
searching for "english/mirror/sponsors.list"

CC'ing the mirror team for their information.
If anybody has better idea about how to handle this, I'm open to
suggestions :-)

Thanks

Laura Arjona Reina
https://wiki.debian.org/LauraArjona



-------- Mensaje reenviado --------
Asunto: [Git][webmaster-team/webwml][master] If we have no sponsor URL,
produce a warning but continue building the file,...
Fecha: Tue, 15 Oct 2019 15:03:36 +0000
De: Laura Arjona Reina <[email protected]>
Responder a: [email protected]
Para: [email protected]



Laura Arjona Reina pushed to branch master at Debian Webmaster Team / webwml


Commits:
b2467c3a by Laura Arjona Reina at 2019-10-15T15:02:49Z
If we have no sponsor URL, produce a warning but continue building the
file, showing at least the name of the sponsor

- - - - -


1 changed file:

- english/mirror/mirror_list.pl


Changes:

=====================================
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);
       }



View it on GitLab:
https://salsa.debian.org/webmaster-team/webwml/commit/b2467c3afdc5885859ef66e84f8b6607ea9d8274