From 2dd4277306d319bf7347cd426523934bcafb6def Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 28 Jun 2011 00:43:01 +0000 Subject: sync git-svn-id: svn://tug.org/texlive/trunk@23155 c570f23f-e606-0410-a88d-b1316a301751 --- .../texk/texlive/linked_scripts/texlive/tlmgr.pl | 337 ++++++++++++--------- Master/texmf-dist/bibtex/bib/beebe/texbook3.bib | 40 ++- Master/texmf-dist/bibtex/bib/beebe/texgraph.bib | 4 +- Master/tlpkg/TeXLive/TLUtils.pm | 4 +- Master/tlpkg/bin/tl-update-asy | 3 +- Master/tlpkg/doc/releng.txt | 7 + Master/tlpkg/texlive.tlpdb | 12 +- 7 files changed, 245 insertions(+), 162 deletions(-) diff --git a/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl b/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl index 4d508695dcf..bf6681e0d8d 100755 --- a/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl +++ b/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl @@ -1,12 +1,12 @@ #!/usr/bin/env perl -# $Id: tlmgr.pl 22912 2011-06-11 04:40:36Z preining $ +# $Id: tlmgr.pl 23117 2011-06-23 18:00:23Z karl $ # # Copyright 2008, 2009, 2010, 2011 Norbert Preining # This file is licensed under the GNU General Public License version 2 # or any later version. -my $svnrev = '$Revision: 22912 $'; -my $datrev = '$Date: 2011-06-11 06:40:36 +0200 (Sat, 11 Jun 2011) $'; +my $svnrev = '$Revision: 23117 $'; +my $datrev = '$Date: 2011-06-23 20:00:23 +0200 (Thu, 23 Jun 2011) $'; my $tlmgrrevision; if ($svnrev =~ m/: ([0-9]+) /) { $tlmgrrevision = $1; @@ -585,21 +585,27 @@ sub handle_execute_actions $::files_changed = 0; } + chomp(my $TEXMFSYSVAR = `kpsewhich -var-value=TEXMFSYSVAR`); + chomp(my $TEXMFSYSCONFIG = `kpsewhich -var-value=TEXMFSYSCONFIG`); + chomp(my $TEXMFLOCAL = `kpsewhich -var-value=TEXMFLOCAL`); + # # maps handling # if enabled and disabled -> do nothing # if only enabled -> enable it # if only disabled -> disable it + # if the option "generate_updmap" is set, then simply ignore all that + # and run the equivalent of tlmgr generate updmap { + my $updmap_run_needed = 0; my %do_enable; my %do_disable; - my $run_full = 0; for my $m (keys %{$::execute_actions{'enable'}{'maps'}}) { - $run_full = 1; + $updmap_run_needed = 1; $do_enable{$m} = 1; } for my $m (keys %{$::execute_actions{'disable'}{'maps'}}) { - $run_full = 1; + $updmap_run_needed = 1; if (defined($do_enable{$m})) { # we are upgrading because it is disabled and enabled, so # delete the entry in do_enable, it is already @@ -609,26 +615,60 @@ sub handle_execute_actions $do_disable{$m} = 1; } } - for my $m (keys %do_disable) { - $errors += do_cmd_and_check("updmap-sys --nomkmap --nohash --disable $m"); - } - for my $m (keys %do_enable) { - my $str = "updmap-sys --nomkmap --nohash --enable " . - $::execute_actions{'enable'}{'maps'}{$m} . "=$m"; - $errors += do_cmd_and_check($str); + if ($updmap_run_needed && $localtlpdb->option("generate_updmap")) { + my $dest = "$TEXMFSYSCONFIG/web2c/updmap.cfg"; + my $localcfg = "$TEXMFLOCAL/web2c/updmap-local.cfg"; + info("tlmgr: generate_updmap writing new $dest\n"); + TeXLive::TLUtils::create_updmap($localtlpdb, $dest, $localcfg); + } else { + for my $m (keys %do_disable) { + $errors += do_cmd_and_check("updmap-sys --nomkmap --nohash --disable $m"); + } + for my $m (keys %do_enable) { + my $str = "updmap-sys --nomkmap --nohash --enable " . + $::execute_actions{'enable'}{'maps'}{$m} . "=$m"; + $errors += do_cmd_and_check($str); + } } - $errors += do_cmd_and_check("updmap-sys") if $run_full; + $errors += do_cmd_and_check("updmap-sys") if $updmap_run_needed; } + # format relevant things + # we first have to check if the config files, that is fmtutil.cnf + # or one of the language* files have changed, regenerate them + # if necessary, and then run the necessary fmtutil calls. - chomp(my $TEXMFSYSVAR = `kpsewhich -var-value=TEXMFSYSVAR`); - chomp(my $TEXMFLOCAL = `kpsewhich -var-value=TEXMFLOCAL`); - - - # format-regenerate is used when the paper size changes. In that - # case, if option("create_formats") is set, we simply want to generate - # { + # first check for language* files + my $regenerate_language = 0; + for my $m (keys %{$::execute_actions{'enable'}{'hyphens'}}) { + $regenerate_language = 1; + last; + } + for my $m (keys %{$::execute_actions{'disable'}{'hyphens'}}) { + $regenerate_language = 1; + last; + } + if ($regenerate_language) { + for my $ext ("dat", "def", "dat.lua") { + my $lang = "language.$ext"; + info("regenerating $lang\n"); + my $arg1 = "$TEXMFSYSVAR/tex/generic/config/language.$ext"; + my $arg2 = "$TEXMFLOCAL/tex/generic/config/language-local.$ext"; + if ($ext eq "dat") { + TeXLive::TLUtils::create_language_dat($localtlpdb, $arg1, $arg2); + } elsif ($ext eq "def") { + TeXLive::TLUtils::create_language_def($localtlpdb, $arg1, $arg2); + } else { + TeXLive::TLUtils::create_language_lua($localtlpdb, $arg1, $arg2); + } + } + } + + # format-regenerate is used when the paper size changes. In that + # case, if option("create_formats") is set, we simply want to generate + # all formats + # my %done_formats; my %updated_engines; my %format_to_engine; @@ -674,37 +714,16 @@ sub handle_execute_actions $done_formats{$f} = 1; } } - } - # - # hyphenation patterns - # if something has changed do the whole stuff ... - { - my $do_something = 0; - for my $m (keys %{$::execute_actions{'enable'}{'hyphens'}}) { - $do_something = 1; - last; - } - for my $m (keys %{$::execute_actions{'disable'}{'hyphens'}}) { - $do_something = 1; - last; - } + # now go back to the hyphenation patterns and regenerate formats + # based on the various language files + # this of course will in some cases duplicate fmtutil calls, + # but it is much easier than actually checking which formats + # don't need to be updated - if ($do_something) { + if ($regenerate_language) { for my $ext ("dat", "def", "dat.lua") { my $lang = "language.$ext"; - info("regenerating $lang\n"); - - my $arg1 = "$TEXMFSYSVAR/tex/generic/config/language.$ext"; - my $arg2 = "$TEXMFLOCAL/tex/generic/config/language-local.$ext"; - if ($ext eq "dat") { - TeXLive::TLUtils::create_language_dat($localtlpdb, $arg1, $arg2); - } elsif ($ext eq "def") { - TeXLive::TLUtils::create_language_def($localtlpdb, $arg1, $arg2); - } else { - TeXLive::TLUtils::create_language_lua($localtlpdb, $arg1, $arg2); - } - if (! TeXLive::TLUtils::win32()) { # Use full path for external command, except on Windows. $lang = "$TEXMFSYSVAR/tex/generic/config/$lang"; @@ -1028,7 +1047,7 @@ sub action_path { } } else { # that should not happen - tlwarn("\nShould not happen, action_path what=$what"); + tlwarn("\ntlmgr: Should not happen, action_path what=$what"); exit 1; } return; @@ -1038,21 +1057,25 @@ sub action_path { # sub action_dumptlpdb { init_local_db(); - # set machine readable to 1 + + # we are basically doing machine-readable output. my $savemr = $::machinereadable; $::machinereadable = 1; - if ($opts{"local"}) { - # since we want to be consistent we write out the location of - # the installation, too, in the format as it is done when - # dumping the remote tlpdb + + if ($opts{"local"} && !$opts{"remote"}) { + # for consistency we write out the location of the installation, + # too, in the same format as when dumping the remote tlpdb print "location-url\t", $localtlpdb->root, "\n"; $localtlpdb->writeout; - return; - } - if ($opts{"remote"}) { + + } elsif ($opts{"remote"} && !$opts{"local"}) { init_tlmedia(); $remotetlpdb->writeout; + + } else { + tlwarn("tlmgr dump-tlpdb: need exactly one of --local and --remote.\n"); } + $::machinereadable = $savemr; return; } @@ -5233,14 +5256,15 @@ written to the terminal. This is a more detailed report than C<--list>. Concisely list the packages which would be updated, newly installed, or removed, without actually changing anything. -If C<--all> is given, it lists all available updates. -If C<--self> is given, but not C<--all> lists only updates the the -critical packages (tlmgr, texlive infrastructure, perl on Windows, etc.). -If neither C<--all> nor C<--self> is given, and in addition no I -is passed on the command line, then C<--all> is assumed (so -C behaves like C). -If neither C<--all> nor C<--self> is given, but package names passed -on the command line, those packages are checked for updates. +If C<--all> is also given, all available updates are listed. +If C<--self> is given, but not C<--all>, only updates to the +critical packages (tlmgr, texlive infrastructure, perl on Windows, etc.) +are listed. +If neither C<--all> nor C<--self> is given, and in addition no I is +given, then C<--all> is assumed (thus, C is the +same as C). +If neither C<--all> nor C<--self> is given, but specific package names are +given, those packages are checked for updates. =item B<--exclude> I @@ -5270,7 +5294,7 @@ C<--all>), or the given I names. =item B<--no-auto-install> [I]... Under normal circumstances C will install packages which are new -on the server, as descrbed above under C<--all>. This option prevents +on the server, as described above under C<--all>. This option prevents any such automatic installation, either for all packages (with C<--all>), or the given I names. @@ -5489,19 +5513,20 @@ written to the terminal. The first form shows the global TeX Live settings currently saved in the TLPDB with a short description and the C used for changing it in -paranthesis. +parentheses. -The second form acts like the first, but also shows options which can -be defined but are not currently set to any value. +The second form is similar, but also shows options which can be defined +but are not currently set to any value. In the third form, if I is not given, the setting for I is displayed. If I is present, I is set to I. -Possible values for I are (but see B for +Possible values for I are (run C for the definitive list): repository (default package repository), formats (create formats at installation time), + postcode (run postinst code blobs) docfiles (install documentation files), srcfiles (install source files), backupdir (default directory for backups), @@ -5509,6 +5534,10 @@ the definitive list): sys_bin (directory to which executables are linked by the path action) sys_man (directory to which man pages are linked by the path action) sys_info (directory to which Info files are linked by the path action) + generate_updmap (run the equivalent of tlmgr generate updmap on changes) + desktop_integration (Windows-only: create Start menu shortcuts) + fileassocs (Windows-only: change file associations) + multiuser (Windows-only: install for all users) One common use of C