summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Master/texmf/scripts/texlive/NEWS7
-rwxr-xr-xMaster/texmf/scripts/texlive/tlmgr.pl37
2 files changed, 36 insertions, 8 deletions
diff --git a/Master/texmf/scripts/texlive/NEWS b/Master/texmf/scripts/texlive/NEWS
index f5480cab3cc..552e21babe2 100644
--- a/Master/texmf/scripts/texlive/NEWS
+++ b/Master/texmf/scripts/texlive/NEWS
@@ -1,7 +1,12 @@
(This file public domain. Originally written by Norbert Preining and
Karl Berry, 2010.)
-tlmgr rev next
+tlmgr rev next (YYYY-MM-DD)
+
+ * implement download selection mode in TEXMFCONFIG/tlmgr/config file
+ (option: persistent-downloads 0|1)
+
+tlmgr rev 17811 (2010-04-25)
* tlmgr restore --all: restoring the latest, using all available backups.
* GUI: add support for restore action.
diff --git a/Master/texmf/scripts/texlive/tlmgr.pl b/Master/texmf/scripts/texlive/tlmgr.pl
index 131f7af9cd6..8868377b291 100755
--- a/Master/texmf/scripts/texlive/tlmgr.pl
+++ b/Master/texmf/scripts/texlive/tlmgr.pl
@@ -203,7 +203,6 @@ sub main {
TeXLive::TLUtils::process_logging_options();
- $opts{'persistent-downloads'} = 1;
GetOptions(\%opts, keys(%optarg)) or pod2usage(2);
$::debug_translation = 0;
@@ -326,15 +325,30 @@ sub main {
$loadmediasrcerror = "Cannot load TeX Live database from ";
#
- # if we are asked to use persistent connections try to start it here
- #
- TeXLive::TLUtils::setup_persistent_downloads()
- if $opts{'persistent-downloads'};
+ # load the config file and set the config options
+ # load it BEFORE starting downloads as we seet persistent-downloads there!
+ load_config_file();
#
- # load the config file and set the config options
+ # if we are asked to use persistent connections try to start it here
#
- load_config_file();
+ {
+ my $do_persistent;
+ if (defined($opts{'persistent-downloads'})) {
+ # a command line argument for persistent-downloads has been given,
+ # either with --no-... or --... that overrides any other setting
+ $do_persistent = $opts{'persistent-downloads'};
+ } else {
+ # check if it is set in the config file
+ if (defined($config{'persistent-downloads'})) {
+ $do_persistent = $config{'persistent-downloads'};
+ }
+ }
+ # default method is doing persistent downloads:
+ $do_persistent = ($do_persistent || 1);
+ TeXLive::TLUtils::setup_persistent_downloads()
+ if $do_persistent;
+ }
execute_action($action, @ARGV);
@@ -4305,6 +4319,12 @@ sub load_config_file
} else {
tlwarn("Unknown value $val for gui_expertmode in $fn\n");
}
+ } elsif ($key eq "persistent-downloads") {
+ if (($val eq "0") || ($val eq "1")) {
+ $config{'persistent-downloads'} = $val;
+ } else {
+ tlwarn("Unknown value $val for persistent_download in $fn\n");
+ }
} else {
tlwarn("Unknown key $key in $fn\n");
}
@@ -4329,6 +4349,9 @@ sub write_config_file
tlwarn("Cannot open $fn for writing: $!");
return;
}
+ print TLC "# tlmgr/config file\n";
+ print TLC "# written by tlmgr\n";
+ print TLC "# all comments will be deleted\n";
for my $k (keys %config) {
print TLC "$k = $config{$k}\n";
}