summaryrefslogtreecommitdiff
path: root/Master/tlpkg/dev/dev.update-tlpdb-option-on-the-fly.patch
diff options
context:
space:
mode:
Diffstat (limited to 'Master/tlpkg/dev/dev.update-tlpdb-option-on-the-fly.patch')
-rw-r--r--Master/tlpkg/dev/dev.update-tlpdb-option-on-the-fly.patch56
1 files changed, 56 insertions, 0 deletions
diff --git a/Master/tlpkg/dev/dev.update-tlpdb-option-on-the-fly.patch b/Master/tlpkg/dev/dev.update-tlpdb-option-on-the-fly.patch
new file mode 100644
index 00000000000..f6d5d9cb926
--- /dev/null
+++ b/Master/tlpkg/dev/dev.update-tlpdb-option-on-the-fly.patch
@@ -0,0 +1,56 @@
+--- ./texmf/scripts/texlive/tlmgr.pl.pre 2010-09-14 01:36:15.000000000 +0900
++++ ./texmf/scripts/texlive/tlmgr.pl 2010-09-14 02:11:51.000000000 +0900
+@@ -1811,6 +1811,10 @@
+ }
+
+ sub action_update {
++ # the following var is only use to update options in
++ # the local tlpdb in case we updated texlive.infra
++ my $texlive_infra_was_updated = 0;
++
+ init_local_db(1);
+ $opts{"no-depends"} = 1 if $opts{"no-depends-at-all"};
+
+@@ -2446,6 +2450,9 @@
+ }
+ }
+ }
++ # special case if texlive.infra was changed so that before shutting
++ # down we can update the options
++ $texlive_infra_was_updated = 1 if ($pkg eq "texlive.infra");
+ } else {
+ # install_package returned a scalar, so error.
+ # now in fact we should do some cleanup, removing files and
+@@ -2614,6 +2621,32 @@
+ }
+ }
+
++ # update of tlpdb options
++ # if texlive.infra has been updated (actually, not --list or --dry-run)
++ # we check the old against the new TLConfig::TLPDBOptions and add
++ # new ones
++ if ($texlive_infra_was_updated) {
++ my $changed = 0;
++ # save he old %TLConfig:
++ my %oldTLPDBOptions = %TeXLive::TLConfig::TLPDBOptions;
++ # make sure that a require reloads the TLConfig.pm
++ delete $INC{'TeXLive/TLConfig.pm'};
++ # reload TLConfig.pm, but disable warnings about redefining stuff
++ no warnings qw(redefine);
++ require 'TeXLive/TLConfig.pm';
++ use warnings 'all';
++ for my $opt (keys %TeXLive::TLConfig::TLPDBOptions) {
++ next if (defined($oldTLPDBOptions{$opt}));
++ $changed = 1;
++ info("Updating local tlpdb:\n");
++ info("* new option $opt\n");
++ info(" description: " . $TeXLive::TLConfig::TLPDBOptions{$opt}->[3] . "\n");
++ info(" default value: " . $TeXLive::TLConfig::TLPDBOptions{$opt}->[1] . "\n");
++ $localtlpdb->option($opt, $TeXLive::TLConfig::TLPDBOptions{$opt}->[1]);
++ }
++ $localtlpdb->save if $changed;
++ }
++
+ my $restart_tlmgr = 0;
+ if ($opts{"self"} && @critical &&
+ $infra_update_done && $other_updates_asked_for) {