summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2008-07-10 10:27:48 +0000
committerNorbert Preining <preining@logic.at>2008-07-10 10:27:48 +0000
commit3726af04a35d7fbf92f6da3ecef2b54d238f27f6 (patch)
treed9b2764ec33b25e902bb8bcf16065e8c1f924da7
parent1c7f172eca48842ba65a3b1069c92059832bf3cb (diff)
TLUtils: process_logging_options now also sets $::LOGFILENAME
TLUtils: download_file: fix stupid error when downloading to | and returning 1 tlmgr/tlmgrgui: use process_logging_options, and transfer between the two back and forth. Well at least from tlmgr to tlmgrgui, unfortunately we cannot transfer it backwards without overwriting stuff already written there git-svn-id: svn://tug.org/texlive/trunk@9427 c570f23f-e606-0410-a88d-b1316a301751
-rwxr-xr-xMaster/texmf/scripts/texlive/tlmgr.pl5
-rw-r--r--Master/tlpkg/TeXLive/TLPDB.pm7
-rw-r--r--Master/tlpkg/TeXLive/TLUtils.pm18
3 files changed, 24 insertions, 6 deletions
diff --git a/Master/texmf/scripts/texlive/tlmgr.pl b/Master/texmf/scripts/texlive/tlmgr.pl
index 1e46f85705c..14d59d274d6 100755
--- a/Master/texmf/scripts/texlive/tlmgr.pl
+++ b/Master/texmf/scripts/texlive/tlmgr.pl
@@ -989,6 +989,11 @@ sub action_gui {
if (defined($opt_gui_lang));
push @cmdline, "--location", "$opt_location"
if (defined($opt_location));
+ push @cmdline, "--logfile", "$::LOGFILENAME"
+ if (defined($::LOGFILE));
+ push @cmdline, "-v" if ($::opt_verbosity > 0);
+ push @cmdline, "-v" if ($::opt_verbosity > 1);
+ push @cmdline, "-q" if ($::opt_quiet > 0);
if (defined($screen)) {
if (($screen eq "install") || ($screen eq "update")) {
push @cmdline, "--load";
diff --git a/Master/tlpkg/TeXLive/TLPDB.pm b/Master/tlpkg/TeXLive/TLPDB.pm
index 55000384f64..1ee3b382990 100644
--- a/Master/tlpkg/TeXLive/TLPDB.pm
+++ b/Master/tlpkg/TeXLive/TLPDB.pm
@@ -189,8 +189,8 @@ sub from_file {
my $root_from_path = dirname(dirname($path));
if (defined($self->{'root'})) {
if ($self->{'root'} ne $root_from_path) {
- printf STDERR "root=$self->{'root'}, root_from_path=$root_from_path\n";
- printf STDERR "Initialisation from different location as originally given.\nHope you are sure!\n";
+ tlwarn("root=$self->{'root'}, root_from_path=$root_from_path\n");
+ tlwarn("Initialisation from different location as originally given.\nHope you are sure!\n");
}
} else {
$self->root($root_from_path);
@@ -227,11 +227,12 @@ sub from_file {
open $retfh, "<$tlpdbfile" or die"Cannot open $tlpdbfile!";
debug("Ok, found the uncompressed lzma file!\n");
}
- }
+ }
} else {
debug("no lzmadec defined, not trying tlpdb.lzma ...\n");
}
if (!defined($retfh)) {
+ debug("TLPDB: downloading $path.lzma didn't succeed, try $path\n");
# lzma did not succeed, so try the normal file
$retfh = TeXLive::TLUtils::download_file($path, "|");
if (!$retfh) {
diff --git a/Master/tlpkg/TeXLive/TLUtils.pm b/Master/tlpkg/TeXLive/TLUtils.pm
index 8a776159ca2..81c502d288c 100644
--- a/Master/tlpkg/TeXLive/TLUtils.pm
+++ b/Master/tlpkg/TeXLive/TLUtils.pm
@@ -1064,10 +1064,21 @@ sub download_file {
}
my $url;
if ($relpath =~ m;^file://*(.*)$;) {
+ my $filetoopen = "/$1";
# $dest is a file name, we have to get the respective dirname
- my $par = dirname($dest);
- copy("/$1", $par);
- return 1;
+ if ($dest eq "|") {
+ open(RETFH, "<$filetoopen") or
+ die("Cannot open $filetoopen for reading");
+ # opening to a pipe always succeeds, so we return immediately
+ return \*RETFH;
+ } else {
+ my $par = dirname ($dest);
+ if (-r $filetoopen) {
+ copy ($filetoopen, $par);
+ return 1;
+ }
+ return 0;
+ }
}
if ($relpath =~ /^(http|ftp):\/\//) {
$url = $relpath;
@@ -1516,6 +1527,7 @@ sub process_logging_options {
if ($opt_logfile) {
open(TLUTILS_LOGFILE, ">$opt_logfile") || die "open(>$opt_logfile) failed: $!\n";
$::LOGFILE = \*TLUTILS_LOGFILE;
+ $::LOGFILENAME = $opt_logfile;
}
}