summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2009-05-06 16:39:27 +0000
committerNorbert Preining <preining@logic.at>2009-05-06 16:39:27 +0000
commitc41e74631517d76ded781bfa1177e5a3da87a0c4 (patch)
tree925be77ec7bfef52e5f273514e94fdc7bc60d82f
parent71837f5ba946a554b3e124791bd9750218509cb6 (diff)
get rid of TLPackageConfigurations and move it to tlpkg/tlpostcode/xetex.pl
git-svn-id: svn://tug.org/texlive/branches/branch2009-dev@12955 c570f23f-e606-0410-a88d-b1316a301751
-rwxr-xr-xMaster/install-tl16
-rwxr-xr-xMaster/texmf/scripts/texlive/tlmgr.pl1
-rw-r--r--Master/texmf/scripts/texlive/uninstall-win32.pl7
-rw-r--r--Master/tlpkg/TeXLive/TLMedia.pm10
-rw-r--r--Master/tlpkg/TeXLive/TLPackageConfigurations.pm157
-rw-r--r--Master/tlpkg/tlpostcode/xetex.pl78
6 files changed, 80 insertions, 189 deletions
diff --git a/Master/install-tl b/Master/install-tl
index d2c28b40db0..49f15288bfc 100755
--- a/Master/install-tl
+++ b/Master/install-tl
@@ -50,11 +50,10 @@ use TeXLive::TLUtils qw(platform platform_desc
get_system_tmpdir member process_logging_options rmtree
mkdirhier make_var_skeleton make_local_skeleton install_package copy
install_packages dirname setup_programs welcome welcome_paths);
-use TeXLive::TLMedia;
+#use TeXLive::TLMedia;
use TeXLive::TLPOBJ;
use TeXLive::TLPDB;
use TeXLive::TLConfig;
-use TeXLive::TLPackageConfigurations;
if (win32) {
require TeXLive::TLWinGoo;
@@ -710,19 +709,6 @@ operations might be disturbed.\n\n";
info("done\n");
}
- # 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
- # 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{$package}}($TEXDIR, $TEXDIRW, $TEXMFSYSVAR, $TEXMFLOCAL);
- }
- }
-
#
# do path adjustments: On Windows add/remove to PATH etc, on Unix
# set symlinks
diff --git a/Master/texmf/scripts/texlive/tlmgr.pl b/Master/texmf/scripts/texlive/tlmgr.pl
index 0b1f9620d91..5d6755aea4a 100755
--- a/Master/texmf/scripts/texlive/tlmgr.pl
+++ b/Master/texmf/scripts/texlive/tlmgr.pl
@@ -67,7 +67,6 @@ use TeXLive::TLConfig;
use TeXLive::TLMedia;
use TeXLive::TLPDB;
use TeXLive::TLPOBJ;
-use TeXLive::TLPackageConfigurations;
use TeXLive::TLUtils;
use TeXLive::TLWinGoo;
TeXLive::TLUtils->import(qw(member info give_ctan_mirror win32 dirname
diff --git a/Master/texmf/scripts/texlive/uninstall-win32.pl b/Master/texmf/scripts/texlive/uninstall-win32.pl
index 3aa3434a358..4c0e52bb7c9 100644
--- a/Master/texmf/scripts/texlive/uninstall-win32.pl
+++ b/Master/texmf/scripts/texlive/uninstall-win32.pl
@@ -19,7 +19,6 @@ BEGIN {
use TeXLive::TLWinGoo;
use TeXLive::TLPDB;
use TeXLive::TLPOBJ;
-use TeXLive::TLPackageConfigurations;
use TeXLive::TLConfig;
use TeXLive::TLUtils;
use Tk;
@@ -51,12 +50,8 @@ 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($PackageConfigRemove{$pkg})) {
- info("running post remove action for $pkg\n");
- &{$PackageConfigRemove{$pkg}}($Master);
- }
+ &TeXLive::TLUtils::do_postaction("remove", $pkg);
}
- &TeXLive::TLUtils::do_postaction("remove", $pkg);
}
my $menupath = &TeXLive::TLWinGoo::menu_path();
$menupath =~ s!/!\\!g;
diff --git a/Master/tlpkg/TeXLive/TLMedia.pm b/Master/tlpkg/TeXLive/TLMedia.pm
index e33d216cc02..260b7646cfe 100644
--- a/Master/tlpkg/TeXLive/TLMedia.pm
+++ b/Master/tlpkg/TeXLive/TLMedia.pm
@@ -8,7 +8,6 @@
package TeXLive::TLMedia;
use TeXLive::TLConfig;
-use TeXLive::TLPackageConfigurations;
use TeXLive::TLUtils qw(copy win32 dirname mkdirhier basename download_file
merge_into debug ddebug info tlwarn log);
use TeXLive::TLPDB;
@@ -202,10 +201,6 @@ sub install_package {
# compute the return value
my %ret;
merge_into(\%ret, $tlpobj->make_return_hash_from_executes("enable"));
- if (defined($PackageConfigInstall{$pkg})) {
- info("running post install action for $pkg\n");
- &{$PackageConfigInstall{$pkg}}($totlpdb->root);
- }
if (!$nopostinstall) {
# do the postinstallation actions
#
@@ -407,11 +402,6 @@ sub remove_package {
# disadvantage: removing a collection calls the save routine several times
# still I consider it better that the tlpdb is in a consistent state
$localtlpdb->save;
- # do the post removal actions
- if (defined($PackageConfigRemove{$pkg})) {
- info("running post remove action for $pkg\n");
- &{$PackageConfigRemove{$pkg}}($localtlpdb->root);
- }
#
# Run the post installation code in the postaction tlpsrc entries
# the postaction code part cannot be evaluated now since the
diff --git a/Master/tlpkg/TeXLive/TLPackageConfigurations.pm b/Master/tlpkg/TeXLive/TLPackageConfigurations.pm
deleted file mode 100644
index 6b6903b5a56..00000000000
--- a/Master/tlpkg/TeXLive/TLPackageConfigurations.pm
+++ /dev/null
@@ -1,157 +0,0 @@
-# $Id$
-# 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::TLPackageConfigurations;
-
-BEGIN {
- use Exporter ();
- use vars qw( @ISA @EXPORT_OK @EXPORT );
- @ISA = qw(Exporter);
- @EXPORT_OK = qw(
- %PackageConfigInstall
- %PackageConfigRemove
- );
- @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 %PackageConfigInstall;
-our %PackageConfigRemove;
-
-# 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");
- }
-}
-$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
-### indent-tabs-mode: nil
-### End:
-# vim:set tabstop=2 expandtab: #
diff --git a/Master/tlpkg/tlpostcode/xetex.pl b/Master/tlpkg/tlpostcode/xetex.pl
new file mode 100644
index 00000000000..5f0456ae24c
--- /dev/null
+++ b/Master/tlpkg/tlpostcode/xetex.pl
@@ -0,0 +1,78 @@
+# $Id: xetex.pl 12367 2009-03-11 16:18:41Z preining $
+# post action for xetex
+# Copyright 2008, 2009 Norbert Preining
+# This file is licensed under the GNU General Public License version 2
+# or any later version.
+
+my $texdir;
+my $mode;
+
+BEGIN {
+ $^W = 1;
+ $mode = $ARGV[0];
+ $texdir = $ARGV[1];
+ # make Perl find our packages first:
+ unshift (@INC, "$texdir/tlpkg");
+}
+
+use TeXLive::TLUtils qw(win32 mkdirhier conv_to_w32_path log info);
+
+#
+# bin-installs font-config related stuff
+my $texmfsysvar = `kpsewhich -var-value=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;
+ }
+ foreach (@lines) {
+ $_ =~ s!c:/Program Files/texlive/$TeXLive::TLConfig::ReleaseYear!$texdir!;
+ $_ =~ s!c:/windows/fonts!$winfontdir! if win32();
+ 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");
+}
+
+### Local Variables:
+### perl-indent-level: 2
+### tab-width: 2
+### indent-tabs-mode: nil
+### End:
+# vim:set tabstop=2 expandtab: #