summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2009-02-11 19:02:59 +0000
committerNorbert Preining <preining@logic.at>2009-02-11 19:02:59 +0000
commit4d2a3e89c58e5ada3e1792f609aa53931e26289e (patch)
treec0a0a7e4ee34070ea75899417763777f2910ab57 /Master
parente33ed124e43ee9e324608dd1bde8b0a462019ce2 (diff)
do some patch reorganization
git-svn-id: svn://tug.org/texlive/trunk@12143 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r--Master/tlpkg/archive/rej.postaction-code-in-tlpsrc.patch (renamed from Master/tlpkg/etc/dev.postaction-code-in-tlpsrc.patch)0
-rw-r--r--Master/tlpkg/etc/2009.combined.patch1759
-rw-r--r--Master/tlpkg/etc/2009.combined.patch.README38
-rw-r--r--Master/tlpkg/etc/dev.postaction-in-tlpsrc.patch398
-rw-r--r--Master/tlpkg/etc/dev.postaction-in-tlpsrc.patch.README29
5 files changed, 2224 insertions, 0 deletions
diff --git a/Master/tlpkg/etc/dev.postaction-code-in-tlpsrc.patch b/Master/tlpkg/archive/rej.postaction-code-in-tlpsrc.patch
index a8bf9cdc332..a8bf9cdc332 100644
--- a/Master/tlpkg/etc/dev.postaction-code-in-tlpsrc.patch
+++ b/Master/tlpkg/archive/rej.postaction-code-in-tlpsrc.patch
diff --git a/Master/tlpkg/etc/2009.combined.patch b/Master/tlpkg/etc/2009.combined.patch
new file mode 100644
index 00000000000..6a588c3f50c
--- /dev/null
+++ b/Master/tlpkg/etc/2009.combined.patch
@@ -0,0 +1,1759 @@
+Index: texmf/scripts/texlive/tlmgr.pl
+===================================================================
+--- texmf/scripts/texlive/tlmgr.pl (revision 12142)
++++ texmf/scripts/texlive/tlmgr.pl (working copy)
+@@ -557,6 +557,9 @@
+ info("running post remove action for $pkg\n");
+ &{$PostRemove{$pkg}}($localtlpdb->root);
+ }
++ #
++ # Run the post installation code in the postaction tlpsrc entries
++ &TeXLive::TLUtils::do_postaction_code("remove", $tlp);
+ }
+ return \%ret;
+ }
+Index: texmf/scripts/texlive/uninstall-win32.pl
+===================================================================
+--- texmf/scripts/texlive/uninstall-win32.pl (revision 12142)
++++ texmf/scripts/texlive/uninstall-win32.pl (working copy)
+@@ -17,6 +17,11 @@
+ }
+
+ use TeXLive::TLWinGoo;
++use TeXLive::TLPDB;
++use TeXLive::TLPOBJ;
++use TeXLive::TLPostActions;
++use TeXLive::TLConfig;
++use TeXLive::TLUtils;
+ use Tk;
+ use Tk::Dialog;
+
+@@ -39,6 +44,23 @@
+ $cancel->pack(-side => 'left' , -padx => "3m");
+
+ sub doit {
++ # first we remove the whole bunch of shortcuts and menu entries
++ # by calling all the post action codes for the installed packages
++ my $localtlpdb = TeXLive::TLPDB->new ("root" => $Master);
++ if (!defined($localtlpdb)) {
++ tlwarn("Cannot load the TLPDB from $Master, are you sure there is an installation?\n");
++ } else {
++ for my $pkg ($localtlpdb->list_packages) {
++ if (defined($PostRemove{$pkg})) {
++ info("running post remove action for $pkg\n");
++ &{$PostRemove{$pkg}}($Master);
++ }
++ }
++ &TeXLive::TLUtils::do_postaction_code("remove", $pkg);
++ }
++ my $menupath = &TeXLive::TLWinGoo::menu_path();
++ $menupath =~ s!/!\\!g;
++ `rmdir /s /q "$menupath\\$TeXLive::TLConfig::WindowsMainMenuName" 2>nul`;
+ remove_texbindirs_from_path();
+ unsetenv_reg("TEXBINDIR");
+ # from_dvd case:
+Index: install-tl
+===================================================================
+--- install-tl (revision 12142)
++++ install-tl (working copy)
+@@ -82,7 +82,6 @@
+ &add_menu_shortcut
+ &remove_desktop_shortcut
+ &remove_menu_shortcut
+- &init_unshortbat
+ &create_uninstaller
+ ));
+ }
+@@ -1052,6 +1051,11 @@
+ # post install actions
+ #
+
++ # in case we are running from DVD we use the tlpdb from the DVD, otherwise
++ # the one we have locally created, for all the further actions
++ my $usedtlpdb = $vars{'from_dvd'} ? $tlpdb : $localtlpdb;
++
++
+ if (win32()) {
+ debug "Actual environment:\n".`set`."\n\n";
+ debug 'Effective TEXMFCNF: '.`kpsewhich -expand-path=\$TEXMFCNF`."\n";
+@@ -1060,15 +1064,24 @@
+ # (re-)initialize batchfile for uninstalling shortcuts
+ if (win32() and !$opt_portable) {
+ mkdirhier("$TEXDIRW/tlpkg/installer") if $vars{'from_dvd'};
+- init_unshortbat($TEXDIRW);
+ }
+
++ # Run the post installation code in TLPostAction.pm
+ foreach my $package (sort keys %install) {
+ if ($install{$package} && defined($PostInstall{$package})) {
+ info("running post install action for $package\n");
+ &{$PostInstall{$package}}($TEXDIR, $TEXDIRW, $TEXMFSYSVAR, $TEXMFLOCAL);
+ }
+ }
++ # Run the post installation code in the postaction tlpsrc entries
++ foreach my $package (sort keys %install) {
++ if ($install{$package}) {
++ &TeXLive::TLUtils::do_postaction_code("install",
++ $usedtlpdb->get_package($package));
++ }
++ }
++ info ("finished with package specific postactions\n");
++
+ # $opt_portable: no %install but we still want xetex postinstall
+ &{$PostInstall{'xetex'}}($TEXDIR, $TEXDIRW, $TEXMFSYSVAR, $TEXMFLOCAL)
+ if $opt_portable;
+@@ -1085,25 +1098,25 @@
+ # texconfig generate * but Win32 does not have texconfig. But we have
+ # $localtlpdb and this is simple code, so do it directly, i.e., duplicate
+ # the code from the various generate-*.pl scripts
++
+ info("writing fmtutil.cnf data to $TEXMFSYSVAR/web2c/fmtutil.cnf\n");
+- my $tlp = $vars{'from_dvd'} ? $tlpdb : $localtlpdb;
+- TeXLive::TLUtils::create_fmtutil($tlp, #$localtlpdb,
++ TeXLive::TLUtils::create_fmtutil($usedtlpdb,
+ "$TEXMFSYSVAR/web2c/fmtutil.cnf",
+ "$TEXMFLOCAL/web2c/fmtutil-local.cnf");
+
+ mkdirhier "$vars{'TEXMFSYSCONFIG'}/web2c";
+ info("writing updmap.cfg to $TEXMFSYSCONFIG/web2c/updmap.cfg\n");
+- TeXLive::TLUtils::create_updmap ($tlp, #$localtlpdb,
++ TeXLive::TLUtils::create_updmap ($usedtlpdb,
+ "$TEXMFSYSCONFIG/web2c/updmap.cfg",
+ "$TEXMFLOCAL/web2c/updmap-local.cfg");
+
+ info("writing language.dat data to $TEXMFSYSVAR/tex/generic/config/language.dat\n");
+- TeXLive::TLUtils::create_language_dat($tlp, #$localtlpdb,
++ TeXLive::TLUtils::create_language_dat($usedtlpdb,
+ "$TEXMFSYSVAR/tex/generic/config/language.dat",
+ "$TEXMFLOCAL/tex/generic/config/language-local.dat");
+
+ info("writing language.def data to $TEXMFSYSVAR/tex/generic/config/language.def\n");
+- TeXLive::TLUtils::create_language_def($tlp, #$localtlpdb,
++ TeXLive::TLUtils::create_language_def($usedtlpdb,
+ "$TEXMFSYSVAR/tex/generic/config/language.def",
+ "$TEXMFLOCAL/tex/generic/config/language-local.def");
+
+Index: tlpkg/TeXLive/TLPDB.pm
+===================================================================
+--- tlpkg/TeXLive/TLPDB.pm (revision 12142)
++++ tlpkg/TeXLive/TLPDB.pm (working copy)
+@@ -1239,26 +1239,64 @@
+ =cut
+ sub fmtutil_cnf_lines {
+ my $self = shift;
+- my %fmtcnffiles;
+- foreach my $p ($self->list_packages) {
+- my $obj = $self->get_package ($p);
+- die "$0: No TeX Live package named $p, strange" if ! $obj;
++ my @fmtlines = ();
++
++ foreach my $pkg ($self->list_packages) {
++ my $obj = $self->get_package ($pkg);
++ die "No TeX Live package named $pkg, too strange" if ! $obj;
++ my $first = 1;
+ foreach my $e ($obj->executes) {
+- if ($e =~ m/BuildFormat (.*)$/) {
+- $fmtcnffiles{$1} = 1;
+- }
+- # others are ignored here
++ if ($e =~ m/AddFormat\s+(.*)\s*/) {
++ my $name;
++ my $engine;
++ my $patterns = "-";
++ my $options = "";
++ my $mode = "";
++ if ($first) {
++ push @fmtlines, "# from $pkg:\n";
++ $first = 0;
++ }
++ foreach my $p (&TeXLive::TLUtils::quotewords('\s+', 0, "$1")) {
++ # foreach my $p (split(' ', $1)) {
++ my ($a, $b);
++ if ($p =~ m/^(name|engine|mode|patterns|options)=(.*)$/) {
++ $a = $1;
++ $b = $2;
++ } else {
++ die "Unknown format directive in $pkg: $e";
++ }
++ if ($a eq "name") {
++ die "AddFormat line needs name=something: $pkg, $e" unless $b;
++ $name = $b; next;
++ }
++ if ($a eq "engine") {
++ die "AddFormat line needs engine=something: $pkg, $e" unless $b;
++ $engine = $b; next;
++ }
++ if ($a eq "patterns") {
++ $patterns = ( $b ? $b : "-");
++ next;
++ }
++ if ($a eq "mode") {
++ if ($b eq "disabled") {
++ $mode = "#! ";
++ } else {
++ $mode = "";
++ }
++ next;
++ }
++ if ($a eq "options") {
++ $options = ( $b ? $b : "");
++ next;
++ }
++ # should not be reached at all
++ die "Unknown language directive in $pkg: $e";
++ }
++ push @fmtlines, "$mode$name $engine $patterns $options\n";
++ }
+ }
+ }
+- my @formatlines;
+- foreach my $f (sort keys %fmtcnffiles) {
+- open(INFILE,"<$self->{'root'}/texmf/fmtutil/format.$f.cnf")
+- or tlwarn("Cannot open $self->{'root'}/texmf/fmtutil/format.$f.cnf\nThe generated fmtutil.cnf file might be incomplete.\nError: $!\n");
+- @tmp = <INFILE>;
+- close(INFILE);
+- push @formatlines, @tmp;
+- }
+- return(@formatlines);
++ return @fmtlines;
+ }
+
+ =item C<< $tlpdb->updmap_cfg_lines >>
+Index: tlpkg/TeXLive/TLConfig.pm
+===================================================================
+--- tlpkg/TeXLive/TLConfig.pm (revision 12142)
++++ tlpkg/TeXLive/TLConfig.pm (working copy)
+@@ -28,6 +28,7 @@
+ $WinSpecialUpdatePackagesRegexp
+ @CriticalPackagesList
+ @AllowedConfigOptions
++ $WindowsMainMenuName
+ );
+ @EXPORT = @EXPORT_OK;
+ }
+@@ -82,6 +83,8 @@
+ autobackup
+ /;
+
++our $WindowsMainMenuName = "TeX Live 2008";
++
+ 1;
+
+
+Index: tlpkg/TeXLive/TLPostActions.pm
+===================================================================
+--- tlpkg/TeXLive/TLPostActions.pm (revision 12142)
++++ tlpkg/TeXLive/TLPostActions.pm (working copy)
+@@ -20,48 +20,13 @@
+ use TeXLive::TLUtils qw(win32 mkdirhier copy conv_to_w32_path log debug info
+ touch tlwarn);
+ use TeXLive::TLWinGoo;
++use TeXLive::TLConfig;
+
+-my $mainmenu = "TeX Live 2008";
++my $mainmenu = $TeXLive::TLConfig::WindowsMainMenuName;
+
+ our %PostInstall;
+ our %PostRemove;
+
+-# NOT ENABLED !!!!!
+-# context post install actions
+-sub do_install_bin_context {
+- my ($texdir, $texdirw, $texmfsysvar) = @_;
+- # set up texmfcnf.lua
+- my $TMF = "$texdirw/texmf/web2c/texmfcnf.lua";
+- if (! -r $TMF) {
+- open(TMF, ">$TMF") || die "open($TMF) failed: $!\n";
+- print TMF 'local conf = {}', "\n";
+- print TMF "conf.TEXMFCACHE = \"$texmfsysvar\"\n";
+- #print TMP "conf.CACHEINTDS = 't'\n";
+- print TMF "return conf\n";
+- close(TMF) || warn "close($TMF) failed: $!";
+- }
+- # update the luatools cache
+- system("luatools", "--generate");
+- # build the context formats based on luatex
+- system("context", "--make", "--compile", "cont-en");
+- # update the font cache
+- system("mtxrun", "--script", "fonts", "--reload");
+-}
+-#
+-# That has to be sorted out and maybe changed at a later time, so do NOT
+-# enable that for now.
+-###$PostInstall{"bin-context"} = \&do_install_bin_context;
+-
+-
+-# ATM do the same for luatex as for context
+-sub do_install_luatex {
+- do_install_bin_context(@_);
+-}
+-#
+-# SEE ABOVE
+-# $PostInstall{"luatex"} = \&do_install_luatex;
+-
+-
+ # xetex
+ #
+ sub do_install_xetex {
+@@ -149,136 +114,13 @@
+ }
+ $PostInstall{"xetex"} = \&do_install_xetex;
+
+-#
+-# bin-dviout.win32
+-#
+-sub do_install_bin_dviout_win32 {
+- my ($texdir, $texdirw) = @_;
+- if (win32()) {
+- my $texdir_bsl = conv_to_w32_path($texdir);
+- add_menu_shortcut(
+- $mainmenu,
+- 'DVIOUT Dvi Viewer',
+- $texdir.'/tlpkg/dviout/dviout.exe', # for the icon
+- 'wscript',
+- $texdir_bsl."\\bin\\win32\\dviout.vbs",
+- '',
+- );
+- }
+-}
+-sub do_remove_bin_dviout_win32 {
+- my ($texdir) = @_;
+- if (win32()) {
+- remove_menu_shortcut($mainmenu, 'DVIOUT Dvi Viewer');
+- }
+-}
+-$PostInstall{'bin-dviout.win32'} = \&do_install_bin_dviout_win32;
+-$PostRemove{'bin-dviout.win32'} = \&do_remove_bin_dviout_win32;
+
+-
+ #
+-# bin-texdoc
+-#
+-sub do_install_bin_texdoc {
+- my ($texdir, $texdirw) = @_;
+- if (win32()) {
+- #add_desktop_shortcut(
+- # $texdirw,
+- # 'TeXdoc GUI',
+- # '', # $vars{'TEXDIR'}.'/tlpkg/doc/notes.ico', # the icon
+- # $texdir.'/bin/win32/texdoctk.bat',
+- # '', # no args
+- # 'batgui', # any non-null value to hide command-prompt
+- #);
+- add_menu_shortcut(
+- $mainmenu,
+- 'TeXdoc GUI',
+- '', # $vars{'TEXDIR'}.'/tlpkg/doc/notes.ico', # the icon
+- $texdir.'/bin/win32/texdoctk.bat',
+- '', # no args
+- 'batgui', # any non-null value to hide command-prompt
+- );
+- }
+-}
+-sub do_remove_bin_texdoc {
+- my ($texdir) = @_;
+- if (win32()) {
+- # remove_desktop_shortcut('TeXdoc GUI');
+- remove_menu_shortcut($mainmenu, 'TeXdoc GUI');
+- }
+-}
+-$PostInstall{'bin-texdoc'} = \&do_install_bin_texdoc;
+-$PostRemove{'bin-texdoc'} = \&do_remove_bin_texdoc;
+-
+-#
+-# bin-tlpsv.win32
+-#
+-sub do_install_bin_tlpsv_win32 {
+- my ($texdir, $texdirw) = @_;
+- if (win32()) {
+- add_desktop_shortcut(
+- $texdirw,
+- 'PS_View',
+- $texdir.'/tlpkg/tlpsv/psv.exe', # icon, not prog!
+- $texdir.'/bin/win32/psv.bat',
+- '', # no args
+- 'batgui', # any non-null value to hide command-prompt
+- );
+- add_menu_shortcut(
+- $mainmenu,
+- 'PS_View',
+- $texdir.'/tlpkg/tlpsv/psv.exe', # icon, not prog!
+- $texdir.'/bin/win32/psv.bat',
+- '', # no args
+- 'batgui', # any non-null value to hide command-prompt
+- );
+- #register_extension(".ps", "PostScript");
+- #register_extension(".eps", "PostScript");
+- ##register_file_type("PostScript", '"'.$texdir.'/bin/win32/psv.bat"');
+- #register_file_type("PostScript",
+- # '"'.$texdir.'/tlpkg/tlpsv/gswxlua.exe" -g '.
+- # '"'.$texdir.'/tlpkg/tlgs/bin/gsdll32.dll" -l '.
+- # '"'.$texdir.'/tlpkg/tlpsv/psv.wx.lua" -p '.
+- # '"'.$texdir.'/tlpkg/tlpsv/psv_view.ps" -sINPUT="%1"');
+- #update_assocs();
+- }
+-}
+-sub do_remove_bin_tlpsv_win32 {
+- my ($texdir) = @_;
+- if (win32()) {
+- remove_desktop_shortcut('PS_View');
+- remove_menu_shortcut($mainmenu, 'PS_View');
+- #unregister_extension(".ps");
+- #unregister_extension(".eps");
+- #unregister_file_type("PostScript");
+- #update_assocs();
+- }
+-}
+-$PostRemove{'bin-tlpsv.win32'} = \&do_remove_bin_tlpsv_win32;
+-$PostInstall{'bin-tlpsv.win32'} = \&do_install_bin_tlpsv_win32;
+-
+-#
+ # bin-texlive
+ #
+ sub do_install_bin_texlive {
+ my ($texdir, $texdirw) = @_;
+ if (win32()) {
+- add_menu_shortcut(
+- $mainmenu,
+- 'TeX Live Manager',
+- '', # $texdir.'/tlpkg/doc/dummy.ico',
+- $texdir.'/bin/win32/tlmgr.bat',
+- 'gui',
+- 'batgui',
+- );
+- add_menu_shortcut(
+- $mainmenu,
+- 'Release notes',
+- '',
+- 'http://tug.org/texlive/windows.html',
+- '',
+- '',
+- );
+ if (uc(TeXLive::TLWinGoo::win_which_dir('tex.exe')) ne
+ uc($texdir.'/bin/win32') or
+ uc(TeXLive::TLWinGoo::win_which_dir('pdftex.exe')) ne
+@@ -296,7 +138,6 @@
+ '',
+ );
+ add_desktop_shortcut(
+- $texdirw,
+ 'TeX Live Prompt',
+ '',
+ $ENV{'COMSPEC'},
+@@ -309,8 +150,6 @@
+ sub do_remove_bin_texlive {
+ my ($texdir) = @_;
+ if (win32()) {
+- remove_menu_shortcut($mainmenu, 'TeX Live Manager');
+- remove_menu_shortcut($mainmenu, 'Release notes');
+ remove_menu_shortcut($mainmenu, 'TeX Live Prompt');
+ remove_desktop_shortcut('TeX Live Prompt');
+ }
+@@ -318,431 +157,6 @@
+ $PostInstall{'bin-texlive'} = \&do_install_bin_texlive;
+ $PostRemove{'bin-texlive'} = \&do_remove_bin_texlive;
+
+-#
+-# texlive.infra
+-# ships all the readme.html/readme.XX.html files, and the index of all
+-# documents
+-sub do_install_texlive_infra {
+- my ($texdir) = @_;
+- if (win32()) {
+- if (!defined($texdir)) {
+- tlwarn("do_install_texlive_infra: texdir not defined, returning\n");
+- return;
+- }
+- add_menu_shortcut(
+- $mainmenu,
+- 'TeX Live Toplevel Readme Index',
+- '', # default pdf icon
+- $texdir.'/index.html',
+- '',
+- '',
+- );
+- }
+-}
+-sub do_remove_texlive_infra {
+- my ($texdir) = @_;
+- if (win32()) {
+- remove_menu_shortcut($mainmenu,'TeX Live Toplevel Readme Index');
+- }
+-}
+-$PostInstall{'texlive.infra'} = \&do_install_texlive_infra;
+-$PostRemove{'texlive.infra'} = \&do_remove_texlive_infra;
+-
+-#
+-# texlive-en
+-#
+-sub do_install_texlive_en {
+- my ($texdir) = @_;
+- if (win32()) {
+- if (!defined($texdir)) {
+- tlwarn("do_install_texlive_en: texdir not defined, returning\n");
+- return;
+- }
+- add_menu_shortcut(
+- $mainmenu,
+- 'TeX Live Manual (en) (HTML)',
+- '', # default pdf icon
+- $texdir.'/texmf-doc/doc/english/texlive-en/texlive-en.html',
+- '',
+- '',
+- );
+- add_menu_shortcut(
+- $mainmenu,
+- 'TeX Live Manual (en) (PDF)',
+- '', # default pdf icon
+- $texdir.'/texmf-doc/doc/english/texlive-en/texlive-en.pdf',
+- '',
+- '',
+- );
+- }
+-}
+-sub do_remove_texlive_en {
+- my ($texdir) = @_;
+- if (win32()) {
+- remove_menu_shortcut($mainmenu,'TeX Live Manual (en) (HTML)');
+- remove_menu_shortcut($mainmenu,'TeX Live Manual (en) (PDF)');
+- }
+-}
+-$PostInstall{'texlive-en'} = \&do_install_texlive_en;
+-$PostRemove{'texlive-en'} = \&do_remove_texlive_en;
+-
+-#
+-# texlive-cz
+-#
+-sub do_install_texlive_cz {
+- my ($texdir) = @_;
+- if (win32()) {
+- if (!defined($texdir)) {
+- tlwarn("do_install_texlive_cz: texdir not defined, returning\n");
+- return;
+- }
+- add_menu_shortcut(
+- $mainmenu,
+- 'TeX Live Manual (cz) (PDF)',
+- '', # default pdf icon
+- $texdir.'/texmf-doc/doc/czechslovak/texlive-cz/texlive-cz.pdf',
+- '',
+- '',
+- );
+- add_menu_shortcut(
+- $mainmenu,
+- 'TeX Live Manual (cz) (HTML)',
+- '', # default pdf icon
+- $texdir.'/texmf-doc/doc/czechslovak/texlive-cz/texlive-cz.html',
+- '',
+- '',
+- );
+- }
+-}
+-sub do_remove_texlive_cz {
+- my ($texdir) = @_;
+- if (win32()) {
+- remove_menu_shortcut($mainmenu,'TeX Live Manual (cz) (PDF)');
+- remove_menu_shortcut($mainmenu,'TeX Live Manual (cz) (HTML)');
+- }
+-}
+-$PostInstall{'texlive-cz'} = \&do_install_texlive_cz;
+-$PostRemove{'texlive-cz'} = \&do_remove_texlive_cz;
+-
+-#
+-# texlive-fr
+-#
+-sub do_install_texlive_fr {
+- my ($texdir) = @_;
+- if (win32()) {
+- if (!defined($texdir)) {
+- tlwarn("do_install_texlive_fr: texdir not defined, returning\n");
+- return;
+- }
+- add_menu_shortcut(
+- $mainmenu,
+- 'TeX Live Manual (fr) (PDF)',
+- '', # default pdf icon
+- $texdir.'/texmf-doc/doc/french/texlive-fr/texlive-fr.pdf',
+- '',
+- '',
+- );
+- add_menu_shortcut(
+- $mainmenu,
+- 'TeX Live Manual (fr) (HTML)',
+- '', # default pdf icon
+- $texdir.'/texmf-doc/doc/french/texlive-fr/texlive-fr.html',
+- '',
+- '',
+- );
+- }
+-}
+-sub do_remove_texlive_fr {
+- my ($texdir) = @_;
+- if (win32()) {
+- remove_menu_shortcut($mainmenu,'TeX Live Manual (fr) (HTML)');
+- remove_menu_shortcut($mainmenu,'TeX Live Manual (fr) (PDF)');
+- }
+-}
+-$PostInstall{'texlive-fr'} = \&do_install_texlive_fr;
+-$PostRemove{'texlive-fr'} = \&do_remove_texlive_fr;
+-
+-#
+-# texlive-de
+-#
+-sub do_install_texlive_de {
+- my ($texdir) = @_;
+- if (win32()) {
+- if (!defined($texdir)) {
+- tlwarn("do_install_texlive_de: texdir not defined, returning\n");
+- return;
+- }
+- add_menu_shortcut(
+- $mainmenu,
+- 'TeX Live Manual (de) (PDF)',
+- '', # default pdf icon
+- $texdir.'/texmf-doc/doc/german/texlive-de/texlive-de.pdf',
+- '',
+- '',
+- );
+- add_menu_shortcut(
+- $mainmenu,
+- 'TeX Live Manual (de) (HTML)',
+- '', # default pdf icon
+- $texdir.'/texmf-doc/doc/german/texlive-de/texlive-de.html',
+- '',
+- '',
+- );
+- }
+-}
+-sub do_remove_texlive_de {
+- my ($texdir) = @_;
+- if (win32()) {
+- remove_menu_shortcut($mainmenu,'TeX Live Manual (de) (PDF)');
+- remove_menu_shortcut($mainmenu,'TeX Live Manual (de) (HTML)');
+- }
+-}
+-$PostInstall{'texlive-de'} = \&do_install_texlive_de;
+-$PostRemove{'texlive-de'} = \&do_remove_texlive_de;
+-
+-#
+-# texlive-pl
+-#
+-sub do_install_texlive_pl {
+- my ($texdir) = @_;
+- if (win32()) {
+- if (!defined($texdir)) {
+- tlwarn("do_install_texlive_pl: texdir not defined, returning\n");
+- return;
+- }
+- add_menu_shortcut(
+- $mainmenu,
+- 'TeX Live Manual (pl) (PDF)',
+- '', # default pdf icon
+- $texdir.'/texmf-doc/doc/polish/texlive-pl/texlive-pl.pdf',
+- '',
+- '',
+- );
+- add_menu_shortcut(
+- $mainmenu,
+- 'TeX Live Manual (pl) (HTML)',
+- '', # default pdf icon
+- $texdir.'/texmf-doc/doc/polish/texlive-pl/texlive-pl.html',
+- '',
+- '',
+- );
+- }
+-}
+-sub do_remove_texlive_pl {
+- my ($texdir) = @_;
+- if (win32()) {
+- remove_menu_shortcut($mainmenu,'TeX Live Manual (pl) (PDF)');
+- remove_menu_shortcut($mainmenu,'TeX Live Manual (pl) (HTML)');
+- }
+-}
+-$PostInstall{'texlive-pl'} = \&do_install_texlive_pl;
+-$PostRemove{'texlive-pl'} = \&do_remove_texlive_pl;
+-
+-#
+-# texlive-ru
+-#
+-sub do_install_texlive_ru {
+- my ($texdir) = @_;
+- if (win32()) {
+- if (!defined($texdir)) {
+- tlwarn("do_install_texlive_ru: texdir not defined, returning\n");
+- return;
+- }
+- add_menu_shortcut(
+- $mainmenu,
+- 'TeX Live Manual (ru) (PDF)',
+- '', # default pdf icon
+- $texdir.'/texmf-doc/doc/russian/texlive-ru/texlive-ru.pdf',
+- '',
+- '',
+- );
+- add_menu_shortcut(
+- $mainmenu,
+- 'TeX Live Manual (ru) (HTML)',
+- '', # default pdf icon
+- $texdir.'/texmf-doc/doc/russian/texlive-ru/texlive-ru.html',
+- '',
+- '',
+- );
+- }
+-}
+-sub do_remove_texlive_ru {
+- my ($texdir) = @_;
+- if (win32()) {
+- remove_menu_shortcut($mainmenu,'TeX Live Manual (ru) (HTML)');
+- remove_menu_shortcut($mainmenu,'TeX Live Manual (ru) (PDF)');
+- }
+-}
+-$PostInstall{'texlive-ru'} = \&do_install_texlive_ru;
+-$PostRemove{'texlive-ru'} = \&do_remove_texlive_ru;
+-
+-#
+-# texlive-zh-cn
+-#
+-sub do_install_texlive_zh_cn {
+- my ($texdir) = @_;
+- if (win32()) {
+- if (!defined($texdir)) {
+- tlwarn("do_install_texlive_zh_cn: texdir not defined, returning\n");
+- return;
+- }
+- add_menu_shortcut(
+- $mainmenu,
+- 'TeX Live Manual (zh-cn)',
+- '', # default pdf icon
+- $texdir.'/texmf-doc/doc/chinese/texlive-zh-cn/texlive-zh-cn.pdf',
+- '',
+- '',
+- );
+- }
+-}
+-sub do_remove_texlive_zh_cn {
+- my ($texdir) = @_;
+- if (win32()) {
+- remove_menu_shortcut($mainmenu,'TeX Live Manual (zh-cn)');
+- }
+-}
+-$PostInstall{'texlive-zh-cn'} = \&do_install_texlive_zh_cn;
+-$PostRemove{'texlive-zh-cn'} = \&do_remove_texlive_zh_cn;
+-
+-
+-#
+-# FROM HERE ON ONLY DISABLED POST INSTALL AND REMOVE ACTIONS!!!!!!!
+-#
+-
+-# disabled
+-sub do_bin_xdvi {
+- my ($TEXDIR, $TEXMFSYSVAR) = @_;
+- if (!defined($TEXMFSYSVAR)) {
+- $TEXMFSYSVAR = `kpsewhich -var-value=TEXMFSYSVAR`;
+- chomp($TEXMFSYSVAR);
+- }
+- copy ("$TEXDIR/texmf/xdvi/XDvi", "$TEXMFSYSVAR/xdvi");
+-}
+-# $PostInstall{"bin-xdvi"} = \&do_bin_xdvi;
+-
+-
+-# disabled
+-sub do_plain {
+- my ($TEXDIR, $TEXMFSYSVAR) = @_;
+- if (!defined($TEXMFSYSVAR)) {
+- $TEXMFSYSVAR = `kpsewhich -var-value=TEXMFSYSVAR`;
+- chomp($TEXMFSYSVAR);
+- }
+- # install some copies from texmf(-dist) into texmf-var
+- copy ("$TEXDIR/texmf-dist/tex/generic/config/language.def",
+- "$TEXMFSYSVAR/tex/generic/config");
+-}
+-# $PostInstall{"plain"} = \&do_plain;
+-
+-
+-# disabled
+-sub do_bin_dvipsk {
+- my ($TEXDIR, $TEXMFSYSVAR) = @_;
+- if (!defined($TEXMFSYSVAR)) {
+- $TEXMFSYSVAR = `kpsewhich -var-value=TEXMFSYSVAR`;
+- chomp($TEXMFSYSVAR);
+- }
+- # those files must exist
+- copy ("$TEXDIR/texmf/dvips/config/config.ps",
+- "$TEXMFSYSVAR/dvips/config");
+-}
+-# $PostInstall{"bin-dvipsk"} = \&do_bin_dvipsk;
+-
+-# disabled
+-sub do_bin_dvipdfm {
+- my ($TEXDIR, $TEXMFSYSVAR) = @_;
+- if (!defined($TEXMFSYSVAR)) {
+- $TEXMFSYSVAR = `kpsewhich -var-value=TEXMFSYSVAR`;
+- chomp($TEXMFSYSVAR);
+- }
+- # fix up dvipdfm config file to contain the right # piping command
+- mkdirhier("$TEXMFSYSVAR/dvipdfm/config");
+- open(DVIPDFMCONFIGDIST, "<$TEXDIR/texmf/dvipdfm/config/config")
+- or die("Cannot open $TEXDIR/texmf/dvipdfm/config/config");
+- open(DVIPDFMCONFIGINST, ">$TEXMFSYSVAR/dvipdfm/config/config")
+- or die("Cannot open $TEXMFSYSVAR/dvipdfm/config/config");
+- while (<DVIPDFMCONFIGDIST>) {
+- if (m/^D /) {
+- print DVIPDFMCONFIGINST 'D "epstopdf --outfile=%o --nocompress %i"', "\n";
+- } else {
+- print DVIPDFMCONFIGINST;
+- }
+- }
+- close(DVIPDFMCONFIGDIST);
+- close(DVIPDFMCONFIGINST);
+-}
+-# $PostInstall{"bin-dvipdfm"} = \&do_bin_dvipdfm;
+-
+-# disabled
+-sub do_bin_dvipdfmx {
+- my ($TEXDIR, $TEXMFSYSVAR) = @_;
+- if (!defined($TEXMFSYSVAR)) {
+- $TEXMFSYSVAR = `kpsewhich -var-value=TEXMFSYSVAR`;
+- chomp($TEXMFSYSVAR);
+- }
+- # dvipdfmx.cfg
+- open(DVIPDFMCONFIGDIST, "<$TEXDIR/texmf/dvipdfmx/dvipdfmx.cfg")
+- or die("Cannot open $TEXDIR/texmf/dvipdfmx/dvipdfmx.cfg");
+- open(DVIPDFMCONFIGINST, ">$TEXMFSYSVAR/dvipdfmx/dvipdfmx.cfg")
+- or die("Cannot open $TEXMFSYSVAR/dvipdfmx/dvipdfmx.cfg");
+- while (<DVIPDFMCONFIGDIST>) {
+- # current dvipdfmx.cfg already contains the right rungs incantation
+- # so do just copy the file to texmf-var
+- #if (m/^D /) {
+- # print DVIPDFMCONFIGINST "%$_";
+- # print DVIPDFMCONFIGINST "\n%% GhostScript (TeX Live (Unix and Win32)):\n";
+- # print DVIPDFMCONFIGINST 'D "rungs -q -dNOPAUSE -dBATCH -sPAPERSIZE=a0 -sDEVICE=pdfwrite -dCompatibilityLevel=1.3 -dAutoFilterGrayImages=false -dGrayImageFilter=/FlateEncode -dAutoFilterColorImages=false -dColorImageFilter=/FlateEncode -dUseFlateCompression=true -sOutputFile=%o %i -c quit"', "\n\n";
+- #} else {
+- print DVIPDFMCONFIGINST;
+- #}
+- }
+- close(DVIPDFMCONFIGDIST);
+- close(DVIPDFMCONFIGINST);
+-}
+-# $PostInstall{"bin-dvipdfmx"} = \&do_bin_dvipdfmx;
+-
+-
+-# disabled
+-sub do_bin_kpathsea {
+- my ($TEXDIR, $TEXMFSYSVAR) = @_;
+- if (!defined($TEXMFSYSVAR)) {
+- $TEXMFSYSVAR = `kpsewhich -var-value=TEXMFSYSVAR`;
+- chomp($TEXMFSYSVAR);
+- }
+- copy ("$TEXDIR/texmf/web2c/mktex.cnf",
+- "$TEXMFSYSVAR/web2c");
+-}
+-# $PostInstall{"bin-kpathsea"} = \&do_bin_kpathsea;
+-
+-# disabled
+-sub do_bin_pdftex {
+- my ($TEXDIR, $TEXMFSYSVAR) = @_;
+- if (!defined($TEXMFSYSVAR)) {
+- $TEXMFSYSVAR = `kpsewhich -var-value=TEXMFSYSVAR`;
+- chomp($TEXMFSYSVAR);
+- }
+- # the old installer copied from CDDIR, but shouldn't this be installed
+- # in ANY case since it is in bin-pdftex???
+- copy ("$TEXDIR/texmf/tex/generic/config/pdftexconfig.tex",
+- "$TEXMFSYSVAR/tex/generic/config");
+-}
+-# $PostInstall{"bin-pdftex"} = \&do_bin_pdftex;
+-
+-# disabled
+-sub do_context {
+- my ($TEXDIR, $TEXMFSYSVAR) = @_;
+- if (!defined($TEXMFSYSVAR)) {
+- $TEXMFSYSVAR = `kpsewhich -var-value=TEXMFSYSVAR`;
+- chomp($TEXMFSYSVAR);
+- }
+- # old installer did this, should we do this, TOO????
+- copy ("$TEXDIR/texmf-dist/tex/context/config/cont-usr.tex",
+- "$TEXMFSYSVAR/tex/context/config");
+-}
+-# $PostInstall{"context"} = \&do_context;
+-
+-
+ 1;
+
+
+Index: tlpkg/TeXLive/TLPSRC.pm
+===================================================================
+--- tlpkg/TeXLive/TLPSRC.pm (revision 12142)
++++ tlpkg/TeXLive/TLPSRC.pm (working copy)
+@@ -30,6 +30,7 @@
+ srcpatterns => $params{'srcpatterns'},
+ docpatterns => $params{'docpatterns'},
+ binpatterns => $params{'binpatterns'},
++ postactions => $params{'postactions'},
+ executes => defined($params{'executes'}) ? $params{'executes'} : [],
+ depends => defined($params{'depends'}) ? $params{'depends'} : [],
+ };
+@@ -67,6 +68,7 @@
+ my $catalogue = "";
+ my (@executes, @depends);
+ my (@runpatterns, @docpatterns, @binpatterns, @srcpatterns);
++ my (@postactions);
+ my $started = 0;
+ my $finished = 0;
+ my $savedline = "";
+@@ -132,6 +134,9 @@
+ } elsif ($line =~ /^depend\s+(.*)\s*$/) {
+ push @depends, $1 if ($1 ne "");
+ next;
++ } elsif ($line =~ /^postaction\s+(.*)\s*$/) {
++ push @postactions, $1 if ($1 ne "");
++ next;
+ } else {
+ tlwarn("$srcfile:$.: unknown tlpsrc directive, please fix: $line\n");
+ }
+@@ -149,6 +154,7 @@
+ $self->docpatterns(@docpatterns) if @docpatterns;
+ $self->executes(@executes) if @executes;
+ $self->depends(@depends) if @depends;
++ $self->postactions(@postactions) if @postactions;
+ }
+
+
+@@ -175,6 +181,11 @@
+ print $fd "execute $_\n";
+ }
+ }
++ if (defined($self->{'postactions'})) {
++ foreach (@{$self->{'postactions'}}) {
++ print $fd "postaction $_\n";
++ }
++ }
+ if (defined($self->{'srcpatterns'}) && (@{$self->{'srcpatterns'}})) {
+ foreach (sort @{$self->{'srcpatterns'}}) {
+ print $fd "srcpattern $_\n";
+@@ -213,6 +224,7 @@
+ $tlp->longdesc($self->{'longdesc'}) if (defined($self->{'longdesc'}));
+ $tlp->catalogue($self->{'catalogue'}) if (defined($self->{'catalogue'}));
+ $tlp->executes(@{$self->{'executes'}}) if (defined($self->{'executes'}));
++ $tlp->postactions(@{$self->{'postactions'}}) if (defined($self->{'postactions'}));
+ $tlp->depends(@{$self->{'depends'}}) if (defined($self->{'depends'}));
+ $tlp->revision(0);
+ my $filemax;
+@@ -540,6 +552,11 @@
+ if (@_) { @{ $self->{'executes'} } = @_ }
+ return @{ $self->{'executes'} };
+ }
++sub postactions {
++ my $self = shift;
++ if (@_) { @{ $self->{'postactions'} } = @_ }
++ return @{ $self->{'postactions'} };
++}
+
+ format multilineformat =
+ longdesc ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<~~
+@@ -580,7 +597,7 @@
+
+ where I<key> can be C<name>, C<category>, C<shortdesc>, C<longdesc>,
+ C<catalogue>, C<runpattern>, C<srcpattern>, C<docpattern>, C<binpattern>,
+-C<execute>, or C<depend>.
++C<execute>, C<postaction>, or C<depend>.
+
+ Continuation lines are supported via a trailing backslash. That is, if
+ the C<.tlpsrc> file contains two physical lines like this:
+@@ -737,12 +754,49 @@
+ C<lefthyphenmin>, C<righthyphenmin> (both integers), and C<synonyms> (a
+ comma-separated list of alias names for that hyphenation).
+
+-=item C<execute BuildFormat> I<format>
++=item C<execute AddFormat name=I<fmt> engine=I<eng> [I<var>...]>
+
+-build the format I<format>, as specified in the C<fmtutil.cnf> file.
++activates the format with name I<fmt> based on the engine I<eng>. The
++additional variables I<var> are:
++C<mode> which can only be equal to C<disable> in which case the format
++will only be mentioned but disabled (prefixed with C<#!>;
++C<patterns> which gives the patterns file, if not present C<-> is used;
++C<options> which gives the additional options for the C<fmtutil.cnf> file.
+
+ =back
+
++=item <postaction>
++
++gives a free from entry of post install and removal actions to be
++executed. The difference to the C<execute> statement is that
++C<postaction> is concerned with system integration, i.e., adjusting
++things outside the installation directory, while C<execute> touches
++only things within the installation.
++
++Currently the following C<postaction>s are understood:
++
++=over 4
++
++=item C<postaction shortcut name=I<name> type=menu|desktop icon=I<path> cmd=I<cmd> args=I<args> hide=0|1>
++
++On W32 creates a shortcut either in the main TeX Live menu or on the
++desktop. Please see the documentation of TeXLive::TLWinGoo for details
++on the parameters.
++
++=item C<postaction filetype name=I<name> cmd=I<cmd>>
++
++On W32 associates the file type I<name> with the command I<cmd>.
++
++=item C<postaction fileassoc extension=I<.ext> filetype=I<name>>
++
++On W32 declares files with the extenstion I<.ext> of file type I<name>.
++
++=item C<postaction code I<arg>>
++
++TODO TODO I don't know how we want to do that
++
++=back
++
+ =item C<(src|run|doc|bin)pattern> I<pattern>
+
+ adds a pattern (next section) to the respective list of patterns.
+Index: tlpkg/TeXLive/TLPOBJ.pm
+===================================================================
+--- tlpkg/TeXLive/TLPOBJ.pm (revision 12142)
++++ tlpkg/TeXLive/TLPOBJ.pm (working copy)
+@@ -29,6 +29,7 @@
+ docfiles => defined($params{'docfiles'}) ? $params{'docfiles'} : [],
+ docsize => $params{'docsize'},
+ executes => defined($params{'executes'}) ? $params{'executes'} : [],
++ postactions => defined($params{'postactions'}) ? $params{'postactions'} : [],
+ # note that binfiles is a HASH with keys of $arch!
+ binfiles => defined($params{'binfiles'}) ? $params{'binfiles'} : {},
+ binsize => defined($params{'binsize'}) ? $params{'binsize'} : {},
+@@ -92,6 +93,7 @@
+ ($lastcmd eq "docfiles") ||
+ ($lastcmd eq "srcfiles") ||
+ ($lastcmd eq "executes") ||
++ ($lastcmd eq "postaction") ||
+ ($lastcmd eq "depend") ) {
+ $line =~ s/^ /${lastcmd}continued /;
+ } else {
+@@ -216,6 +218,10 @@
+ push @{$self->{'executes'}}, "$2" unless "$2" eq "";
+ $lastcmd = "execute";
+ next;
++ } elsif ($line =~ /^postaction(continued)?\s*(.*)\s*/o) {
++ push @{$self->{'postactions'}}, "$2" unless "$2" eq "";
++ $lastcmd = "postaction";
++ next;
+ } elsif ($line =~ /^depend(continued)?\s*(.*)\s*/o) {
+ push @{$self->{'depends'}}, "$2" unless "$2" eq "";
+ $lastcmd = "depend";
+@@ -316,6 +322,11 @@
+ print $fd "execute $_\n";
+ }
+ }
++ if (defined($self->{'postactions'})) {
++ foreach (@{$self->{'postactions'}}) {
++ print $fd "postaction $_\n";
++ }
++ }
+ if (defined($self->{'containersize'})) {
+ print $fd "containersize $self->{'containersize'}\n";
+ }
+@@ -388,6 +399,11 @@
+ print $fd "execute $_\n";
+ }
+ }
++ if (defined($self->{'postactions'})) {
++ foreach (@{$self->{'postactions'}}) {
++ print $fd "postaction $_\n";
++ }
++ }
+ if (defined($self->{'docfiles'}) && (@{$self->{'docfiles'}})) {
+ print $fd "docfiles\n";
+ foreach (sort @{$self->{'docfiles'}}) {
+@@ -837,7 +853,7 @@
+ } else {
+ push @maps, "disable $3";
+ }
+- } elsif ($e =~ m/^BuildFormat\s+([^\s]+)\s*$/) {
++ } elsif ($e =~ m/^AddFormat\s+([^\s]+)\s*$/) {
+ push @formats, $1;
+ } elsif ($e =~ m/^AddHyphen\s+(.*)\s*$/) {
+ push @dats, $1;
+@@ -1026,6 +1042,11 @@
+ if (@_) { $self->{'executes'} = [ @_ ] }
+ return @{ $self->{'executes'} };
+ }
++sub postactions {
++ my $self = shift;
++ if (@_) { $self->{'postactions'} = [ @_ ] }
++ return @{ $self->{'postactions'} };
++}
+ sub containerdir {
+ my @self = shift;
+ if (@_) { $_containerdir = $_[0] }
+Index: tlpkg/TeXLive/TLMedia.pm
+===================================================================
+--- tlpkg/TeXLive/TLMedia.pm (revision 12142)
++++ tlpkg/TeXLive/TLMedia.pm (working copy)
+@@ -208,6 +208,9 @@
+ info("running post install action for $pkg\n");
+ &{$PostInstall{$pkg}}($totlpdb->root);
+ }
++ #
++ # Run the post installation code in the postaction tlpsrc entries
++ &TeXLive::TLUtils::do_postaction_code("install", $tlpobj);
+ }
+ return \%ret;
+ }
+Index: tlpkg/TeXLive/TLUtils.pm
+===================================================================
+--- tlpkg/TeXLive/TLUtils.pm (revision 12142)
++++ tlpkg/TeXLive/TLUtils.pm (working copy)
+@@ -56,6 +56,7 @@
+ TeXLive::TLUtils::create_language_def($tlpdb,$dest,$localconf);
+ TeXLive::TLUtils::install_packages($from_tlpdb,$media,$to_tlpdb,$what,$opt_src, $opt_doc)>);
+ TeXLive::TLUtils::install_package($what, $filelistref, $target, $platform);
++ TeXLive::TLUtils::do_postaction_code($how, $tlpobj);
+
+ =head2 Miscellaneous
+
+@@ -1224,7 +1225,111 @@
+ return 1;
+ }
+
++=item C<do_postaction_code($how, $tlpobj)>
+
++Evaluates the C<postaction> code in the C<$tlpobj>
++MISSING DOCUMENTATION TODO TODO
++
++Returns 1 on success, and 0 on failure.
++
++=cut
++
++sub do_postaction_code {
++ my ($how, $tlpobj) = @_;
++ my $ret = 1;
++ if (!defined($tlpobj)) {
++ tlwarn("do_postaction_code: didn't get a tlpobj\n");
++ return 0;
++ }
++ debug("running postaction $how code for " . $tlpobj->name . "\n")
++ if $tlpobj->postactions;
++ for my $pa ($tlpobj->postactions) {
++ if ($pa =~ m/^\s*shortcut\s+(.*)\s*$/) {
++ $ret &&= _do_postaction_shortcut($how, $tlpobj, $1);
++ } elsif ($pa =~ m/\s*filetype\s+(.*)\s*$/) {
++ $ret &&= _do_postaction_filetype($how, $tlpobj, $1);
++ } elsif ($pa =~ m/\s*fileassoc\s+(.*)\s*$/) {
++ $ret &&= _do_postaction_fileassoc($how, $tlpobj, $1);
++ } elsif ($pa =~ m/\s*code\s+(.*)\s*$/) {
++ $ret &&= _do_postaction_code($how, $tlpobj, $1);
++ } else {
++ tlwarn("do_postaction_code: don't know how to do $pa\n");
++ $ret = 0;
++ }
++ }
++ # nothing to do
++ return $ret;
++}
++
++sub _do_postaction_shortcut {
++ my ($how, $tlpobj, $pa) = @_;
++ return 1 unless win32();
++ my @words = quotewords('\s+', 0, "$pa");
++ my $type;
++ my $icon = '';
++ my $cmd = '';
++ my $args = '';
++ my $name;
++ my $hide = '0';
++ while (@words) {
++ $_ = shift @words;
++ if (/^type=(.*)$/) {
++ $type = $1;
++ if (($type ne "menu") && ($type ne "desktop")) {
++ tlwarn("type of shortcut postaction $type is unknown (menu, desktop)\n");
++ return 0;
++ }
++ } elsif (/^name=(.*)$/) {
++ $name = $1;
++ } elsif (/^icon=(.*)$/) {
++ $icon = $1;
++ } elsif (/^cmd=(.*)$/) {
++ $cmd = $1;
++ } elsif (/^args=(.*)$/) {
++ $args = $1;
++ } elsif (/^hide=(.*)$/) {
++ $hide = $1;
++ if (($hide ne "0") && ($hide ne "1")) {
++ tlwarn("hide of shortcut postaction $hide is unknown (0, 1)\n");
++ return 0;
++ }
++ } else {
++ tlwarn("Unknown tag for postaction shortcut $pa: $_\n");
++ return 0;
++ }
++ }
++ if ($how eq "install") {
++ my $texdir = `kpsewhich -var-value=SELFAUTOPARENT`;
++ chomp($texdir);
++ my $texdir_bsl = conv_to_w32_path($texdir);
++ $icon =~ s!^TEXDIR/!$texdir/!;
++ $args =~ s!^TEXDIR/!$texdir/!;
++ $args = conv_to_w32_path($args);
++ if ($type eq "menu") {
++ add_menu_shortcut($TeXLive::TLConfig::WindowsMainMenuName,
++ $name, $icon, $cmd, $args, $hide);
++ } elsif ($type eq "desktop") {
++ add_desktop_shortcut($name, $icon, $cmd, $args, $hide);
++ } else {
++ tlwarn("Unknown type of shortcut: $type\n");
++ return 0;
++ }
++ } elsif ($how eq "remove") {
++ if ($type eq "menu") {
++ remove_menu_shortcut($TeXLive::TLConfig::WindowsMainMenuName, $name);
++ } elsif ($type eq "desktop") {
++ remove_desktop_shortcut($name);
++ } else {
++ tlwarn("Unknown type of shortcut: $type\n");
++ return 0;
++ }
++ } else {
++ tlwarn("Unknown mode $how\n");
++ return 0;
++ }
++ return 1;
++}
++
+ =item C<untar($tarfile,$targetdir, $remove_tarfile)>
+
+ Unpacked C<$tarfile> in C<$targetdir> (changing directories to
+Index: tlpkg/TeXLive/TLWinGoo.pm
+===================================================================
+--- tlpkg/TeXLive/TLWinGoo.pm (revision 12142)
++++ tlpkg/TeXLive/TLWinGoo.pm (working copy)
+@@ -58,7 +58,6 @@
+ $prog, $args, $batgui);
+ TeXLive::TLWinGoo::add_menu_shortcut($place, $name, $icon,
+ $prog, $args, $batgui);
+- TeXLive::TLWinGoo::init_unshortbat($texdir);
+ TeXLive::TLWinGoo::remove_desktop_shortcut($name);
+ TeXLive::TLWinGoo::remove_menu_shortcut($place, $name);
+
+@@ -104,7 +103,6 @@
+ &add_menu_shortcut
+ &remove_desktop_shortcut
+ &remove_menu_shortcut
+- &init_unshortbat
+ &create_uninstaller
+ &unregister_uninstaller
+ );
+@@ -862,8 +860,7 @@
+
+ =pod
+
+-=item C<add_desktop_shortcut($texdir, $name, $icon,
+- $prog, $args, $batgui)>
++=item C<add_desktop_shortcut($name, $icon, $prog, $args, $batgui)>
+
+ Add a desktop shortcut, with name $name and icon $icon, pointing to
+ program $prog with parameters $args (a string). Use a non-null
+@@ -871,14 +868,10 @@
+ batchfile. Then the inevitable command prompt will be hidden
+ rightaway, leaving only the gui program visible.
+
+-The parameter $texdir is merely used to locate the batchfile
+-unshort.bat for uninstalling desktop shortcuts, which needs to be
+-updated.
+-
+ =cut
+
+ sub add_desktop_shortcut {
+- my ($texdir, $name, $icon, $prog, $args, $batgui) = @_;
++ my ($name, $icon, $prog, $args, $batgui) = @_;
+
+ # create shortcut
+ my ($shc, $shpath, $shfile);
+@@ -889,15 +882,6 @@
+ $shc->{'ShowCmd'} = $batgui ? SW_SHOWMINNOACTIVE : SW_SHOWNORMAL;
+ $shfile = desktop_path().'/'.$name.'.lnk';
+ $shc->Save($shfile);
+-
+- # update batchfile for uninstalling shortcuts
+- if (open UNSHORT, ">>$texdir/tlpkg/installer/unshort.bat") {
+- $shfile =~ s!/!\\!g;
+- print UNSHORT 'del "'.$shfile."\" 2>nul\n";
+- close UNSHORT;
+- } else {
+- warn "Cannot open $texdir/tlpkg/installer/unshort.bat for appending: $!";
+- }
+ }
+
+ =pod
+@@ -937,39 +921,16 @@
+
+ =pod
+
+-=item C<init_unshortbat($texdir)>
+-
+-Reinitialize unshort.bat, the shortcuts uninstaller.
+-
+-=cut
+-
+-sub init_unshortbat {
+- my $texdirw = shift;
+- my $menupath = menu_path();
+- $menupath =~ s!/!\\!g;
+-
+- # batchfile for uninstalling shortcuts
+- if (open UNSHORT, ">$texdirw/tlpkg/installer/unshort.bat") {
+- print UNSHORT 'rmdir /s /q "'.$menupath."\\TeX Live 2008\" 2>nul\n";
+- close UNSHORT;
+- } else {
+- warn "Cannot create $texdirw/tlpkg/installer/unshort.bat: $!";
+- }
+-}
+-
+-=pod
+-
+ =item C<remove_desktop_shortcut($name)>
+
+-For uninstallation of an individual package. We leave unshort.bat
+-alone because redundant entries are no big deal.
++For uninstallation of an individual package.
+
+ =cut
+
+ sub remove_desktop_shortcut {
+ my $name = shift;
+ unlink desktop_path().'/'.$name.'.lnk';
+-}
++}
+
+ =pod
+
+@@ -1040,7 +1001,6 @@
+ set PERL5LIB=
+ \"$td\\tlpkg\\tlperl\\bin\\perl.exe\" \"$td\\texmf\\scripts\\texlive\\uninstall-win32.pl\"
+ if errorlevel 1 exit
+-call \"$tdw\\tlpkg\\installer\\unshort.bat\"
+ copy \"$tdw\\tlpkg\\installer\\uninst2.bat\" \"\%TEMP\%\"
+ rem pause
+ \"\%TEMP\%\\uninst2.bat\"
+Index: tlpkg/tlpsrc/bin-tex.tlpsrc
+===================================================================
+--- tlpkg/tlpsrc/bin-tex.tlpsrc (revision 12142)
++++ tlpkg/tlpsrc/bin-tex.tlpsrc (working copy)
+@@ -1,7 +1,6 @@
+ name bin-tex
+ category TLCore
+ depend bin-kpathsea
+-execute BuildFormat tex
+-runpattern f texmf/fmtutil/format.tex.cnf
++execute AddFormat name=tex engine=tex options="tex.ini"
+ docpattern f texmf/doc/man/man1/tex.*
+ binpattern f bin/${ARCH}/tex
+Index: tlpkg/tlpsrc/bin-mex.tlpsrc
+===================================================================
+--- tlpkg/tlpsrc/bin-mex.tlpsrc (revision 12142)
++++ tlpkg/tlpsrc/bin-mex.tlpsrc (working copy)
+@@ -2,10 +2,9 @@
+ category TLCore
+ depend pdftex
+ depend bin-tex
+-execute BuildFormat mex
+-execute BuildFormat utf8mex
+-runpattern f texmf/fmtutil/format.mex.cnf
+-runpattern f texmf/fmtutil/format.utf8mex.cnf
++execute AddFormat name=mex engine=pdftex patterns=mexconf.tex options="-translate-file=cp227.tcx *mex.ini"
++execute AddFormat name=pdfmex engine=pdftex patterns=mexconf.tex options="-translate-file=cp227.tcx *pdfmex.ini"
++execute AddFormat name=utf8mex engine=pdftex patterns=mexconf.tex options="-enc *utf8mex.ini"
+ binpattern f bin/${ARCH}/mex
+ binpattern f bin/${ARCH}/pdfmex
+ binpattern f bin/${ARCH}/utf8mex
+Index: tlpkg/tlpsrc/texlive-de.tlpsrc
+===================================================================
+--- tlpkg/tlpsrc/texlive-de.tlpsrc (revision 12142)
++++ tlpkg/tlpsrc/texlive-de.tlpsrc (working copy)
+@@ -1,2 +1,4 @@
+ name texlive-de
+ category Documentation
++postaction shortcut type=menu name="TeX Live Manual (de) (PDF)" cmd=TEXDIR/texmf-doc/doc/german/texlive-de/texlive-de.pdf
++postaction shortcut type=menu name="TeX Live Manual (de) (HTML)" cmd=TEXDIR/texmf-doc/doc/german/texlive-de/texlive-de.html
+Index: tlpkg/tlpsrc/pdftex.tlpsrc
+===================================================================
+--- tlpkg/tlpsrc/pdftex.tlpsrc (revision 12142)
++++ tlpkg/tlpsrc/pdftex.tlpsrc (working copy)
+@@ -1,8 +1,9 @@
+ name pdftex
+ category TLCore
+ depend bin-kpathsea
+-execute BuildFormat pdftex
+-runpattern f texmf/fmtutil/format.pdftex.cnf
++execute AddFormat name=etex engine=pdftex patterns=language.def options="-translate-file=cp227.tcx *etex.ini"
++execute AddFormat name=pdfetex engine=pdftex patterns=language.def options="-translate-file=cp227.tcx *pdfetex.ini"
++execute AddFormat name=pdftex engine=pdftex patterns=language.def options="-translate-file=cp227.tcx *pdfetex.ini"
+ runpattern f texmf/fonts/map/pdftex/updmap/*
+ runpattern f texmf/tex/generic/config/pdftex*.tex
+ runpattern f texmf/tex/generic/pdftex/*
+Index: tlpkg/tlpsrc/bin-csplain.tlpsrc
+===================================================================
+--- tlpkg/tlpsrc/bin-csplain.tlpsrc (revision 12142)
++++ tlpkg/tlpsrc/bin-csplain.tlpsrc (working copy)
+@@ -1,7 +1,7 @@
+ name bin-csplain
+ category TLCore
+ depend bin-tex
+-execute BuildFormat csplain
+-runpattern f texmf/fmtutil/format.csplain.cnf
++execute AddFormat name=csplain engine=pdftex options="-etex -translate-file=cp227.tcx csplain.ini"
++execute AddFormat name=pdfcsplain engine=pdftex options="-etex -translate-file=cp227.tcx csplain.ini"
+ binpattern f bin/${ARCH}/csplain
+ binpattern f bin/${ARCH}/pdfcsplain
+Index: tlpkg/tlpsrc/bin-metapost.tlpsrc
+===================================================================
+--- tlpkg/tlpsrc/bin-metapost.tlpsrc (revision 12142)
++++ tlpkg/tlpsrc/bin-metapost.tlpsrc (working copy)
+@@ -1,8 +1,8 @@
+ name bin-metapost
+ category TLCore
+ depend bin-kpathsea
+-execute BuildFormat metapost
+-runpattern f texmf/fmtutil/format.metapost.cnf
++execute AddFormat name=mpost engine=mpost options="-translate-file=cp227.tcx mpost.mp"
++execute AddFormat name=mfplain engine=mpost options="-translate-file=cp227.tcx mfplain.ini"
+ docpattern f texmf/doc/man/man1/dmp.*
+ docpattern f texmf/doc/man/man1/dvitomp.*
+ docpattern f texmf/doc/man/man1/makempx.*
+Index: tlpkg/tlpsrc/texlive-fr.tlpsrc
+===================================================================
+--- tlpkg/tlpsrc/texlive-fr.tlpsrc (revision 12142)
++++ tlpkg/tlpsrc/texlive-fr.tlpsrc (working copy)
+@@ -1,2 +1,4 @@
+ name texlive-fr
+ category Documentation
++postaction shortcut type=menu name="TeX Live Manual (fr) (PDF)" cmd=TEXDIR/texmf-doc/doc/french/texlive-fr/texlive-fr.pdf
++postaction shortcut type=menu name="TeX Live Manual (fr) (HTML)" cmd=TEXDIR/texmf-doc/doc/french/texlive-fr/texlive-fr.html
+Index: tlpkg/tlpsrc/texlive-zh-cn.tlpsrc
+===================================================================
+--- tlpkg/tlpsrc/texlive-zh-cn.tlpsrc (revision 12142)
++++ tlpkg/tlpsrc/texlive-zh-cn.tlpsrc (working copy)
+@@ -1,2 +1,3 @@
+ name texlive-zh-cn
+ category Documentation
++postaction shortcut type=menu name="TeX Live Manual (zh-cn) (PDF)" cmd=TEXDIR/texmf-doc/doc/chinese/texlive-zh-cn/texlive-zh-cn.pdf
+Index: tlpkg/tlpsrc/bin-dviout.win32.tlpsrc
+===================================================================
+--- tlpkg/tlpsrc/bin-dviout.win32.tlpsrc (revision 12142)
++++ tlpkg/tlpsrc/bin-dviout.win32.tlpsrc (working copy)
+@@ -2,3 +2,4 @@
+ category TLCore
+ binpattern d/win32 tlpkg/dviout
+ binpattern f bin/win32/dviout.vbs
++postaction shortcut type=menu name="DVIOUT Dvi Viewer" cmd=wscript args=TEXDIR/bin/win32/dviout.vbs hide=1
+Index: tlpkg/tlpsrc/bin-context.tlpsrc
+===================================================================
+--- tlpkg/tlpsrc/bin-context.tlpsrc (revision 12142)
++++ tlpkg/tlpsrc/bin-context.tlpsrc (working copy)
+@@ -1,9 +1,15 @@
+ name bin-context
+ category TLCore
+ depend pdftex
+-execute BuildFormat context
++execute AddFormat name=cont-en engine=pdftex patterns=cont-usr.tex options="-8bit *cont-en.ini"
++execute AddFormat name=cont-cz mode=disabled engine=pdftex patterns=cont-usr.tex options="-8bit *cont-cz.ini"
++execute AddFormat name=cont-de mode=disabled engine=pdftex patterns=cont-usr.tex options="-8bit *cont-de.ini"
++execute AddFormat name=cont-nl mode=disabled engine=pdftex patterns=cont-usr.tex options="-8bit *cont-nl.ini"
++execute AddFormat name=cont-uk mode=disabled engine=pdftex patterns=cont-usr.tex options="-8bit *cont-uk.ini"
++execute AddFormat name=cont-en engine=xetex patterns=cont-usr.tex options="-8bit *cont-en.ini"
++execute AddFormat name=mptopdf engine=pdftex options="-translate-file=cp227.tcx mptopdf.tex"
++execute AddFormat name=metafun engine=mpost options="-translate-file=cp227.tcx metafun.mp"
+ runpattern f texmf-dist/tex/mptopdf/config/mptopdf.ini
+-runpattern f texmf/fmtutil/format.context.cnf
+ docpattern f texmf/doc/man/man1/ctxtools.*
+ docpattern f texmf/doc/man/man1/makempy.*
+ docpattern f texmf/doc/man/man1/mptopdf.*
+Index: tlpkg/tlpsrc/bin-mltex.tlpsrc
+===================================================================
+--- tlpkg/tlpsrc/bin-mltex.tlpsrc (revision 12142)
++++ tlpkg/tlpsrc/bin-mltex.tlpsrc (working copy)
+@@ -1,7 +1,7 @@
+ name bin-mltex
+ category TLCore
+ depend bin-latex
+-execute BuildFormat mltex
+-runpattern f texmf/fmtutil/format.mltex.cnf
++execute AddFormat name=mltex engine=pdftex options="-translate-file=cp227.tcx -mltex mltex.ini"
++execute AddFormat name=mllatex engine=pdftex patterns=language.dat options="-translate-file=cp227.tcx -mltex mllatex.ini"
+ binpattern f bin/${ARCH}/mllatex
+ binpattern f bin/${ARCH}/mltex
+Index: tlpkg/tlpsrc/luatex.tlpsrc
+===================================================================
+--- tlpkg/tlpsrc/luatex.tlpsrc (revision 12142)
++++ tlpkg/tlpsrc/luatex.tlpsrc (working copy)
+@@ -1,8 +1,8 @@
+ name luatex
+ category TLCore
+-execute BuildFormat luatex
++execute AddFormat name=luatex engine=luatex options="luatex.ini"
++execute AddFormat name=pdfluatex engine=luatex options="pdfluatex.ini"
+ docpattern d texmf-dist/doc/luatex
+-runpattern f texmf/fmtutil/format.luatex.cnf
+ binpattern f/!hppa-hpux bin/${ARCH}/luatex
+ binpattern f/!hppa-hpux bin/${ARCH}/pdfluatex
+ binpattern f/!hppa-hpux bin/${ARCH}/texlua
+Index: tlpkg/tlpsrc/bin-cslatex.tlpsrc
+===================================================================
+--- tlpkg/tlpsrc/bin-cslatex.tlpsrc (revision 12142)
++++ tlpkg/tlpsrc/bin-cslatex.tlpsrc (working copy)
+@@ -1,7 +1,7 @@
+ name bin-cslatex
+ category TLCore
+ depend bin-latex
+-execute BuildFormat cslatex
+-runpattern f texmf/fmtutil/format.cslatex.cnf
++execute AddFormat name=cslatex engine=pdftex options="-etex -translate-file=cp227.tcx cslatex.ini"
++execute AddFormat name=pdfcslatex engine=pdftex options="-etex -translate-file=cp227.tcx cslatex.ini"
+ binpattern f bin/${ARCH}/cslatex
+ binpattern f bin/${ARCH}/pdfcslatex
+Index: tlpkg/tlpsrc/bin-texdoc.tlpsrc
+===================================================================
+--- tlpkg/tlpsrc/bin-texdoc.tlpsrc (revision 12142)
++++ tlpkg/tlpsrc/bin-texdoc.tlpsrc (working copy)
+@@ -12,3 +12,4 @@
+ binpattern f bin/${ARCH}/texdoctk
+ binpattern f bin/win32/texdocc
+ binpattern f bin/win32/tl-w32-texdoc-wrapper.texlua
++postaction shortcut type=menu name="TeXdoc GUI" cmd="TEXDIR/bin/win32/texdoctk.bat" hide=1
+Index: tlpkg/tlpsrc/bin-latex.tlpsrc
+===================================================================
+--- tlpkg/tlpsrc/bin-latex.tlpsrc (revision 12142)
++++ tlpkg/tlpsrc/bin-latex.tlpsrc (working copy)
+@@ -4,12 +4,14 @@
+ depend pdftex
+ depend latexconfig
+ depend latex-fonts
+-execute BuildFormat latex
++execute AddFormat name=latex engine=pdftex patterns=language.dat options="-translate-file=cp227.tcx *latex.ini"
++execute AddFormat name=pdflatex engine=pdftex patterns=language.dat options="-translate-file=cp227.tcx *pdflatex.ini"
++execute AddFormat name=lualatex engine=luatex patterns=language.dat options="lualatex.ini"
++execute AddFormat name=pdflualatex engine=luatex patterns=language.dat options="pdflualatex.ini"
+ binpattern f bin/${ARCH}/latex
+ binpattern f/!hppa-hpux bin/${ARCH}/lualatex
+ binpattern f bin/${ARCH}/pdflatex
+ binpattern f/!hppa-hpux bin/${ARCH}/pdflualatex
+ docpattern f texmf/doc/man/man1/latex.*
+ docpattern f texmf/doc/man/man1/pdflatex.*
+-runpattern f texmf/fmtutil/format.latex.cnf
+ runpattern d texmf/tex/latex/config
+Index: tlpkg/tlpsrc/bin-omega.tlpsrc
+===================================================================
+--- tlpkg/tlpsrc/bin-omega.tlpsrc (revision 12142)
++++ tlpkg/tlpsrc/bin-omega.tlpsrc (working copy)
+@@ -1,7 +1,7 @@
+ name bin-omega
+ category TLCore
+-execute BuildFormat omega
+-runpattern f texmf/fmtutil/format.omega.cnf
++execute AddFormat name=omega engine=omega options="omega.ini"
++execute AddFormat name=lambda engine=omega patterns=language.dat options="lambda.ini"
+ docpattern f texmf/doc/man/man1/lambda.*
+ docpattern f texmf/doc/man/man1/omega.*
+ binpattern f bin/${ARCH}/lambda
+Index: tlpkg/tlpsrc/bin-tlpsv.win32.tlpsrc
+===================================================================
+--- tlpkg/tlpsrc/bin-tlpsv.win32.tlpsrc (revision 12142)
++++ tlpkg/tlpsrc/bin-tlpsv.win32.tlpsrc (working copy)
+@@ -5,3 +5,5 @@
+ runpattern f bin/win32/psv.bat
+ runpattern f texmf/scripts/texlive/psv.tlu
+ runpattern d tlpkg/tlpsv
++postaction shortcut type=menu name="PS_View" icon=TEXDIR/tlpkg/tlpsv/psv.exe cmd=TEXDIR/bin/win32/psv.bat hide=1
++postaction shortcut type=desktop name="PS_View" icon=TEXDIR/tlpkg/tlpsv/psv.exe cmd=TEXDIR/bin/win32/psv.bat hide=1
+Index: tlpkg/tlpsrc/bin-xmltex.tlpsrc
+===================================================================
+--- tlpkg/tlpsrc/bin-xmltex.tlpsrc (revision 12142)
++++ tlpkg/tlpsrc/bin-xmltex.tlpsrc (working copy)
+@@ -2,7 +2,7 @@
+ category TLCore
+ depend pdftex
+ depend bin-tex
+-execute BuildFormat xmltex
+-runpattern f texmf/fmtutil/format.xmltex.cnf
++execute AddFormat name=xmltex engine=pdftex patterns=language.dat options="&latex xmltex.ini"
++execute AddFormat name=pdfxmltex engine=pdftex patterns=language.dat options="&pdflatex pdfxmltex.ini"
+ binpattern f bin/${ARCH}/pdfxmltex
+ binpattern f bin/${ARCH}/xmltex
+Index: tlpkg/tlpsrc/texlive-ru.tlpsrc
+===================================================================
+--- tlpkg/tlpsrc/texlive-ru.tlpsrc (revision 12142)
++++ tlpkg/tlpsrc/texlive-ru.tlpsrc (working copy)
+@@ -1,2 +1,4 @@
+ name texlive-ru
+ category Documentation
++postaction shortcut type=menu name="TeX Live Manual (ru) (PDF)" cmd=TEXDIR/texmf-doc/doc/russian/texlive-ru/texlive-ru.pdf
++postaction shortcut type=menu name="TeX Live Manual (ru) (HTML)" cmd=TEXDIR/texmf-doc/doc/russian/texlive-ru/texlive-ru.html
+Index: tlpkg/tlpsrc/bin-texlive.tlpsrc
+===================================================================
+--- tlpkg/tlpsrc/bin-texlive.tlpsrc (revision 12142)
++++ tlpkg/tlpsrc/bin-texlive.tlpsrc (working copy)
+@@ -25,3 +25,5 @@
+ binpattern f bin/win32/tl-w32-wrapper.texlua
+ binpattern f bin/win32/symlinks4cygwin.sh
+ binpattern f/win32 texmf/scripts/texlive/w32_updater.bat
++postaction shortcut type=menu name="TeX Live Manager" cmd=TEXDIR/bin/win32/tlmgr.bat args=gui hide=1
++postaction shortcut type=menu name="Release notes" cmd="http://tug.org/texlive/windows.html"
+Index: tlpkg/tlpsrc/t2.tlpsrc
+===================================================================
+--- tlpkg/tlpsrc/t2.tlpsrc (revision 12142)
++++ tlpkg/tlpsrc/t2.tlpsrc (working copy)
+@@ -1,5 +1,5 @@
+ name t2
+ category Package
+-execute BuildFormat cyramstex
+-execute BuildFormat cyrtex
+-execute BuildFormat cyrtexinfo
++execute AddFormat name=cyramstex mode=disabled engine=pdftex patterns=language.dat options="-translate-file=cp227.tcx *cyramstx.ini"
++execute AddFormat name=cyrtex mode=disabled engine=pdftex patterns=language.dat options="-translate-file=cp227.tcx *cyrtex.ini"
++execute AddFormat name=cyrtexinfo mode=disabled engine=pdftex patterns=language.dat options="-translate-file=cp227.tcx *cyrtxinf.ini"
+Index: tlpkg/tlpsrc/bin-texsis.tlpsrc
+===================================================================
+--- tlpkg/tlpsrc/bin-texsis.tlpsrc (revision 12142)
++++ tlpkg/tlpsrc/bin-texsis.tlpsrc (working copy)
+@@ -1,6 +1,5 @@
+ name bin-texsis
+ category TLCore
+ depend bin-tex
+-execute BuildFormat texsis
+-runpattern f texmf/fmtutil/format.texsis.cnf
++execute AddFormat name=texsis engine=pdftex options="-translate-file=cp227.tcx texsis.ini"
+ binpattern f bin/${ARCH}/texsis
+Index: tlpkg/tlpsrc/texlive-en.tlpsrc
+===================================================================
+--- tlpkg/tlpsrc/texlive-en.tlpsrc (revision 12142)
++++ tlpkg/tlpsrc/texlive-en.tlpsrc (working copy)
+@@ -1,2 +1,4 @@
+ name texlive-en
+ category Documentation
++postaction shortcut type=menu name="TeX Live Manual (en) (PDF)" cmd=TEXDIR/texmf-doc/doc/english/texlive-en/texlive-en.pdf
++postaction shortcut type=menu name="TeX Live Manual (en) (HTML)" cmd=TEXDIR/texmf-doc/doc/english/texlive-en/texlive-en.html
+Index: tlpkg/tlpsrc/bin-physe.tlpsrc
+===================================================================
+--- tlpkg/tlpsrc/bin-physe.tlpsrc (revision 12142)
++++ tlpkg/tlpsrc/bin-physe.tlpsrc (working copy)
+@@ -1,6 +1,5 @@
+ name bin-physe
+ category TLCore
+ depend bin-tex
+-execute BuildFormat physe
+-runpattern f texmf/fmtutil/format.physe.cnf
++execute AddFormat name=physe engine=pdftex options="physe.ini"
+ binpattern f bin/${ARCH}/physe
+Index: tlpkg/tlpsrc/bin-phyzzx.tlpsrc
+===================================================================
+--- tlpkg/tlpsrc/bin-phyzzx.tlpsrc (revision 12142)
++++ tlpkg/tlpsrc/bin-phyzzx.tlpsrc (working copy)
+@@ -1,6 +1,5 @@
+ name bin-phyzzx
+ category TLCore
+ depend bin-tex
+-execute BuildFormat phyzzx
+-runpattern f texmf/fmtutil/format.phyzzx.cnf
++execute AddFormat name=phyzzx engine=pdftex options="physe.ini"
+ binpattern f bin/${ARCH}/phyzzx
+Index: tlpkg/tlpsrc/bin-eplain.tlpsrc
+===================================================================
+--- tlpkg/tlpsrc/bin-eplain.tlpsrc (revision 12142)
++++ tlpkg/tlpsrc/bin-eplain.tlpsrc (working copy)
+@@ -1,8 +1,7 @@
+ name bin-eplain
+ category TLCore
+ depend pdftex
+-execute BuildFormat eplain
+-runpattern f texmf/fmtutil/format.eplain.cnf
++execute AddFormat name=eplain engine=pdftex options="-translate-file=cp227.tcx *eplain.ini"
+ docpattern f texmf/doc/info/eplain.info
+ docpattern f texmf/doc/man/man1/eplain.*
+ binpattern f bin/${ARCH}/eplain
+Index: tlpkg/tlpsrc/texlive-cz.tlpsrc
+===================================================================
+--- tlpkg/tlpsrc/texlive-cz.tlpsrc (revision 12142)
++++ tlpkg/tlpsrc/texlive-cz.tlpsrc (working copy)
+@@ -1,2 +1,4 @@
+ name texlive-cz
+ category Documentation
++postaction shortcut type=menu name="TeX Live Manual (cz) (PDF)" cmd=TEXDIR/texmf-doc/doc/czechslovak/texlive-cz/texlive-cz.pdf
++postaction shortcut type=menu name="TeX Live Manual (cz) (HTML)" cmd=TEXDIR/texmf-doc/doc/czechslovak/texlive-cz/texlive-cz.html
+Index: tlpkg/tlpsrc/bin-jadetex.tlpsrc
+===================================================================
+--- tlpkg/tlpsrc/bin-jadetex.tlpsrc (revision 12142)
++++ tlpkg/tlpsrc/bin-jadetex.tlpsrc (working copy)
+@@ -2,7 +2,7 @@
+ category TLCore
+ depend pdftex
+ depend bin-tex
+-execute BuildFormat jadetex
+-runpattern f texmf/fmtutil/format.jadetex.cnf
++execute AddFormat name=jadetex engine=pdftex patterns=language.dat options="&latex jadetex.ini"
++execute AddFormat name=pdfjadetex engine=pdftex patterns=language.dat options="&pdflatex pdfjadetex.ini"
+ binpattern f bin/${ARCH}/jadetex
+ binpattern f bin/${ARCH}/pdfjadetex
+Index: tlpkg/tlpsrc/texlive-pl.tlpsrc
+===================================================================
+--- tlpkg/tlpsrc/texlive-pl.tlpsrc (revision 12142)
++++ tlpkg/tlpsrc/texlive-pl.tlpsrc (working copy)
+@@ -1,2 +1,4 @@
+ name texlive-pl
+ category Documentation
++postaction shortcut type=menu name="TeX Live Manual (pl) (PDF)" cmd=TEXDIR/texmf-doc/doc/polish/texlive-pl/texlive-pl.pdf
++postaction shortcut type=menu name="TeX Live Manual (pl) (HTML)" cmd=TEXDIR/texmf-doc/doc/polish/texlive-pl/texlive-pl.html
+Index: tlpkg/tlpsrc/bin-amstex.tlpsrc
+===================================================================
+--- tlpkg/tlpsrc/bin-amstex.tlpsrc (revision 12142)
++++ tlpkg/tlpsrc/bin-amstex.tlpsrc (working copy)
+@@ -1,7 +1,7 @@
+ name bin-amstex
+ category TLCore
+ depend bin-tex
+-execute BuildFormat amstex
+-runpattern f texmf/fmtutil/format.amstex.cnf
++execute AddFormat name=amstex engine=pdftex options="-translate-file=cp227.tcx *amstex.ini"
++execute AddFormat name=pdfamstex mode=disabled engine=pdftex options="-translate-file=cp227.tcx *pdfamstex.ini"
+ docpattern f texmf/doc/man/man1/amstex.*
+ binpattern f bin/${ARCH}/amstex
+Index: tlpkg/tlpsrc/bin-aleph.tlpsrc
+===================================================================
+--- tlpkg/tlpsrc/bin-aleph.tlpsrc (revision 12142)
++++ tlpkg/tlpsrc/bin-aleph.tlpsrc (working copy)
+@@ -1,7 +1,7 @@
+ name bin-aleph
+ category TLCore
+ depend bin-omega
+-execute BuildFormat aleph
+-runpattern f texmf/fmtutil/format.aleph.cnf
++execute AddFormat name=aleph engine=aleph options=*aleph.ini
++execute AddFormat name=lamed engine=aleph patterns=language.dat options=*lambda.ini
+ binpattern f bin/${ARCH}/aleph
+ binpattern f bin/${ARCH}/lamed
+Index: tlpkg/tlpsrc/bin-metafont.tlpsrc
+===================================================================
+--- tlpkg/tlpsrc/bin-metafont.tlpsrc (revision 12142)
++++ tlpkg/tlpsrc/bin-metafont.tlpsrc (working copy)
+@@ -1,8 +1,7 @@
+ name bin-metafont
+ category TLCore
+ depend bin-kpathsea
+-execute BuildFormat metafont
+-runpattern f texmf/fmtutil/format.metafont.cnf
++execute AddFormat name=mf engine=mf-nowin options="-translate-file=cp227.tcx mf.ini"
+ docpattern f texmf/doc/man/man1/mf-nowin.*
+ docpattern f texmf/doc/man/man1/mf.*
+ binpattern f bin/${ARCH}/mf
+Index: tlpkg/tlpsrc/texlive.infra.tlpsrc
+===================================================================
+--- tlpkg/tlpsrc/texlive.infra.tlpsrc (revision 12142)
++++ tlpkg/tlpsrc/texlive.infra.tlpsrc (working copy)
+@@ -36,3 +36,5 @@
+ binpattern f/!i386-solaris,i386-linux,mips-irix,sparc-linux,alpha-linux,\
+ powerpc-linux,i386-freebsd,x86_64-linux \
+ tlpkg/installer/wget/wget.${ARCH}
++# post actions
++postaction shortcut type=menu name="TeX Live Toplevel Readme Index" cmd=TEXDIR/index.html
diff --git a/Master/tlpkg/etc/2009.combined.patch.README b/Master/tlpkg/etc/2009.combined.patch.README
new file mode 100644
index 00000000000..2fc173e596f
--- /dev/null
+++ b/Master/tlpkg/etc/2009.combined.patch.README
@@ -0,0 +1,38 @@
+2009.combined.patch
+===================
+
+This patch collects all the stuff that we will change for 2009. Currently
+implemented are:
+
+- removal of unshort.bat necessity:
+ remove from TLUtils everything related to unshort.bat
+ remove from TLWinGoo the necessity to pass $texdirw to add_desktop_shortcut
+ execute the TLPostAction PostRemoval and the postaction remove
+ in uninstall-w32.pl
+ remove the main menu in uninstall-w32.pl
+ define the name of the main menu in TLConfig.pm
+
+- rework of the fmtutil AddFormat execute line
+ no need for additional files
+ touches several tlpsrc
+ changes the parsing in TLPDB->fmtutil_cnf_lines
+
+- implement support for TLPSRC/TLPOBJ postaction line
+ move stuff from TLPostActions into the .tlpsrc files
+ format:
+ postaction shortcut name=name type=menu icon=... cmd=... args=... hide=0
+ postaction shortcut name=name type=menu icon=... cmd=... args=... hide=0
+ postaction shortcut name=name type=desktop icon=... cmd=... args=... hide=1
+ postaction filetype name=TLPostScript cmd=...
+ postaction fileassoc extension=.ps filetype=TLPostScript
+ postaction code ...something till now undecided....
+
+ Execute the actions in install-tl (install), tlmgr:remove_package (remove),
+ and TLMedia.pm (install).
+
+ . open question: how to implement the postaction code stuff. What about:
+ postaction code install=sub_name_a remove=sub_name_b file=texmf-dist/scripts/foo/bar/baz.pl
+ which will trigger the require of that script and at install time the
+ call of sub_name_a and at removal time the call of sub_name_b, both
+ within an eval to catch any errors.
+
diff --git a/Master/tlpkg/etc/dev.postaction-in-tlpsrc.patch b/Master/tlpkg/etc/dev.postaction-in-tlpsrc.patch
new file mode 100644
index 00000000000..c5bb45208b1
--- /dev/null
+++ b/Master/tlpkg/etc/dev.postaction-in-tlpsrc.patch
@@ -0,0 +1,398 @@
+Index: tlpkg/TeXLive/TLConfig.pm
+===================================================================
+--- tlpkg/TeXLive/TLConfig.pm (revision 12142)
++++ tlpkg/TeXLive/TLConfig.pm (working copy)
+@@ -28,6 +28,7 @@
+ $WinSpecialUpdatePackagesRegexp
+ @CriticalPackagesList
+ @AllowedConfigOptions
++ $WindowsMainMenuName
+ );
+ @EXPORT = @EXPORT_OK;
+ }
+@@ -82,6 +83,8 @@
+ autobackup
+ /;
+
++our $WindowsMainMenuName = "TeX Live 2008";
++
+ 1;
+
+
+Index: tlpkg/TeXLive/TLPSRC.pm
+===================================================================
+--- tlpkg/TeXLive/TLPSRC.pm (revision 12142)
++++ tlpkg/TeXLive/TLPSRC.pm (working copy)
+@@ -30,6 +30,7 @@
+ srcpatterns => $params{'srcpatterns'},
+ docpatterns => $params{'docpatterns'},
+ binpatterns => $params{'binpatterns'},
++ postactions => $params{'postactions'},
+ executes => defined($params{'executes'}) ? $params{'executes'} : [],
+ depends => defined($params{'depends'}) ? $params{'depends'} : [],
+ };
+@@ -67,6 +68,7 @@
+ my $catalogue = "";
+ my (@executes, @depends);
+ my (@runpatterns, @docpatterns, @binpatterns, @srcpatterns);
++ my (@postactions);
+ my $started = 0;
+ my $finished = 0;
+ my $savedline = "";
+@@ -132,6 +134,9 @@
+ } elsif ($line =~ /^depend\s+(.*)\s*$/) {
+ push @depends, $1 if ($1 ne "");
+ next;
++ } elsif ($line =~ /^postaction\s+(.*)\s*$/) {
++ push @postactions, $1 if ($1 ne "");
++ next;
+ } else {
+ tlwarn("$srcfile:$.: unknown tlpsrc directive, please fix: $line\n");
+ }
+@@ -149,6 +154,7 @@
+ $self->docpatterns(@docpatterns) if @docpatterns;
+ $self->executes(@executes) if @executes;
+ $self->depends(@depends) if @depends;
++ $self->postactions(@postactions) if @postactions;
+ }
+
+
+@@ -175,6 +181,11 @@
+ print $fd "execute $_\n";
+ }
+ }
++ if (defined($self->{'postactions'})) {
++ foreach (@{$self->{'postactions'}}) {
++ print $fd "postaction $_\n";
++ }
++ }
+ if (defined($self->{'srcpatterns'}) && (@{$self->{'srcpatterns'}})) {
+ foreach (sort @{$self->{'srcpatterns'}}) {
+ print $fd "srcpattern $_\n";
+@@ -213,6 +224,7 @@
+ $tlp->longdesc($self->{'longdesc'}) if (defined($self->{'longdesc'}));
+ $tlp->catalogue($self->{'catalogue'}) if (defined($self->{'catalogue'}));
+ $tlp->executes(@{$self->{'executes'}}) if (defined($self->{'executes'}));
++ $tlp->postactions(@{$self->{'postactions'}}) if (defined($self->{'postactions'}));
+ $tlp->depends(@{$self->{'depends'}}) if (defined($self->{'depends'}));
+ $tlp->revision(0);
+ my $filemax;
+@@ -540,6 +552,11 @@
+ if (@_) { @{ $self->{'executes'} } = @_ }
+ return @{ $self->{'executes'} };
+ }
++sub postactions {
++ my $self = shift;
++ if (@_) { @{ $self->{'postactions'} } = @_ }
++ return @{ $self->{'postactions'} };
++}
+
+ format multilineformat =
+ longdesc ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<~~
+@@ -580,7 +597,7 @@
+
+ where I<key> can be C<name>, C<category>, C<shortdesc>, C<longdesc>,
+ C<catalogue>, C<runpattern>, C<srcpattern>, C<docpattern>, C<binpattern>,
+-C<execute>, or C<depend>.
++C<execute>, C<postaction>, or C<depend>.
+
+ Continuation lines are supported via a trailing backslash. That is, if
+ the C<.tlpsrc> file contains two physical lines like this:
+@@ -743,6 +760,38 @@
+
+ =back
+
++=item <postaction>
++
++gives a free from entry of post install and removal actions to be
++executed. The difference to the C<execute> statement is that
++C<postaction> is concerned with system integration, i.e., adjusting
++things outside the installation directory, while C<execute> touches
++only things within the installation.
++
++Currently the following C<postaction>s are understood:
++
++=over 4
++
++=item C<postaction shortcut name=I<name> type=menu|desktop icon=I<path> cmd=I<cmd> args=I<args> hide=0|1>
++
++On W32 creates a shortcut either in the main TeX Live menu or on the
++desktop. Please see the documentation of TeXLive::TLWinGoo for details
++on the parameters.
++
++=item C<postaction filetype name=I<name> cmd=I<cmd>>
++
++On W32 associates the file type I<name> with the command I<cmd>.
++
++=item C<postaction fileassoc extension=I<.ext> filetype=I<name>>
++
++On W32 declares files with the extenstion I<.ext> of file type I<name>.
++
++=item C<postaction code I<arg>>
++
++TODO TODO I don't know how we want to do that
++
++=back
++
+ =item C<(src|run|doc|bin)pattern> I<pattern>
+
+ adds a pattern (next section) to the respective list of patterns.
+Index: tlpkg/TeXLive/TLPOBJ.pm
+===================================================================
+--- tlpkg/TeXLive/TLPOBJ.pm (revision 12142)
++++ tlpkg/TeXLive/TLPOBJ.pm (working copy)
+@@ -29,6 +29,7 @@
+ docfiles => defined($params{'docfiles'}) ? $params{'docfiles'} : [],
+ docsize => $params{'docsize'},
+ executes => defined($params{'executes'}) ? $params{'executes'} : [],
++ postactions => defined($params{'postactions'}) ? $params{'postactions'} : [],
+ # note that binfiles is a HASH with keys of $arch!
+ binfiles => defined($params{'binfiles'}) ? $params{'binfiles'} : {},
+ binsize => defined($params{'binsize'}) ? $params{'binsize'} : {},
+@@ -92,6 +93,7 @@
+ ($lastcmd eq "docfiles") ||
+ ($lastcmd eq "srcfiles") ||
+ ($lastcmd eq "executes") ||
++ ($lastcmd eq "postaction") ||
+ ($lastcmd eq "depend") ) {
+ $line =~ s/^ /${lastcmd}continued /;
+ } else {
+@@ -216,6 +218,10 @@
+ push @{$self->{'executes'}}, "$2" unless "$2" eq "";
+ $lastcmd = "execute";
+ next;
++ } elsif ($line =~ /^postaction(continued)?\s*(.*)\s*/o) {
++ push @{$self->{'postactions'}}, "$2" unless "$2" eq "";
++ $lastcmd = "postaction";
++ next;
+ } elsif ($line =~ /^depend(continued)?\s*(.*)\s*/o) {
+ push @{$self->{'depends'}}, "$2" unless "$2" eq "";
+ $lastcmd = "depend";
+@@ -316,6 +322,11 @@
+ print $fd "execute $_\n";
+ }
+ }
++ if (defined($self->{'postactions'})) {
++ foreach (@{$self->{'postactions'}}) {
++ print $fd "postaction $_\n";
++ }
++ }
+ if (defined($self->{'containersize'})) {
+ print $fd "containersize $self->{'containersize'}\n";
+ }
+@@ -388,6 +399,11 @@
+ print $fd "execute $_\n";
+ }
+ }
++ if (defined($self->{'postactions'})) {
++ foreach (@{$self->{'postactions'}}) {
++ print $fd "postaction $_\n";
++ }
++ }
+ if (defined($self->{'docfiles'}) && (@{$self->{'docfiles'}})) {
+ print $fd "docfiles\n";
+ foreach (sort @{$self->{'docfiles'}}) {
+@@ -1026,6 +1042,11 @@
+ if (@_) { $self->{'executes'} = [ @_ ] }
+ return @{ $self->{'executes'} };
+ }
++sub postactions {
++ my $self = shift;
++ if (@_) { $self->{'postactions'} = [ @_ ] }
++ return @{ $self->{'postactions'} };
++}
+ sub containerdir {
+ my @self = shift;
+ if (@_) { $_containerdir = $_[0] }
+Index: tlpkg/TeXLive/TLUtils.pm
+===================================================================
+--- tlpkg/TeXLive/TLUtils.pm (revision 12142)
++++ tlpkg/TeXLive/TLUtils.pm (working copy)
+@@ -56,6 +56,7 @@
+ TeXLive::TLUtils::create_language_def($tlpdb,$dest,$localconf);
+ TeXLive::TLUtils::install_packages($from_tlpdb,$media,$to_tlpdb,$what,$opt_src, $opt_doc)>);
+ TeXLive::TLUtils::install_package($what, $filelistref, $target, $platform);
++ TeXLive::TLUtils::do_postaction_code($how, $tlpdb, $TEXDIR, $TEXDIRW, $TEXMFSYSVAR, $TEXMFLOCAL);
+
+ =head2 Miscellaneous
+
+@@ -1224,7 +1225,111 @@
+ return 1;
+ }
+
++=item C<do_postaction_code($how, $tlpobj)>
+
++Evaluates the C<postaction> code in the C<$tlpobj>
++MISSING DOCUMENTATION TODO TODO
++
++Returns 1 on success, and 0 on failure.
++
++=cut
++
++sub do_postaction_code {
++ my ($how, $tlpobj) = @_;
++ my $ret = 1;
++ if (!defined($tlpobj)) {
++ tlwarn("do_postaction_code: didn't get a tlpobj\n");
++ return 0;
++ }
++ for my $pa ($tlpobj->postactions) {
++ if ($pa =~ m/^\s*shortcut\s+(.*)\s*$/) {
++ $ret &&= _do_postaction_shortcut($how, $tlpobj, $1);
++ } elsif ($pa =~ m/\s*filetype\s+(.*)\s*$/) {
++ $ret &&= _do_postaction_filetype($how, $tlpobj, $1);
++ } elsif ($pa =~ m/\s*fileassoc\s+(.*)\s*$/) {
++ $ret &&= _do_postaction_fileassoc($how, $tlpobj, $1);
++ } elsif ($pa =~ m/\s*code\s+(.*)\s*$/) {
++ $ret &&= _do_postaction_code($how, $tlpobj, $1);
++ } else {
++ tlwarn("do_postaction_code: don't know how to do $pa\n");
++ $ret = 0;
++ }
++ }
++ # nothing to do
++ return $ret;
++}
++
++sub _do_postaction_shortcut {
++ my ($how, $tlpobj, $pa) = @_;
++ my @words = quotewords('\s+', 0, "$pa");
++ my $type;
++ my $icon = '';
++ my $cmd = '';
++ my $args = '';
++ my $name;
++ my $hide = '0';
++ while (@words) {
++ $_ = shift @words;
++ if (/^type=(.*)$/) {
++ $type = $1;
++ if (($type ne "menu") && ($type ne "desktop")) {
++ tlwarn("type of shortcut postaction $type is unknown (menu, desktop)\n");
++ return 0;
++ }
++ } elsif (/^name=(.*)$/) {
++ $name = $1;
++ } elsif (/^icon=(.*)$/) {
++ $icon = $1;
++ } elsif (/^cmd=(.*)$/) {
++ $cmd = $1;
++ } elsif (/^args=(.*)$/) {
++ $args = $1;
++ } elsif (/^hide=(.*)$/) {
++ $hide = $1;
++ if (($hide ne "0") && ($hide ne "1")) {
++ tlwarn("hide of shortcut postaction $hide is unknown (0, 1)\n");
++ return 0;
++ }
++ } else {
++ tlwarn("Unknown tag for postaction shortcut $pa: $_\n");
++ return 0;
++ }
++ }
++ if ($how eq "install") {
++ my $texdir = `kpsewhich -var-value=SELFAUTOPARENT`
++ chomp($texdir);
++ my $texdir_bsl = conv_to_w32_path($texdir);
++ $icon =~ s!^TEXDIR/!$texdir/!;
++ $args =~ s!^TEXDIR/!$texdir/!;
++ $args = conv_to_w32_path($args);
++ if ($type eq "menu") {
++ add_menu_shortcut($TeXLive::TLConfig::WindowsMainMenuName,
++ $name, $icon, $cmd, $args, $hide);
++ } elsif ($type eq "desktop") {
++ # $texdirw here is only used for updating the unshort.bat script
++ # we could call all the TLPostRemove actions in the uninstall_w32.pl
++ # and get rid of the $texdirw completely...
++ add_desktop_shortcut(TODO $texdirw TODO, $name, $icon, $cmd, $args, $hide);
++ } else {
++ tlwarn("Unknown type of shortcut: $type\n");
++ return 0;
++ }
++ } elsif ($how eq "remove") {
++ if ($type eq "menu") {
++ remove_menu_shortcut($TeXLive::TLConfig::WindowsMainMenuName, $name);
++ } elsif ($type eq "desktop") {
++ remove_desktop_shortcut($name);
++ } else {
++ tlwarn("Unknown type of shortcut: $type\n");
++ return 0;
++ }
++ } else {
++ tlwarn("Unknown mode $how\n");
++ return 0;
++ }
++ return 1;
++}
++
+ =item C<untar($tarfile,$targetdir, $remove_tarfile)>
+
+ Unpacked C<$tarfile> in C<$targetdir> (changing directories to
+Index: install-tl
+===================================================================
+--- install-tl (revision 12142)
++++ install-tl (working copy)
+@@ -1052,6 +1052,11 @@
+ # post install actions
+ #
+
++ # in case we are running from DVD we use the tlpdb from the DVD, otherwise
++ # the one we have locally created, for all the further actions
++ my $usedtlpdb = $vars{'from_dvd'} ? $tlpdb : $localtlpdb;
++
++
+ if (win32()) {
+ debug "Actual environment:\n".`set`."\n\n";
+ debug 'Effective TEXMFCNF: '.`kpsewhich -expand-path=\$TEXMFCNF`."\n";
+@@ -1063,12 +1068,20 @@
+ init_unshortbat($TEXDIRW);
+ }
+
++ # Run the post installation code in TLPostAction.pm
+ foreach my $package (sort keys %install) {
+ if ($install{$package} && defined($PostInstall{$package})) {
+ info("running post install action for $package\n");
+ &{$PostInstall{$package}}($TEXDIR, $TEXDIRW, $TEXMFSYSVAR, $TEXMFLOCAL);
+ }
+ }
++ # Run the post installation code in the postaction tlpsrc entries
++ foreach my $package (sort keys %install) {
++ if ($install{$package}) {
++ do_postaction_code("install", $usedtlpdb->get_package($package));
++ }
++ }
++
+ # $opt_portable: no %install but we still want xetex postinstall
+ &{$PostInstall{'xetex'}}($TEXDIR, $TEXDIRW, $TEXMFSYSVAR, $TEXMFLOCAL)
+ if $opt_portable;
+@@ -1085,25 +1098,25 @@
+ # texconfig generate * but Win32 does not have texconfig. But we have
+ # $localtlpdb and this is simple code, so do it directly, i.e., duplicate
+ # the code from the various generate-*.pl scripts
++
+ info("writing fmtutil.cnf data to $TEXMFSYSVAR/web2c/fmtutil.cnf\n");
+- my $tlp = $vars{'from_dvd'} ? $tlpdb : $localtlpdb;
+- TeXLive::TLUtils::create_fmtutil($tlp, #$localtlpdb,
++ TeXLive::TLUtils::create_fmtutil($usedtlpdb,
+ "$TEXMFSYSVAR/web2c/fmtutil.cnf",
+ "$TEXMFLOCAL/web2c/fmtutil-local.cnf");
+
+ mkdirhier "$vars{'TEXMFSYSCONFIG'}/web2c";
+ info("writing updmap.cfg to $TEXMFSYSCONFIG/web2c/updmap.cfg\n");
+- TeXLive::TLUtils::create_updmap ($tlp, #$localtlpdb,
++ TeXLive::TLUtils::create_updmap ($usedtlpdb,
+ "$TEXMFSYSCONFIG/web2c/updmap.cfg",
+ "$TEXMFLOCAL/web2c/updmap-local.cfg");
+
+ info("writing language.dat data to $TEXMFSYSVAR/tex/generic/config/language.dat\n");
+- TeXLive::TLUtils::create_language_dat($tlp, #$localtlpdb,
++ TeXLive::TLUtils::create_language_dat($usedtlpdb,
+ "$TEXMFSYSVAR/tex/generic/config/language.dat",
+ "$TEXMFLOCAL/tex/generic/config/language-local.dat");
+
+ info("writing language.def data to $TEXMFSYSVAR/tex/generic/config/language.def\n");
+- TeXLive::TLUtils::create_language_def($tlp, #$localtlpdb,
++ TeXLive::TLUtils::create_language_def($usedtlpdb,
+ "$TEXMFSYSVAR/tex/generic/config/language.def",
+ "$TEXMFLOCAL/tex/generic/config/language-local.def");
+
diff --git a/Master/tlpkg/etc/dev.postaction-in-tlpsrc.patch.README b/Master/tlpkg/etc/dev.postaction-in-tlpsrc.patch.README
new file mode 100644
index 00000000000..ee6f6d67b39
--- /dev/null
+++ b/Master/tlpkg/etc/dev.postaction-in-tlpsrc.patch.README
@@ -0,0 +1,29 @@
+dev.postaction-in-tlpsrc.patch
+==============================
+
+The idea is to move stuff from TLPostActions.pm into the tlpsrc files.
+The format would be:
+ postaction shortcut name=name type=menu icon=... cmd=... args=... hide=0
+ postaction shortcut name=name type=menu icon=... cmd=... args=... hide=0
+ postaction shortcut name=name type=desktop icon=... cmd=... args=... hide=1
+ postaction filetype name=TLPostScript cmd=...
+ postaction fileassoc extension=.ps filetype=TLPostScript
+ postaction code ...something till now undecided....
+
+These actions would be called by install-tl and tlmgr on install time
+and from tlmgr at removal time.
+
+Problems I have found while implementing:
+- add_desktop_shortcut (from TLWinGoo) needs the $texdirw (writable
+ texdir) variable to update the unshort.bat script.
+
+ What about getting rid of the unshort.bat completely and calling all
+ the TLPostActions.pm PostRemoval actions, and here the postactions with
+ "remove" argument, so that all shortcuts are removed that way.
+
+- how to implement the postaction code stuff. What about:
+ postaction code install=sub_name_a remove=sub_name_b file=texmf-dist/scripts/foo/bar/baz.pl
+ which will trigger the require of that script and at install time the
+ call of sub_name_a and at removal time the call of sub_name_b, both
+ within an eval to catch any errors.
+