diff options
author | Norbert Preining <preining@logic.at> | 2011-09-13 01:17:58 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2011-09-13 01:17:58 +0000 |
commit | 3872da8466c31b1cedc8fbf2c43edc1fb720d63d (patch) | |
tree | 18ff4d19a8efd5b8b4d9a024c50a6f02dc184529 /Master | |
parent | 89636c024bd5cc5fdd27a978b16894d6e3f3814f (diff) |
rename mirror.pl -> ctan-mirrors.pl, add a (not used) function
git-svn-id: svn://tug.org/texlive/trunk@23928 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r-- | Master/tlpkg/TeXLive/TLUtils.pm | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/Master/tlpkg/TeXLive/TLUtils.pm b/Master/tlpkg/TeXLive/TLUtils.pm index 501dd6cb1d3..fe903182484 100644 --- a/Master/tlpkg/TeXLive/TLUtils.pm +++ b/Master/tlpkg/TeXLive/TLUtils.pm @@ -62,6 +62,7 @@ C<TeXLive::TLUtils> -- utilities used in the TeX Live infrastructure TeXLive::TLUtils::setup_programs($bindir, $platform); TeXLive::TLUtils::tlcmp($file, $file); TeXLive::TLUtils::nulldev(); + TeXLive::TLUtils::get_full_line($fh); =head2 Installer Functions @@ -184,6 +185,7 @@ BEGIN { &setup_persistent_downloads &mktexupd &nulldev + &get_full_line ); @EXPORT = qw(setup_programs download_file process_logging_options tldie tlwarn info log debug ddebug dddebug debug_hash @@ -2438,6 +2440,31 @@ sub nulldev { return (&win32)? 'nul' : '/dev/null'; } +=item C<get_full_line ($fh)> + +returns the next line from the file handle $fh, taking +continuation lines into account (last character of a line is \, and +no quoting is parsed). + +=cut + +# open my $f, '<', $file_name or die; +# while (my $l = get_full_line($f)) { ... } +# close $f or die; +sub get_full_line { + my ($fh) = @_; + my $line = <$fh>; + return undef unless defined $line; + return $line unless $line =~ s/\\\r?\n$//; + my $cont = get_full_line($fh); + if (!defined($cont)) { + tlwarn('Continuation disallowed at end of file'); + $cont = ""; + } + $cont =~ s/^\s*//; + return $line . $cont; +} + =back @@ -3450,7 +3477,7 @@ sub give_ctan_mirror =item C<extract_mirror_entry($listentry)> C<create_mirror_list> returns the lists of viable mirrors according to -mirrors.pl, in a list which also contains continents, and country headers. +ctan-mirrors.pl, in a list which also contains continents, and country headers. C<extract_mirror_entry> extracts the actual repository data from one of these entries. @@ -3462,7 +3489,7 @@ of these entries. sub create_mirror_list { our $mirrors; my @ret = (); - require("installer/mirrors.pl"); + require("installer/ctan-mirrors.pl"); my @continents = sort keys %$mirrors; for my $continent (@continents) { # first push the name of the continent |