summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2008-11-24 13:31:31 +0000
committerNorbert Preining <preining@logic.at>2008-11-24 13:31:31 +0000
commit159b0cf4cc1b07c22e91b9cbc53a28a9a534a5d4 (patch)
tree33fc01ef68c6187ae5f15b8a10f774c4b43d2591
parent1ae897274df13fe4bc0c3e06e77224d886706bb0 (diff)
remove included gui installer rework patch, add a new (heavy dev) patch
for postaction code in tlpsrc git-svn-id: svn://tug.org/texlive/trunk@11409 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/tlpkg/etc/dev.installer-gui-rework.diff300
-rw-r--r--Master/tlpkg/etc/dev.postaction-code-in-tlpsrc.patch309
2 files changed, 309 insertions, 300 deletions
diff --git a/Master/tlpkg/etc/dev.installer-gui-rework.diff b/Master/tlpkg/etc/dev.installer-gui-rework.diff
deleted file mode 100644
index 438a95cc570..00000000000
--- a/Master/tlpkg/etc/dev.installer-gui-rework.diff
+++ /dev/null
@@ -1,300 +0,0 @@
-Index: install-tl
-===================================================================
---- install-tl (revision 11304)
-+++ install-tl (working copy)
-@@ -268,10 +268,7 @@
-
- # $finished == 1 if the menu call already did the installation
- my $finished = 0;
--@::start_install_hook = ();
--@::end_install_hook = ();
--@::start_postinst_hook = ();
--@::start_install_hook = ();
-+@::info_hook = ();
-
- my $system_tmpdir=get_system_tmpdir();
- my $media;
-@@ -481,9 +478,6 @@
- sub do_installation {
- # do the actual installation
- my $h;
-- foreach $h (@::start_install_hook) {
-- &$h();
-- }
- prepare_installation();
- if (!$vars{'from_dvd'}) {
- calc_depends();
-@@ -518,9 +512,6 @@
- create_uninstaller($vars{'TEXDIR'}, $vars{'TEXDIRW'},
- $vars{'TEXMFSYSVAR'}, $vars{'TEXMFSYSCONFIG'});
- }
-- foreach $h (@::start_postinst_hook) {
-- &$h();
-- }
- do_postinst_stuff();
- # now we save every scheme that is fully covered by the stuff we have
- # installed to the $localtlpdb
-@@ -539,9 +530,6 @@
- }
- }
- $localtlpdb->save unless $vars{'from_dvd'};
-- foreach $h (@::end_install_hook) {
-- &$h();
-- }
- }
-
- sub dump_vars {
-Index: tlpkg/TeXLive/TLMedia.pm
-===================================================================
---- tlpkg/TeXLive/TLMedia.pm (revision 11304)
-+++ tlpkg/TeXLive/TLMedia.pm (working copy)
-@@ -117,9 +117,6 @@
- # even if opt_doc is false
- $real_opt_doc = 1;
- }
-- foreach my $h (@::install_packages_hook) {
-- &$h("install: $pkg");
-- }
- my $container;
- my @installfiles;
- my $location = $self->location;
-Index: tlpkg/TeXLive/TLUtils.pm
-===================================================================
---- tlpkg/TeXLive/TLUtils.pm (revision 11304)
-+++ tlpkg/TeXLive/TLUtils.pm (working copy)
-@@ -794,19 +794,56 @@
- my $totalnr = $#packs + 1;
- my $td = length("$totalnr");
- my $n = 0;
-+ my %tlpobjs;
-+ my $totalsize = 0;
-+ my $donesize = 0;
-+ my %tlpsizes;
-+ foreach my $p (@packs) {
-+ $tlpobjs{$p} = $fromtlpdb->get_package($p);
-+ if (!defined($tlpobjs{$p})) {
-+ die "STRANGE: $p not to be found in ", $fromtlpdb->root;
-+ }
-+ if ($media ne 'DVD') {
-+ # we use the container size as the measuring unit since probably
-+ # downloading will be the limiting factor
-+ $tlpsizes{$p} = $tlpobjs{$p}->containersize;
-+ } else {
-+ # we have to add the respective sizes, that is checking for
-+ # installation of src and doc file
-+ $tlpsizes{$p} = $tlpobjs{$p}->runsize;
-+ $tlpsizes{$p} += $tlpobjs{$p}->srcsize if $opt_src;
-+ $tlpsizes{$p} += $tlpobjs{$p}->docsize if $opt_doc;
-+ my %foo = %{$tlpobjs{$p}->binsize};
-+ for my $k (keys %foo) { $tlpsizes{$p} += $foo{$k}; }
-+ }
-+ $totalsize += $tlpsizes{$p};
-+ }
-+ my $starttime = time();
- foreach my $package (@packs) {
-- my $tlpobj=$fromtlpdb->get_package($package);
-- if (!defined($tlpobj)) {
-- die "STRANGE: $package not to be found in ", $fromtlpdb->root;
-+ my $tlpobj = $tlpobjs{$package};
-+ $n++;
-+ my $remtime = "??:??";
-+ my $tottime = "??:??";
-+ if ($donesize > 0) {
-+ # try to compute the remaining time
-+ my $curtime = time();
-+ my $passedtime = $curtime - $starttime;
-+ my $esttotalsecs = int ( ( $passedtime * $totalsize ) / $donesize );
-+ my $remsecs = $esttotalsecs - $passedtime;
-+ my $min = int($remsecs/60);
-+ my $sec = $remsecs % 60;
-+ $remtime = sprintf("%02d:%02d", $min, $sec);
-+ my $tmin = int($esttotalsecs/60);
-+ my $tsec = $esttotalsecs % 60;
-+ $tottime = sprintf("%02d:%02d", $tmin, $tsec);
- }
-- $n++;
- # here we could add more information, eg about timing and number
- # of bytes etc etc.
- # the size of the containers is present
-- my $infostr = sprintf("Installing [%0${td}d/$totalnr]: $package",$n);
-+ my $infostr = sprintf("Installing [%0${td}d/$totalnr, est. time remain/total: $remtime/$tottime]: $package",$n);
- info("$infostr\n");
- foreach my $h (@::install_packages_hook) {
-- &$h($infostr);
-+ &$h($n,$totalnr);
- }
- my $real_opt_doc = $opt_doc;
- # if we install a package from the Documentation class we
-@@ -877,7 +914,13 @@
- die("Cannot open tlpobj file for ".$tlpobj->name);
- $tlpobj->writeout(\*TMP);
- close(TMP);
-+ $donesize += $tlpsizes{$package};
- }
-+ my $totaltime = time() - $starttime;
-+ my $totmin = int ($totaltime/60);
-+ my $totsec = $totaltime % 60;
-+ info(sprintf("Time used for installing the packages: %02d:%02d\n",
-+ $totmin, $totsec));
- $totlpdb->save;
- }
-
-@@ -1523,7 +1566,12 @@
- =cut
-
- sub info {
-- logit(\*STDOUT, 0, @_);
-+ my $str = shift;
-+ logit(\*STDOUT, 0, $str);
-+ chomp($str);
-+ for my $i (@::info_hook) {
-+ &{$i}($str);
-+ }
- }
-
- =pod
-Index: tlpkg/installer/install-menu-perltk.pl
-===================================================================
---- tlpkg/installer/install-menu-perltk.pl (revision 11304)
-+++ tlpkg/installer/install-menu-perltk.pl (working copy)
-@@ -36,6 +36,9 @@
- require Tk::Dialog;
- require Tk::DialogBox;
- require Tk::PNG;
-+require Tk::ROText;
-+require Tk::ProgressBar;
-+
- if ($::alternative_selector) {
- require Tk::DirTree;
- }
-@@ -100,29 +103,26 @@
- my $optsrcstate;
- my $optdocstate;
-
--push @::start_install_hook,
-- sub {
-- update_statusbar("Starting installation");
-+push @::info_hook,
-+ sub {
-+ update_status(join(" ",@_));
- $mainwindow->update;
- };
--push @::start_postinst_hook,
-- sub {
-- update_statusbar("Starting post-installation Jobs");
-- $mainwindow->update;
-- };
--push @::end_install_hook,
-- sub {
-- update_statusbar("Installation finished");
-- $mainwindow->update;
-- };
-+push @::install_packages_hook, \&update_progressbar;
-+push @::install_packages_hook,
-+ sub { $mainwindow->update; $::sww->update; };
-
--push @::install_packages_hook, \&update_statusbar;
--push @::install_packages_hook, sub { $mainwindow->update; };
--
--sub update_statusbar {
-- my $p = shift;
-- $::statusbar->configure(-text => "$p");
-+sub update_status {
-+ my ($p) = @_;
-+ $::progressw->insert("end", "$p\n");
-+ $::progressw->see("end");
- }
-+sub update_progressbar {
-+ my ($n,$total) = @_;
-+ if (defined($n) && defined($total)) {
-+ $::progress->value(int($n*100/$total));
-+ }
-+}
-
- my %text = ( title => 'TeX Live 2008 Installation',
- basicinfo => 'Basic Information',
-@@ -369,32 +369,15 @@
- my $f3 = $fr->Frame;
- $f3->Button(
- -text => $text{'install'},
-- -command => sub { do_installation();
-- $return = $MENU_ALREADYDONE;
-- my $t = $text{'finished'};
-- if (!win32()) {
-- $t .= "\n\n$text{'finishedpath'}";
-- }
-- $t .= "\n\n$text{'welcome'}";
-- $t =~ s/TEXDIR/$::vars{'TEXDIR'}/g;
-- $t =~ s/PLATFORM/$::vars{'this_platform'}/g;
-- $t =~ s/\\n/\n/g;
-- my $sw = $mainwindow->DialogBox(-title => $text{'finbut'}, -buttons => [ $text{'finbut'} ]);
-- $sw->add("Label", -text => $t)->pack;
-- $sw->Show;
-- #$fr->Dialog(-text => $t, -buttons => [ $text{'finbut'} ])->Show;
-- $mainwindow->destroy },
-- )->pack(-side => 'left');
-+ -command => sub { installation_window(); }
-+ )->pack(-side => 'left', -padx => "2m", -pady => "2m");
- my $quitbutton = $f3->Button(
- -text => $text{'quit'},
- -command => sub { $return = $MENU_ABORT; $mainwindow->destroy }
-- )->pack(-side => 'right');
-+ )->pack(-side => 'right', -padx => "2m", -pady => "2m");
- $mw->bind('<Escape>', [ $quitbutton, 'Invoke' ]);
- $row++;
- $f3->grid(-row => $row, -column => 1, -columnspan => 3);
-- $::statusbar = $fr->Label(-text => $text{'status'});
-- $row++;
-- $::statusbar->grid(-row => $row, -column => 1, -columnspan => 3);
- menu_update_texts();
- $fr->gridColumnconfigure(2, -minsize => 300);
- $mw->pack(-expand => 1, -fill => "both");
-@@ -415,6 +398,48 @@
- return($return);
- }
-
-+sub installation_window {
-+ # create a progress bar window
-+ $::sww = $mainwindow->Toplevel(-title => "installation process",
-+ -width => 400);
-+ $::sww->transient($mainwindow);
-+ $::sww->grab();
-+ $::sww->Label(-text => "Installation process")->pack;
-+ $::progressw = $::sww->Scrolled("ROText", -scrollbars => "e", -height => 16);
-+ $::progressw->pack(-expand => 1, -fill => "both");
-+ my $percent_done = 0;
-+ $::progress = $::sww->ProgressBar(-variable => \$percent_done,
-+ -width => 20, -length => 400, -from => 0, -to => 100, -blocks => 10,
-+ -colors => [ 0, '#0078b8' ]);
-+ $::progress->pack(-fill => "x");
-+ my $f = $::sww->Frame;
-+ my $b = $f->Button(-text => $text{'cancel'},
-+ -command => sub { $::sww->destroy; $mainwindow->destroy;
-+ do_cleanup(); exit(1); }
-+ )->pack(-pady => "2m");
-+ $f->pack;
-+ do_installation();
-+ $return = $MENU_ALREADYDONE;
-+ my $t = $text{'finished'};
-+ if (!win32()) {
-+ $t .= "\n\n$text{'finishedpath'}";
-+ }
-+ $t .= "\n\n$text{'welcome'}";
-+ $t =~ s/TEXDIR/$::vars{'TEXDIR'}/g;
-+ $t =~ s/PLATFORM/$::vars{'this_platform'}/g;
-+ $t =~ s/\\n/\n/g;
-+ $::progressw->insert("end", "\n");
-+ my $linechar = $::progressw->index("end");
-+ $::progressw->markSet("finaltext", $linechar);
-+ $::progressw->markGravity("finaltext", "left");
-+ $::progressw->insert("end", "\n$t");
-+ $::progressw->see("end");
-+ $::progressw->tagAdd("centered", $linechar, "end");
-+ $::progressw->tagConfigure("centered", -justify => "center");
-+ $b->configure(-text => $text{'finbut'},
-+ -command => sub { $mainwindow->destroy; });
-+}
-+
- sub menu_edit_texdir {
- my $key = shift;
- our $addyear = 1;
diff --git a/Master/tlpkg/etc/dev.postaction-code-in-tlpsrc.patch b/Master/tlpkg/etc/dev.postaction-code-in-tlpsrc.patch
new file mode 100644
index 00000000000..a8bf9cdc332
--- /dev/null
+++ b/Master/tlpkg/etc/dev.postaction-code-in-tlpsrc.patch
@@ -0,0 +1,309 @@
+Index: install-tl
+===================================================================
+--- install-tl (revision 11393)
++++ install-tl (working copy)
+@@ -59,12 +59,12 @@
+ which getenv win32 unix info log debug tlwarn ddebug
+ get_system_tmpdir member process_logging_options rmtree
+ mkdirhier make_var_skeleton make_local_skeleton install_package copy
++ run_postinst_code
+ install_packages dirname setup_programs welcome welcome_paths);
+ use TeXLive::TLMedia;
+ use TeXLive::TLPOBJ;
+ use TeXLive::TLPDB;
+ use TeXLive::TLConfig;
+-use TeXLive::TLPostActions;
+ use Pod::Usage;
+ use Cwd 'abs_path';
+
+@@ -1034,13 +1034,15 @@
+ }
+
+ 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);
++ if ($install{$package}) {
++ my $tlpobj = $tlpdb->get_package($package);
++ next if (!defined($tlpobj)); # should not happen ...
++ run_postinst_code($tlpobj, $TEXDIR, $TEXDIRW, $TEXMFSYSVAR, $TEXMFLOCAL);
+ }
+ }
+ # $opt_portable: no %install but we still want xetex postinstall
+- &{$PostInstall{'xetex'}}($TEXDIR, $TEXDIRW, $TEXMFSYSVAR, $TEXMFLOCAL)
++ run_postinst_code($tlpdb->get_package("xetex"),
++ $TEXDIR, $TEXDIRW, $TEXMFSYSVAR, $TEXMFLOCAL)
+ if $opt_portable;
+ update_assocs() if win32();
+
+Index: tlpkg/TeXLive/TLPSRC.pm
+===================================================================
+--- tlpkg/TeXLive/TLPSRC.pm (revision 11393)
++++ tlpkg/TeXLive/TLPSRC.pm (working copy)
+@@ -30,6 +30,8 @@
+ srcpatterns => $params{'srcpatterns'},
+ docpatterns => $params{'docpatterns'},
+ binpatterns => $params{'binpatterns'},
++ postinst => $params{'postinst'},
++ postrm => $params{'postrm'},
+ executes => defined($params{'executes'}) ? $params{'executes'} : [],
+ depends => defined($params{'depends'}) ? $params{'depends'} : [],
+ };
+@@ -65,6 +67,8 @@
+ my $shortdesc = "";
+ my $longdesc= "";
+ my $catalogue = "";
++ my $postinst = "";
++ my $postrm = "";
+ my (@executes, @depends);
+ my (@runpatterns, @docpatterns, @binpatterns, @srcpatterns);
+ my $started = 0;
+@@ -114,6 +118,12 @@
+ } elsif ($line =~ /^catalogue\s+(.*)\s*$/) {
+ $catalogue = $1;
+ next;
++ } elsif ($line =~ /^postinst\s+(.*)\s*$/) {
++ $postinst = $1;
++ next;
++ } elsif ($line =~ /^postrm\s+(.*)\s*$/) {
++ $postrm = $1;
++ next;
+ } elsif ($line =~ /^runpattern\s+(.*)\s*$/) {
+ push @runpatterns, $1 if ($1 ne "");
+ next;
+@@ -143,6 +153,8 @@
+ $self->catalogue($catalogue) if $catalogue;
+ $self->shortdesc($shortdesc) if $shortdesc;
+ $self->longdesc($longdesc) if $longdesc;
++ $self->postinst($postinst) if $postinst;
++ $self->postrm($postrm) if $postrm;
+ $self->srcpatterns(@srcpatterns) if @srcpatterns;
+ $self->runpatterns(@runpatterns) if @runpatterns;
+ $self->binpatterns(@binpatterns) if @binpatterns;
+@@ -161,6 +173,8 @@
+ print $fd "category ", $self->category, "\n";
+ defined($self->{'catalogue'}) && print $fd "catalogue $self->{'catalogue'}\n";
+ defined($self->{'shortdesc'}) && print $fd "shortdesc $self->{'shortdesc'}\n";
++ defined($self->{'postinst'}) && print $fd "postinst $self->{'postinst'}\n";
++ defined($self->{'postrm'}) && print $fd "postrm $self->{'postrm'}\n";
+ if (defined($self->{'longdesc'})) {
+ $_tmp = "$self->{'longdesc'}";
+ write $fd;
+@@ -211,6 +225,8 @@
+ $tlp->category($self->category);
+ $tlp->shortdesc($self->{'shortdesc'}) if (defined($self->{'shortdesc'}));
+ $tlp->longdesc($self->{'longdesc'}) if (defined($self->{'longdesc'}));
++ $tlp->postinst($self->{'postinst'}) if (defined($self->{'postinst'}));
++ $tlp->postrm($self->{'postrm'}) if (defined($self->{'postrm'}));
+ $tlp->catalogue($self->{'catalogue'}) if (defined($self->{'catalogue'}));
+ $tlp->executes(@{$self->{'executes'}}) if (defined($self->{'executes'}));
+ $tlp->depends(@{$self->{'depends'}}) if (defined($self->{'depends'}));
+@@ -476,6 +492,16 @@
+ if (@_) { $self->{'longdesc'} = shift }
+ return $self->{'longdesc'};
+ }
++sub postinst {
++ my $self = shift;
++ if (@_) { $self->{'postinst'} = shift }
++ return $self->{'postinst'};
++}
++sub postrm {
++ my $self = shift;
++ if (@_) { $self->{'postrm'} = shift }
++ return $self->{'postrm'};
++}
+ sub catalogue {
+ my $self = shift;
+ if (@_) { $self->{'catalogue'} = shift }
+@@ -566,6 +592,7 @@
+ I<key> I<value>
+
+ where I<key> can be C<name>, C<category>, C<shortdesc>, C<longdesc>,
++C<postinst>, C<postrm>,
+ C<catalogue>, C<runpattern>, C<srcpattern>, C<docpattern>, C<binpattern>,
+ C<execute>, or C<depend>.
+
+@@ -691,6 +718,18 @@
+ concatenated into a long text. In TeX Live only used for collections and
+ schemes.
+
++=item C<postinst>
++
++a perl sub definition that does not contain the surrounding sub { ... }
++part. This stub will be evaluated after installation of the package.
++Please see the examples in various .tlpsrc files.
++
++=item C<postrm>
++
++a perl sub definition that does not contain the surrounding sub { ... }
++part. This stub will be evaluated after removal of the package.
++Please see the examples in various .tlpsrc files.
++
+ =item C<depend>
+
+ gives the list of dependencies, which are just other package names.
+Index: tlpkg/TeXLive/TLPOBJ.pm
+===================================================================
+--- tlpkg/TeXLive/TLPOBJ.pm (revision 11393)
++++ tlpkg/TeXLive/TLPOBJ.pm (working copy)
+@@ -24,6 +24,8 @@
+ category => defined($params{'category'}) ? $params{'category'} : $DefaultCategory,
+ shortdesc => $params{'shortdesc'},
+ longdesc => $params{'longdesc'},
++ postinst => $params{'postinst'},
++ postrm => $params{'postrm'},
+ catalogue => $params{'catalogue'},
+ runfiles => defined($params{'runfiles'}) ? $params{'runfiles'} : [],
+ runsize => $params{'runsize'},
+@@ -198,6 +200,14 @@
+ $self->catalogue("$1");
+ $lastcmd = "catalogue";
+ next;
++ } elsif ($line =~ /^postinst\s+(.*)\s*/o) {
++ $self->postinst("$1");
++ $lastcmd = "postinst";
++ next;
++ } elsif ($line =~ /^postrm\s+(.*)\s*/o) {
++ $self->postrm("$1");
++ $lastcmd = "postrm";
++ next;
+ } elsif ($line =~ /^(doc|src|run)files\s+/o) {
+ my $type = $1;
+ my @words = split ' ',$line;
+@@ -301,6 +311,8 @@
+ defined($self->{'revision'}) && print $fd "revision $self->{'revision'}\n";
+ defined($self->{'catalogue'}) && print $fd "catalogue $self->{'catalogue'}\n";
+ defined($self->{'shortdesc'}) && print $fd "shortdesc $self->{'shortdesc'}\n";
++ defined($self->{'postinst'}) && print $fd "postinst $self->{'postinst'}\n";
++ defined($self->{'postrm'}) && print $fd "postrm $self->{'postrm'}\n";
+ defined($self->{'license'}) && print $fd "license $self->{'license'}\n";
+ # ugly hack to get rid of use FileHandle; see man perlform
+ #format_name $fd "multilineformat";
+@@ -823,6 +835,16 @@
+ if (@_) { $self->{'longdesc'} = shift }
+ return $self->{'longdesc'};
+ }
++sub postinst {
++ my $self = shift;
++ if (@_) { $self->{'postinst'} = shift }
++ return $self->{'postinst'};
++}
++sub postrm {
++ my $self = shift;
++ if (@_) { $self->{'postrm'} = shift }
++ return $self->{'postrm'};
++}
+ sub revision {
+ my $self = shift;
+ if (@_) { $self->{'revision'} = shift }
+Index: tlpkg/TeXLive/TLUtils.pm
+===================================================================
+--- tlpkg/TeXLive/TLUtils.pm (revision 11393)
++++ tlpkg/TeXLive/TLUtils.pm (working copy)
+@@ -64,6 +64,8 @@
+ TeXLive::TLUtils::conv_to_w32_path($path);
+ TeXLive::TLUtils::give_ctan_mirror($path);
+ TeXLive::TLUtils::tlmd5($path);
++ TeXLive::TLUtils::run_postinst_code($tlpobj, @args);
++ TeXLive::TLUtils::run_postrm_code($tlpobj, @args);
+
+ =head1 DESCRIPTION
+
+@@ -112,6 +114,8 @@
+ &welcome_paths
+ &give_ctan_mirror
+ &tlmd5
++ &run_postinst_code
++ &run_postrm_code
+ );
+ @EXPORT = qw(setup_programs download_file info log debug ddebug dddebug
+ tlwarn process_logging_options win32);
+@@ -1924,6 +1928,26 @@
+ }
+ }
+
++sub run_postinst_code {
++ my $tlpobj = shift;
++ _run_code_block($tlpobj->postinst, @_) if $tlpobj->postinst;
++}
++
++sub run_postrm_code {
++ my $tlpobj = shift;
++ _run_code_block($tlpobj->postrm, @_) if $tlpobj->postrm;
++}
++
++sub _run_code_block {
++ my $code = shift;
++ my $fun = "sub temp_fun_texlive_run_code_block { $code } ";
++ eval $fun;
++ my $ret = eval { temp_fun_texlive_run_code_block(@_); };
++ undef &temp_fun_texlive_run_code_block;
++ return $ret;
++}
++
++
+ #############################################
+ #
+ # Taken from Text::ParseWords
+Index: tlpkg/tlpsrc/xetex.tlpsrc
+===================================================================
+--- tlpkg/tlpsrc/xetex.tlpsrc (revision 11393)
++++ tlpkg/tlpsrc/xetex.tlpsrc (working copy)
+@@ -23,4 +23,56 @@
+ binpattern f bin/win32/fc-*
+ binpattern f bin/win32/icu*.dll
+ depend xetexconfig
+-
++postinst \
++ my ($texdir, $texdirw, $texmfsysvar) = @_; \
++ if (!defined($texmfsysvar)) { \
++ $texmfsysvar = `kpsewhich -var-value=TEXMFSYSVAR`; \
++ chomp($texmfsysvar); \
++ } \
++ if (-r "$texdir/bin/win32/conf/fonts.conf") { \
++ 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/2008!$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"); \
++ } \
++ } \
++ if (win32()) { \
++ info("Running fc-cache -v -r\n"); \
++ log(`fc-cache -v -r 2>&1`); \
++ }