texlive[43940] Master: try to support https, too

commits+preining at tug.org commits+preining at tug.org
Thu Apr 20 16:47:49 CEST 2017


Revision: 43940
          http://tug.org/svn/texlive?view=revision&revision=43940
Author:   preining
Date:     2017-04-20 16:47:49 +0200 (Thu, 20 Apr 2017)
Log Message:
-----------
try to support https, too

Modified Paths:
--------------
    trunk/Master/install-tl
    trunk/Master/texmf-dist/scripts/texlive/tlmgr.pl
    trunk/Master/tlpkg/TeXLive/TLPDB.pm
    trunk/Master/tlpkg/TeXLive/TLUtils.pm

Modified: trunk/Master/install-tl
===================================================================
--- trunk/Master/install-tl	2017-04-20 14:47:40 UTC (rev 43939)
+++ trunk/Master/install-tl	2017-04-20 14:47:49 UTC (rev 43940)
@@ -461,7 +461,7 @@
 # check command line arguments if given
 if ($opt_location) {
   my $tmp = $opt_location;
-  if ($tmp =~ m!^(http|ftp)://!i) {
+  if ($tmp =~ m!^(https?|ftp)://!i) {
     push @media_available, "NET#$tmp";
 
   } elsif ($tmp =~ m!^(rsync|)://!i) {
@@ -636,7 +636,7 @@
   $location = $opt_location;
   $location = $selected_location if defined($selected_location);
   $location || ($location = "$::installerdir");
-  if ($location =~ m!^(ctan$|(http|ftp)://)!i) {
+  if ($location =~ m!^(ctan$|(https?|ftp)://)!i) {
     $location =~ s,/(tlpkg|archive)?/*$,,;  # remove any trailing tlpkg or /
     if ($location =~ m/^ctan$/i) {
       $location = TeXLive::TLUtils::give_ctan_mirror();

Modified: trunk/Master/texmf-dist/scripts/texlive/tlmgr.pl
===================================================================
--- trunk/Master/texmf-dist/scripts/texlive/tlmgr.pl	2017-04-20 14:47:40 UTC (rev 43939)
+++ trunk/Master/texmf-dist/scripts/texlive/tlmgr.pl	2017-04-20 14:47:49 UTC (rev 43940)
@@ -4037,9 +4037,9 @@
       return ($F_ERROR);
     }
     # check if it is either url or absolute path
-    if (($p !~ m!^(http|ftp)://!i) && 
+    if (($p !~ m!^(https?|ftp)://!i) && 
         !File::Spec->file_name_is_absolute($p)) {
-      tlwarn("$prg: neither http/ftp URL nor absolute path, no action: $p\n");
+      tlwarn("$prg: neither https?/ftp URL nor absolute path, no action: $p\n");
       return ($F_ERROR);
     }
     my $t = shift @ARGV;
@@ -5784,7 +5784,7 @@
   # we normalize the path only if it is
   # - a url starting with neither http or ftp
   # - if we are on Windows, it does not start with Drive:[\/]
-  if (! ( $location =~ m!^(http|ftp)://!i  ||
+  if (! ( $location =~ m!^(https?|ftp)://!i  ||
           (win32() && (!(-e $location) || ($location =~ m!^.:[\\/]!) ) ) ) ) {
     # seems to be a local path, try to normalize it
     my $testloc = abs_path($location);
@@ -6026,7 +6026,7 @@
   #   not work
 
   my $local_copy_tlpdb_used = 0;
-  if ($location =~ m;^(http|ftp)://;) {
+  if ($location =~ m;^(https?|ftp)://;) {
     # first check that the saved tlpdb is present at all
     my $loc_digest = TeXLive::TLCrypto::tl_short_digest($location);
     my $loc_copy_of_remote_tlpdb =
@@ -6167,7 +6167,7 @@
   # save remote database if it is a net location
   # make sure that the writeout of the tlpdb is done in UNIX mode
   # since otherwise the checksum will change.
-  if (!$local_copy_tlpdb_used && $location =~ m;^(http|ftp)://;) {
+  if (!$local_copy_tlpdb_used && $location =~ m;^(https?|ftp)://;) {
     my $loc_digest = TeXLive::TLCrypto::tl_short_digest($location);
     my $loc_copy_of_remote_tlpdb =
       "$Master/$InfraLocation/texlive.tlpdb.$loc_digest";

Modified: trunk/Master/tlpkg/TeXLive/TLPDB.pm
===================================================================
--- trunk/Master/tlpkg/TeXLive/TLPDB.pm	2017-04-20 14:47:40 UTC (rev 43939)
+++ trunk/Master/tlpkg/TeXLive/TLPDB.pm	2017-04-20 14:47:49 UTC (rev 43940)
@@ -276,7 +276,7 @@
   my $is_verified = 0;
   # do media detection
   my $rootpath = $self->root;
-  if ($rootpath =~ m,http://|ftp://,) {
+  if ($rootpath =~ m,https?://|ftp://,) {
     $media = 'NET';
   } else {
     if ($rootpath =~ m,file://*(.*)$,) {
@@ -299,7 +299,7 @@
   $self->{'media'} = $media;
   #
   # actually load the TLPDB
-  if ($path =~ m;^((http|ftp)://|file:\/\/*);) {
+  if ($path =~ m;^((https?|ftp)://|file:\/\/*);) {
     debug("TLPDB.pm: trying to initialize from $path\n");
     # now $xzfh filehandle is open, the file created
     # TLUtils::download_file will just overwrite what is there

Modified: trunk/Master/tlpkg/TeXLive/TLUtils.pm
===================================================================
--- trunk/Master/tlpkg/TeXLive/TLUtils.pm	2017-04-20 14:47:40 UTC (rev 43939)
+++ trunk/Master/tlpkg/TeXLive/TLUtils.pm	2017-04-20 14:47:49 UTC (rev 43940)
@@ -1665,7 +1665,7 @@
     $cmd =~ s!^TEXDIR/!$texdir/!;
     # $cmd can be an URL, in which case we do NOT want to convert it to
     # w32 paths!
-    if ($cmd !~ m!^\s*(http://|ftp://)!) {
+    if ($cmd !~ m!^\s*(https?://|ftp://)!) {
       if (!(-e $cmd) or !(-r $cmd)) {
         tlwarn("Target of shortcut action does not exist: $cmd\n")
             if $cmd =~ /\.(exe|bat|cmd)$/i;
@@ -2084,7 +2084,7 @@
   $xzfile_quote = "\"$xzfile\"";
   $tarfile_quote = "\"$tarfile\"";
   $target_quote = "\"$target\"";
-  if ($what =~ m,^(http|ftp)://,) {
+  if ($what =~ m,^(https?|ftp)://,) {
     # we are installing from the NET
     # check for the presence of $what in $tempdir
     if (-r $xzfile) {
@@ -2442,7 +2442,7 @@
       return 0;
     }
   }
-  if ($relpath =~ /^(http|ftp):\/\//) {
+  if ($relpath =~ /^(https?|ftp):\/\//) {
     $url = $relpath;
   } else {
     $url = "$TeXLiveURL/$relpath";
@@ -3552,7 +3552,7 @@
     return $backbone[int(rand($#backbone + 1))];
   }
 
-  if ($mirror =~ m!^http://!) {  # if http mirror, assume good and return.
+  if ($mirror =~ m!^https?://!) {  # if http mirror, assume good and return.
     return $mirror;
   }
 
@@ -3567,7 +3567,7 @@
   for (my $try = 1; $try <= $max_mirror_trial; $try++) {
     my $m = query_ctan_mirror();
     debug("querying mirror, got " . (defined($m) ? $m : "(nothing)") . "\n");
-    if (defined($m) && $m =~ m!^http://!) {
+    if (defined($m) && $m =~ m!^https?://!) {
       return $m;  # got http this time, assume ok.
     }
     # sleep to make mirror happy, but only if we are not ready to return
@@ -3670,7 +3670,7 @@
 sub download_to_temp_or_file {
   my $url = shift;
   my ($url_fh, $url_file);
-  if ($url =~ m,^(http|ftp|file)://,) {
+  if ($url =~ m,^(https?|ftp|file)://,) {
     ($url_fh, $url_file) = tl_tmpfile();
     # now $url_fh filehandle is open, the file created
     # TLUtils::download_file will just overwrite what is there



More information about the tex-live-commits mailing list