From 10cf54d888d3329dbb08d5fc0b0e1766befd1192 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Thu, 14 Oct 2010 17:00:01 +0000 Subject: update some stuff I forgot to commit since ages, no idea if it is actually necessary for now git-svn-id: svn://tug.org/texlive/trunk@20098 c570f23f-e606-0410-a88d-b1316a301751 --- .../dev/dev.update-tlpdb-option-on-the-fly.patch | 56 ++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 Master/tlpkg/dev/dev.update-tlpdb-option-on-the-fly.patch (limited to 'Master/tlpkg/dev/dev.update-tlpdb-option-on-the-fly.patch') 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) { -- cgit v1.2.3