summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2009-03-11 16:18:41 +0000
committerNorbert Preining <preining@logic.at>2009-03-11 16:18:41 +0000
commitfe247ba9d4d40b22d2b3a37a41fc327eea3ef86f (patch)
tree66f0292bfb36d1ff66e72ff01a0264a11d8a69e6
parent8bb7431c502554b379ba8cbb91a8f4bffe74cc44 (diff)
rename TLPostActions to TLPackageConfigurations, use that in all the scripts,
move the xetex stuff there, remove xetex.pm, edit xetex.tlpsrc git-svn-id: svn://tug.org/texlive/branches/branch2009-dev@12367 c570f23f-e606-0410-a88d-b1316a301751
-rwxr-xr-xMaster/install-tl24
-rwxr-xr-xMaster/texmf/scripts/texlive/tlmgr.pl6
-rw-r--r--Master/texmf/scripts/texlive/uninstall-win32.pl6
-rw-r--r--Master/tlpkg/TeXLive/TLMedia.pm4
-rw-r--r--Master/tlpkg/TeXLive/TLPackageConfigurations.pm (renamed from Master/tlpkg/TeXLive/PostAction/xetex.pm)57
-rw-r--r--Master/tlpkg/TeXLive/TLPostActions.pm198
-rw-r--r--Master/tlpkg/tlpsrc/xetex.tlpsrc4
7 files changed, 62 insertions, 237 deletions
diff --git a/Master/install-tl b/Master/install-tl
index 8dd1a0b3eb6..89a9c492f10 100755
--- a/Master/install-tl
+++ b/Master/install-tl
@@ -54,7 +54,7 @@ use TeXLive::TLMedia;
use TeXLive::TLPOBJ;
use TeXLive::TLPDB;
use TeXLive::TLConfig;
-use TeXLive::TLPostActions;
+use TeXLive::TLPackageConfigurations;
if (win32) {
require TeXLive::TLWinGoo;
@@ -685,29 +685,27 @@ operations might be disturbed.\n\n";
info("done\n");
}
- # TODO: Should/can this be moved into the do_system_integration part?
+ # configuration actions
# it looks like it does not do anything outside the texlive tree, so it
# would be fine if we do it anyway ...
+ # TODO !!!
# $opt_portable: no %install but we still want xetex postinstall
- &{$PostInstall{'xetex'}}($TEXDIR, $TEXDIRW, $TEXMFSYSVAR, $TEXMFLOCAL)
- if $opt_portable;
+ # Run the post installation code in TLPackageConfigurations.pm
+ foreach my $package (sort keys %install) {
+ if ($install{$package} && defined($PackageConfigInstall{$package})) {
+ info("running package configuration action for $package\n");
+ &{$PackageConfigInstall{'xetex'}}($TEXDIR, $TEXDIRW, $TEXMFSYSVAR, $TEXMFLOCAL);
+ }
+ }
# no do the system integration:
# on unix this means setting up symlinks
# on w32 this means adding to path, settting registry values
- # on both, we run the TLPostActions and the postaction directives of the tlp
+ # on both, we run the postaction directives of the tlp
do_system_integration() if $vars{'option_sysint'};
}
sub do_system_integration {
- # 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}}($vars{'TEXDIR'}, $vars{'TEXDIRW'},
- $vars{'TEXMFSYSVAR'}, $vars{'TEXMFLOCAL'});
- }
- }
# Run the post installation code in the postaction tlpsrc entries
my $usedtlpdb = $vars{'from_dvd'} ? $tlpdb : $localtlpdb;
foreach my $package (sort keys %install) {
diff --git a/Master/texmf/scripts/texlive/tlmgr.pl b/Master/texmf/scripts/texlive/tlmgr.pl
index 7e2a69d1727..da7f581d703 100755
--- a/Master/texmf/scripts/texlive/tlmgr.pl
+++ b/Master/texmf/scripts/texlive/tlmgr.pl
@@ -59,7 +59,7 @@ use TeXLive::TLConfig;
use TeXLive::TLMedia;
use TeXLive::TLPDB;
use TeXLive::TLPOBJ;
-use TeXLive::TLPostActions;
+use TeXLive::TLPackageConfigurations;
use TeXLive::TLUtils;
use TeXLive::TLWinGoo;
TeXLive::TLUtils->import(qw(member info give_ctan_mirror win32 dirname
@@ -553,9 +553,9 @@ sub remove_package {
# still I consider it better that the tlpdb is in a consistent state
$localtlpdb->save;
# do the post removal actions
- if (defined($PostRemove{$pkg})) {
+ if (defined($PackageConfigRemove{$pkg})) {
info("running post remove action for $pkg\n");
- &{$PostRemove{$pkg}}($localtlpdb->root);
+ &{$PackageConfigRemove{$pkg}}($localtlpdb->root);
}
#
# Run the post installation code in the postaction tlpsrc entries
diff --git a/Master/texmf/scripts/texlive/uninstall-win32.pl b/Master/texmf/scripts/texlive/uninstall-win32.pl
index 0d18867d435..3aa3434a358 100644
--- a/Master/texmf/scripts/texlive/uninstall-win32.pl
+++ b/Master/texmf/scripts/texlive/uninstall-win32.pl
@@ -19,7 +19,7 @@ BEGIN {
use TeXLive::TLWinGoo;
use TeXLive::TLPDB;
use TeXLive::TLPOBJ;
-use TeXLive::TLPostActions;
+use TeXLive::TLPackageConfigurations;
use TeXLive::TLConfig;
use TeXLive::TLUtils;
use Tk;
@@ -51,9 +51,9 @@ sub doit {
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})) {
+ if (defined($PackageConfigRemove{$pkg})) {
info("running post remove action for $pkg\n");
- &{$PostRemove{$pkg}}($Master);
+ &{$PackageConfigRemove{$pkg}}($Master);
}
}
&TeXLive::TLUtils::do_postaction("remove", $pkg);
diff --git a/Master/tlpkg/TeXLive/TLMedia.pm b/Master/tlpkg/TeXLive/TLMedia.pm
index 13d129879d1..b990d7ff7fa 100644
--- a/Master/tlpkg/TeXLive/TLMedia.pm
+++ b/Master/tlpkg/TeXLive/TLMedia.pm
@@ -8,7 +8,7 @@
package TeXLive::TLMedia;
use TeXLive::TLConfig;
-use TeXLive::TLPostActions;
+use TeXLive::TLPackageConfigurations;
use TeXLive::TLUtils qw(copy win32 dirname mkdirhier basename download_file
merge_into debug ddebug info tlwarn);
use TeXLive::TLPDB;
@@ -204,7 +204,7 @@ sub install_package {
merge_into(\%ret, $tlpobj->make_return_hash_from_executes("enable"));
if (!$nopostinstall) {
# do the postinstallation actions
- if (defined($PostInstall{$pkg})) {
+ if (defined($PackageConfigInstall{$pkg})) {
info("running post install action for $pkg\n");
&{$PostInstall{$pkg}}($totlpdb->root);
}
diff --git a/Master/tlpkg/TeXLive/PostAction/xetex.pm b/Master/tlpkg/TeXLive/TLPackageConfigurations.pm
index 33b98405c47..6b6903b5a56 100644
--- a/Master/tlpkg/TeXLive/PostAction/xetex.pm
+++ b/Master/tlpkg/TeXLive/TLPackageConfigurations.pm
@@ -1,19 +1,20 @@
# $Id$
-# TeXLive::PostAction::xetex.pm - post stuff for xetex
-# Copyright 2008, 2009 Norbert Preining
+# TeXLive::TLPackageConfigurations.pm
+# Copyright 2008 Norbert Preining
# This file is licensed under the GNU General Public License version 2
# or any later version.
-package TeXLive::PostAction::xetex;
+package TeXLive::TLPackageConfigurations;
BEGIN {
use Exporter ();
use vars qw( @ISA @EXPORT_OK @EXPORT );
@ISA = qw(Exporter);
@EXPORT_OK = qw(
- &post_install
- &post_remove
+ %PackageConfigInstall
+ %PackageConfigRemove
);
+ @EXPORT = @EXPORT_OK;
}
use TeXLive::TLUtils qw(win32 mkdirhier copy conv_to_w32_path log debug info
@@ -23,22 +24,17 @@ use TeXLive::TLConfig;
my $mainmenu = $TeXLive::TLConfig::WindowsMainMenuName;
+our %PackageConfigInstall;
+our %PackageConfigRemove;
+
# xetex
#
-sub post_install {
+sub do_install_xetex {
my ($texdir, $texdirw, $texmfsysvar) = @_;
-
- debug("Entering post_install from xetex.pm\n");
-
#
# bin-installs font-config related stuff
#
# new version according to Staszek
- if (!defined($texdir)) {
- $texdir = `kpsewhich -var-value=SELFAUTOPARENT`;
- chomp($texdir);
- $texdirw = $texdir;
- }
if (!defined($texmfsysvar)) {
$texmfsysvar = `kpsewhich -var-value=TEXMFSYSVAR`;
chomp($texmfsysvar);
@@ -116,10 +112,43 @@ sub post_install {
#system("fc-cache","-v", "-r");
}
}
+$PackageConfigInstall{"xetex"} = \&do_install_xetex;
1;
+
+=head1 NAME
+
+C<TeXLive::TLPackageConfigurations> -- Special Configuration function for TeX Live packages
+
+=head1 SYNOPSIS
+
+ use TeXLive::TLPackageConfigurations;
+
+=head1 DESCRIPTION
+
+The L<TeXLive::TLPackageConfigurations> module exports the
+C<%PackageConfigInstall> and the C<%PackageConfigRemove> hashes indexed by
+package names providing code references.
+
+These code references are called with the root of the installation as
+argument (C<$SELFAUTOPARENT>). Additional arguments, but not necessarily
+present, are the value of C<TEXMFSYSVAR> and C<TEXMFLOCAL>.
+
+=head1 SEE ALSO
+
+The modules L<TeXLive::TLUtils>, L<TeXLive::TLPSRC>,
+L<TeXLive::TLPDB>, L<TeXLive::TLTREE>, L<TeXLive::TeXCatalogue>.
+
+=head1 AUTHORS AND COPYRIGHT
+
+This script and its documentation were written for the TeX Live
+distribution (L<http://tug.org/texlive>) and both are licensed under the
+GNU General Public License Version 2 or later.
+
+=cut
+
### Local Variables:
### perl-indent-level: 2
### tab-width: 2
diff --git a/Master/tlpkg/TeXLive/TLPostActions.pm b/Master/tlpkg/TeXLive/TLPostActions.pm
deleted file mode 100644
index 700a3aafc70..00000000000
--- a/Master/tlpkg/TeXLive/TLPostActions.pm
+++ /dev/null
@@ -1,198 +0,0 @@
-# $Id$
-# TeXLive::TLPostActions.pm - collection post install stuff for installation
-# Copyright 2008 Norbert Preining
-# This file is licensed under the GNU General Public License version 2
-# or any later version.
-
-package TeXLive::TLPostActions;
-
-BEGIN {
- use Exporter ();
- use vars qw( @ISA @EXPORT_OK @EXPORT );
- @ISA = qw(Exporter);
- @EXPORT_OK = qw(
- %PostInstall
- %PostRemove
- );
- @EXPORT = @EXPORT_OK;
-}
-
-use TeXLive::TLUtils qw(win32 mkdirhier copy conv_to_w32_path log debug info
- touch tlwarn);
-use TeXLive::TLWinGoo;
-use TeXLive::TLConfig;
-
-my $mainmenu = $TeXLive::TLConfig::WindowsMainMenuName;
-
-our %PostInstall;
-our %PostRemove;
-
-# xetex
-#
-sub do_install_xetex {
- my ($texdir, $texdirw, $texmfsysvar) = @_;
- #
- # bin-installs font-config related stuff
- #
- # new version according to Staszek
- if (!defined($texmfsysvar)) {
- $texmfsysvar = `kpsewhich -var-value=TEXMFSYSVAR`;
- chomp($texmfsysvar);
- }
- if (-r "$texdir/bin/win32/conf/fonts.conf") {
- # we have installed w32, so put it into texmfsysvar
- mkdirhier("$texmfsysvar/fonts");
- TeXLive::TLUtils::rmtree("$texmfsysvar/fonts/conf");
- TeXLive::TLUtils::rmtree("$texmfsysvar/fonts/cache");
- my @cpycmd;
- if (win32()) {
- push @cpycmd, "xcopy", "/e", "/i", "/q", "/y";
- } else {
- push @cpycmd, "cp", "-R";
- }
- system(@cpycmd,
- (win32() ? conv_to_w32_path("$texdir/bin/win32/conf") :
- "$texdir/bin/win32/conf"),
- (win32() ? conv_to_w32_path("$texmfsysvar/fonts/conf") :
- "$texmfsysvar/fonts/conf"));
- system(@cpycmd,
- (win32() ? conv_to_w32_path("$texdir/bin/win32/cache") :
- "$texdir/bin/win32/cache"),
- (win32() ? conv_to_w32_path("$texmfsysvar/fonts/cache") :
- "$texmfsysvar/fonts/cache"));
- if (open(FONTSCONF, "<$texdir/bin/win32/conf/fonts.conf")) {
- my @lines = <FONTSCONF>;
- close(FONTSCONF);
- if (open(FONTSCONF, ">$texmfsysvar/fonts/conf/fonts.conf")) {
- my $winfontdir;
- if (win32()) {
- $winfontdir = $ENV{'SystemRoot'}.'/fonts';
- $winfontdir =~ s!\\!/!g;
- #mkdirhier("$texmfsysvar/fonts/cache");
-
- # fc-cache breaks often on w32 in some strange way
- # there are claims that touching a font file in $winfontdir
- # would solve that problem. So lets touch some of them
- if (opendir (WINFONT, $winfontdir)) {
- my @dirents = readdir (WINFONT);
- closedir (WINFONT) || warn "closedir($winfontdir) failed: $!";
- # do not actually touch anything by now, maybe already the
- # opendir is enough ...
-
- # for my $dirent (@dirents) {
- # if ($dirent =~ m/\.(ttf|otf)$/i) {
- # touch("$winfontdir/$dirent");
- # tlwarn("touching $dirent in $winfontdir to make fc-cache work\n");
- # # one file touched should be enough
- # last;
- # }
- # }
- }
- }
- foreach (@lines) {
- $_ =~ s!c:/Program Files/texlive/$TeXLive::TLConfig::ReleaseYear!$texdir!;
- $_ =~ s!c:/windows/fonts!$winfontdir! if win32();
- # hack around fc-cache problem in from_dvd case:
- #if (win32() and (uc($texdir) ne uc($texdirw)) and
- # ($_ =~ m!^<dir>.*texmf-dist.*</dir>!)) { $_ = '<!-- '.$_.' -->'; }
- print FONTSCONF;
- }
- close(FONTSCONF);
- } else {
- warn("Cannot open $texmfsysvar/fonts/conf/fonts.conf for writing\n");
- }
- } else {
- warn("Cannot open $texdir/bin/win32/conf/fonts.conf\n");
- }
- }
- # call fc-cache but only when we install on w32!
- if (win32()) {
- info("Running fc-cache -v -r\n");
- log(`fc-cache -v -r 2>&1`);
- #system("fc-cache","-v", "-r");
- }
-}
-$PostInstall{"xetex"} = \&do_install_xetex;
-
-
-#
-# bin-texlive
-#
-sub do_install_bin_texlive {
- my ($texdir, $texdirw) = @_;
- if (win32()) {
- if (uc(TeXLive::TLWinGoo::win_which_dir('tex.exe')) ne
- uc($texdir.'/bin/win32') or
- uc(TeXLive::TLWinGoo::win_which_dir('pdftex.exe')) ne
- uc($texdir.'/bin/win32') or
- uc(TeXLive::TLWinGoo::win_which_dir('luatex.exe')) ne
- uc($texdir.'/bin/win32')) {
- my $texbindir = $texdir."\\bin\\win32";
- $texbindir =~ s!/!\\!g;
- add_menu_shortcut(
- $mainmenu,
- 'TeX Live Prompt',
- '',
- $ENV{'COMSPEC'},
- "/k \"path $texbindir;%path%\"",
- '',
- );
- add_desktop_shortcut(
- 'TeX Live Prompt',
- '',
- $ENV{'COMSPEC'},
- "/k \"path $texbindir;%path%\"",
- '',
- );
- }
- }
-}
-sub do_remove_bin_texlive {
- my ($texdir) = @_;
- if (win32()) {
- remove_menu_shortcut($mainmenu, 'TeX Live Prompt');
- remove_desktop_shortcut('TeX Live Prompt');
- }
-}
-$PostInstall{'bin-texlive'} = \&do_install_bin_texlive;
-$PostRemove{'bin-texlive'} = \&do_remove_bin_texlive;
-
-1;
-
-
-=head1 NAME
-
-C<TeXLive::TLPostActions> -- TeX Live Post Installation and Removal Routines
-
-=head1 SYNOPSIS
-
- use TeXLive::TLPostActions;
-
-=head1 DESCRIPTION
-
-The L<TeXLive::TLPostActions> module exports the C<%PostInstall> and
-the C<%PostRemove> hash indexed by package names providing code references.
-
-These code references are called with the root of the installation as
-argument (C<$SELFAUTOPARENT>). Additional arguments, but not necessarily
-present, are the value of C<TEXMFSYSVAR> and C<TEXMFLOCAL>.
-
-=head1 SEE ALSO
-
-The modules L<TeXLive::TLUtils>, L<TeXLive::TLPSRC>,
-L<TeXLive::TLPDB>, L<TeXLive::TLTREE>, L<TeXLive::TeXCatalogue>.
-
-=head1 AUTHORS AND COPYRIGHT
-
-This script and its documentation were written for the TeX Live
-distribution (L<http://tug.org/texlive>) and both are licensed under the
-GNU General Public License Version 2 or later.
-
-=cut
-
-### Local Variables:
-### perl-indent-level: 2
-### tab-width: 2
-### indent-tabs-mode: nil
-### End:
-# vim:set tabstop=2 expandtab: #
diff --git a/Master/tlpkg/tlpsrc/xetex.tlpsrc b/Master/tlpkg/tlpsrc/xetex.tlpsrc
index 2cc3f697e14..135b6016804 100644
--- a/Master/tlpkg/tlpsrc/xetex.tlpsrc
+++ b/Master/tlpkg/tlpsrc/xetex.tlpsrc
@@ -3,10 +3,6 @@ category TLCore
#
execute BuildFormat xetex
#
-# post actions
-postaction on
-runpattern f tlpkg/TeXLive/PostAction/xetex.pm
-#
runpattern f texmf/fmtutil/format.xetex.cnf
#
# these are only needed for darwin only, so