1. Martin Scharrer
  2. ctanupload

Commits

Martin Scharrer  committed f560e3f

Added upload server selection by name.

  • Participants
  • Parent commits 43b0797
  • Branches default

Comments (0)

Files changed (1)

File ctanupload.pl

View file
  • Ignore whitespace
 sub save_data;
 
 my $VERSION = 'v1.0';
-my $CTAN_URL = 'http://dante.ctan.org/upload.html';
+my %CTAN_SERVERURLS = (
+    dante     => 'http://dante.ctan.org/upload.html',
+    de        => 'http://dante.ctan.org/upload.html',
+    uktug     => 'http://www.tex.ac.uk/upload/',
+    'uk-tug'  => 'http://www.tex.ac.uk/upload/',
+    uk        => 'http://www.tex.ac.uk/upload/',
+    cambridge => 'http://www.tex.ac.uk/upload/',
+);
+my $CTAN_URL = $CTAN_SERVERURLS{dante};
 
 my @FIELDS = qw(contribution version name email summary directory DoNotAnnounce announce notes license freeversion file);
 my @REQUIRED = qw(contribution version name email summary license file);
         elsif ($char eq 'u') {
             $CTAN_URL = shift @ARGV;
         }
+        elsif ($char eq 'U') {
+            my $server = lc shift @ARGV;
+            if (not exists $CTAN_SERVERURLS{ $server }) {
+                die "Error: Unknown CTAN server '$server'.\n";
+            }
+            $CTAN_URL = $CTAN_SERVERURLS{ $server };
+        }
         elsif ($char eq 'V') {
             print STDERR "ctanupload script $VERSION.\n";
             exit (0);