From e016ffde13260cb8ac2b75bca1f3d3bb7e2250f9 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Thu, 20 Apr 2017 14:47:49 +0000 Subject: try to support https, too git-svn-id: svn://tug.org/texlive/trunk@43940 c570f23f-e606-0410-a88d-b1316a301751 --- Master/install-tl | 4 ++-- Master/texmf-dist/scripts/texlive/tlmgr.pl | 10 +++++----- Master/tlpkg/TeXLive/TLPDB.pm | 4 ++-- Master/tlpkg/TeXLive/TLUtils.pm | 12 ++++++------ 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Master/install-tl b/Master/install-tl index 575bb5b1cab..63159c30fa5 100755 --- a/Master/install-tl +++ b/Master/install-tl @@ -461,7 +461,7 @@ if (!$opt_custom_bin && (platform() eq "i386-cygwin")) { # 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 @@ sub only_load_remote { $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(); diff --git a/Master/texmf-dist/scripts/texlive/tlmgr.pl b/Master/texmf-dist/scripts/texlive/tlmgr.pl index 6fda5f917ab..9d3a10fab0f 100755 --- a/Master/texmf-dist/scripts/texlive/tlmgr.pl +++ b/Master/texmf-dist/scripts/texlive/tlmgr.pl @@ -4037,9 +4037,9 @@ sub action_repository { 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 @@ sub init_local_db { # 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 @@ sub setup_one_remotetlpdb { # 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 @@ FROZEN # 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"; diff --git a/Master/tlpkg/TeXLive/TLPDB.pm b/Master/tlpkg/TeXLive/TLPDB.pm index bc1adef0249..96012298ae4 100644 --- a/Master/tlpkg/TeXLive/TLPDB.pm +++ b/Master/tlpkg/TeXLive/TLPDB.pm @@ -276,7 +276,7 @@ sub from_file { 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 @@ sub from_file { $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 diff --git a/Master/tlpkg/TeXLive/TLUtils.pm b/Master/tlpkg/TeXLive/TLUtils.pm index 6f25d5868e9..565d1146432 100644 --- a/Master/tlpkg/TeXLive/TLUtils.pm +++ b/Master/tlpkg/TeXLive/TLUtils.pm @@ -1665,7 +1665,7 @@ sub _do_postaction_shortcut { $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 @@ sub unpack { $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 @@ sub download_file { return 0; } } - if ($relpath =~ /^(http|ftp):\/\//) { + if ($relpath =~ /^(https?|ftp):\/\//) { $url = $relpath; } else { $url = "$TeXLiveURL/$relpath"; @@ -3552,7 +3552,7 @@ sub give_ctan_mirror_base { 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 @@ sub give_ctan_mirror_base { 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 @@ Returns the local file name if succeeded, otherwise undef. 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 -- cgit v1.2.3