From 7e5585bcd4f8ba119cad8f0a7e13b6a7a610776f Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Tue, 12 May 2009 15:53:11 +0000 Subject: Move most of the stuff from tlpkg, tlmgr from branch to trunk git-svn-id: svn://tug.org/texlive/trunk@13054 c570f23f-e606-0410-a88d-b1316a301751 --- Master/install-tl | 799 ++++++++++++--------- Master/install-tl.bat | 108 +-- Master/texmf/scripts/texlive/tlmgr.pl | 196 ++--- .../texmf/scripts/texlive/tlmgrgui/do_listframe.pl | 3 +- Master/texmf/scripts/texlive/tlmgrgui/gui-arch.pl | 3 +- .../texmf/scripts/texlive/tlmgrgui/gui-config.pl | 27 +- .../scripts/texlive/tlmgrgui/gui-uninstall.pl | 3 +- Master/texmf/scripts/texlive/tlmgrgui/tlmgrgui.pl | 57 +- Master/texmf/scripts/texlive/uninstall-win32.pl | 17 + Master/tlpkg/TeXLive/TLConfig.pm | 28 +- Master/tlpkg/TeXLive/TLMedia.pm | 229 ++++-- Master/tlpkg/TeXLive/TLPDB.pm | 187 +++-- Master/tlpkg/TeXLive/TLPOBJ.pm | 168 +++-- Master/tlpkg/TeXLive/TLPSRC.pm | 71 +- Master/tlpkg/TeXLive/TLTREE.pm | 10 +- Master/tlpkg/TeXLive/TLUtils.pm | 399 ++++++++-- Master/tlpkg/TeXLive/TLWinGoo.pm | 48 +- Master/tlpkg/bin/check-duplicated-runfiles | 6 +- Master/tlpkg/bin/check-tlnet-consistency | 22 +- Master/tlpkg/bin/tl-fix-container-infos | 14 +- Master/tlpkg/bin/tl-makeself-from-tlnet | 20 +- Master/tlpkg/bin/tl-update-containers | 57 +- Master/tlpkg/bin/tl-update-nsis | 12 +- Master/tlpkg/bin/tl-update-tlcritical | 2 +- Master/tlpkg/bin/tlpfiles | 3 +- Master/tlpkg/bin/tlpkg-by-size | 6 +- Master/tlpkg/bin/tlpkg-ctan-check | 3 +- Master/tlpkg/bin/tlprm | 3 +- Master/tlpkg/installer/install-menu-perltk.pl | 28 +- Master/tlpkg/installer/install-menu-text.pl | 142 ++-- Master/tlpkg/installer/install-translations.pl | 9 +- Master/tlpkg/installer/lang/perltk-cs | 2 +- Master/tlpkg/installer/lang/perltk-de | 2 +- Master/tlpkg/installer/lang/perltk-en.sample | 2 +- Master/tlpkg/installer/lang/perltk-fr | 2 +- Master/tlpkg/installer/lang/perltk-it | 2 +- Master/tlpkg/installer/lang/perltk-nl | 2 +- Master/tlpkg/installer/lang/perltk-pl | 2 +- Master/tlpkg/installer/lang/perltk-sl | 2 +- Master/tlpkg/installer/lang/perltk-vi | 2 +- Master/tlpkg/installer/lang/perltk-zh-cn | 2 +- Master/tlpkg/installer/lang/perltk-zh-tw | 2 +- Master/tlpkg/installer/lzma/lzma.alpha-linux | Bin 120888 -> 0 bytes Master/tlpkg/installer/lzma/lzma.amd64-freebsd | Bin 107048 -> 0 bytes Master/tlpkg/installer/lzma/lzma.exe | Bin 69632 -> 0 bytes Master/tlpkg/installer/lzma/lzma.hppa-hpux | Bin 164818 -> 0 bytes Master/tlpkg/installer/lzma/lzma.i386-freebsd | Bin 103456 -> 0 bytes Master/tlpkg/installer/lzma/lzma.i386-linux | Bin 78568 -> 0 bytes Master/tlpkg/installer/lzma/lzma.i386-openbsd | Bin 100148 -> 0 bytes Master/tlpkg/installer/lzma/lzma.i386-solaris | Bin 133140 -> 0 bytes Master/tlpkg/installer/lzma/lzma.mips-irix | Bin 204388 -> 0 bytes Master/tlpkg/installer/lzma/lzma.powerpc-aix | Bin 207772 -> 0 bytes Master/tlpkg/installer/lzma/lzma.powerpc-linux | Bin 113260 -> 0 bytes Master/tlpkg/installer/lzma/lzma.sparc-linux | Bin 102072 -> 0 bytes Master/tlpkg/installer/lzma/lzma.sparc-solaris | Bin 141340 -> 0 bytes Master/tlpkg/installer/lzma/lzma.universal-darwin | Bin 578644 -> 0 bytes Master/tlpkg/installer/lzma/lzma.x86_64-linux | Bin 97648 -> 0 bytes Master/tlpkg/installer/lzma/lzmadec.alpha-linux | Bin 14320 -> 0 bytes Master/tlpkg/installer/lzma/lzmadec.amd64-freebsd | Bin 12456 -> 0 bytes Master/tlpkg/installer/lzma/lzmadec.hppa-hpux | Bin 24691 -> 0 bytes Master/tlpkg/installer/lzma/lzmadec.i386-freebsd | Bin 10596 -> 0 bytes Master/tlpkg/installer/lzma/lzmadec.i386-linux | Bin 10032 -> 0 bytes Master/tlpkg/installer/lzma/lzmadec.i386-openbsd | Bin 10404 -> 0 bytes Master/tlpkg/installer/lzma/lzmadec.i386-solaris | Bin 10956 -> 0 bytes Master/tlpkg/installer/lzma/lzmadec.mips-irix | Bin 19580 -> 0 bytes Master/tlpkg/installer/lzma/lzmadec.powerpc-aix | Bin 11099 -> 0 bytes Master/tlpkg/installer/lzma/lzmadec.powerpc-linux | Bin 13984 -> 0 bytes Master/tlpkg/installer/lzma/lzmadec.sparc-linux | Bin 10876 -> 0 bytes Master/tlpkg/installer/lzma/lzmadec.sparc-solaris | Bin 15152 -> 0 bytes .../tlpkg/installer/lzma/lzmadec.universal-darwin | Bin 46664 -> 0 bytes Master/tlpkg/installer/lzma/lzmadec.win32.exe | Bin 12288 -> 0 bytes Master/tlpkg/installer/lzma/lzmadec.x86_64-linux | Bin 14728 -> 0 bytes Master/tlpkg/installer/xz/xz.exe | Bin 0 -> 172032 bytes Master/tlpkg/installer/xz/xz.i386-cygwin.exe | Bin 0 -> 145408 bytes Master/tlpkg/installer/xz/xz.i386-linux | Bin 0 -> 474281 bytes Master/tlpkg/installer/xz/xz.universal-darwin | Bin 0 -> 310348 bytes Master/tlpkg/installer/xz/xz.x86_64-linux | Bin 0 -> 157728 bytes Master/tlpkg/installer/xz/xzdec.exe | Bin 0 -> 77824 bytes Master/tlpkg/installer/xz/xzdec.i386-cygwin.exe | Bin 0 -> 70656 bytes Master/tlpkg/installer/xz/xzdec.i386-linux | Bin 0 -> 221414 bytes Master/tlpkg/installer/xz/xzdec.universal-darwin | Bin 0 -> 161716 bytes Master/tlpkg/installer/xz/xzdec.x86_64-linux | Bin 0 -> 72528 bytes .../tlpsrc/00texlive-installation.config.tlpsrc | 30 - Master/tlpkg/tlpsrc/00texlive.config.tlpsrc | 10 +- Master/tlpkg/tlpsrc/00texlive.core.tlpsrc | 2 +- Master/tlpkg/tlpsrc/00texlive.installation.tlpsrc | 34 + Master/tlpkg/tlpsrc/00texlive.installer.tlpsrc | 16 +- 87 files changed, 1788 insertions(+), 1006 deletions(-) delete mode 100755 Master/tlpkg/installer/lzma/lzma.alpha-linux delete mode 100755 Master/tlpkg/installer/lzma/lzma.amd64-freebsd delete mode 100644 Master/tlpkg/installer/lzma/lzma.exe delete mode 100755 Master/tlpkg/installer/lzma/lzma.hppa-hpux delete mode 100755 Master/tlpkg/installer/lzma/lzma.i386-freebsd delete mode 100755 Master/tlpkg/installer/lzma/lzma.i386-linux delete mode 100755 Master/tlpkg/installer/lzma/lzma.i386-openbsd delete mode 100755 Master/tlpkg/installer/lzma/lzma.i386-solaris delete mode 100755 Master/tlpkg/installer/lzma/lzma.mips-irix delete mode 100755 Master/tlpkg/installer/lzma/lzma.powerpc-aix delete mode 100755 Master/tlpkg/installer/lzma/lzma.powerpc-linux delete mode 100755 Master/tlpkg/installer/lzma/lzma.sparc-linux delete mode 100755 Master/tlpkg/installer/lzma/lzma.sparc-solaris delete mode 100755 Master/tlpkg/installer/lzma/lzma.universal-darwin delete mode 100755 Master/tlpkg/installer/lzma/lzma.x86_64-linux delete mode 100755 Master/tlpkg/installer/lzma/lzmadec.alpha-linux delete mode 100755 Master/tlpkg/installer/lzma/lzmadec.amd64-freebsd delete mode 100755 Master/tlpkg/installer/lzma/lzmadec.hppa-hpux delete mode 100755 Master/tlpkg/installer/lzma/lzmadec.i386-freebsd delete mode 100755 Master/tlpkg/installer/lzma/lzmadec.i386-linux delete mode 100755 Master/tlpkg/installer/lzma/lzmadec.i386-openbsd delete mode 100755 Master/tlpkg/installer/lzma/lzmadec.i386-solaris delete mode 100755 Master/tlpkg/installer/lzma/lzmadec.mips-irix delete mode 100755 Master/tlpkg/installer/lzma/lzmadec.powerpc-aix delete mode 100755 Master/tlpkg/installer/lzma/lzmadec.powerpc-linux delete mode 100755 Master/tlpkg/installer/lzma/lzmadec.sparc-linux delete mode 100755 Master/tlpkg/installer/lzma/lzmadec.sparc-solaris delete mode 100755 Master/tlpkg/installer/lzma/lzmadec.universal-darwin delete mode 100755 Master/tlpkg/installer/lzma/lzmadec.win32.exe delete mode 100755 Master/tlpkg/installer/lzma/lzmadec.x86_64-linux create mode 100755 Master/tlpkg/installer/xz/xz.exe create mode 100755 Master/tlpkg/installer/xz/xz.i386-cygwin.exe create mode 100755 Master/tlpkg/installer/xz/xz.i386-linux create mode 100755 Master/tlpkg/installer/xz/xz.universal-darwin create mode 100755 Master/tlpkg/installer/xz/xz.x86_64-linux create mode 100755 Master/tlpkg/installer/xz/xzdec.exe create mode 100755 Master/tlpkg/installer/xz/xzdec.i386-cygwin.exe create mode 100755 Master/tlpkg/installer/xz/xzdec.i386-linux create mode 100755 Master/tlpkg/installer/xz/xzdec.universal-darwin create mode 100755 Master/tlpkg/installer/xz/xzdec.x86_64-linux delete mode 100644 Master/tlpkg/tlpsrc/00texlive-installation.config.tlpsrc create mode 100644 Master/tlpkg/tlpsrc/00texlive.installation.tlpsrc (limited to 'Master') diff --git a/Master/install-tl b/Master/install-tl index 073061c4f10..ecc989cce22 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::TLPostActions; if (win32) { require TeXLive::TLWinGoo; @@ -82,7 +81,6 @@ if (win32) { &add_menu_shortcut &remove_desktop_shortcut &remove_menu_shortcut - &init_unshortbat &create_uninstaller )); } @@ -121,7 +119,7 @@ our @collections_lang_doc; # # The following values are taken from the remote tlpdb using the # $tlpdb->option_XXXXX -# settings (i.e., taken from tlpkg/tlpsrc/00texlive-installation.tlpsrc +# settings (i.e., taken from tlpkg/tlpsrc/00texlive.installation.tlpsrc # # 'option_symlinks' => 0, # 'sys_bin' => '/usr/local/bin', @@ -146,7 +144,7 @@ our %vars=( # 'n_' means 'number of'. # option handling my $opt_from_dvd = ""; -my $opt_gui = (win32() ? "perltk" : "text"); +my $opt_gui = (win32() ? "wizard" : "text"); my $opt_help = 0; my $opt_location = ""; my $opt_no_gui = 0; @@ -256,6 +254,7 @@ if ($opt_nonadmin and win32()) { # media, while $localtlpdb is for the new installation # $tlpdb must be our because it is used in install-menu-text.pl our $tlpdb; +our $previoustlpdb; my $localtlpdb; my $location; @@ -380,6 +379,14 @@ if (($media eq "NET") || ($media eq "CD")) { $vars{'doc_splitting_supported'} = $tlpdb->config_doc_container; } $texlive_release = $tlpdb->config_release; +# if the release from the remote TLPDB does not agree with the +# TLConfig::ReleaseYear in the first 4 places break out here. +# Why only the first four places: some optional network distributions +# might use +# release/2009-foobar +if ($texlive_release !~ m/^$TeXLive::TLConfig::ReleaseYear/) { + die "The release version of the installation source and\nthe installation media do not agree:\nsource: $texlive_release\nmedia: $TeXLive::TLConfig::ReleaseYear\nPlease report to tex-live\@tug.org"; +} set_platforms_supported(); set_texlive_default_dirs(); initialize_collections(); @@ -437,9 +444,29 @@ if ($opt_profile eq "") { require("installer/install-menu-text.pl"); } + # before we start the installation we check for the existence of + # a previous installation, and in case we ship inform the UI + { + my $tlmgrwhich = which("tlmgr"); + if ($tlmgrwhich) { + my $dn = dirname($tlmgrwhich); + $dn = abs_path("$dn/../.."); + my $tlpdboldpath = "$dn/$TeXLive::TLConfig::InfraLocation/$TeXLive::TLConfig::DatabaseName"; + if (-r $tlpdboldpath) { + # we found an old installation, so read that one in and save + # the list installed collections into an array. + $previoustlpdb = TeXLive::TLPDB->new(root => $dn); + if ($previoustlpdb) { + debug ("found old installation in $dn\n"); + push @runargs, "-old-installation-found"; + } + } + } + } + my $ret = &{$::run_menu}(@runargs); if ($ret == $MENU_QUIT) { - do_cleanup(); MISSING + do_cleanup(); flushlog(); exit(1); } @@ -483,6 +510,10 @@ exit(0); ################################################################### sub do_installation { + if (win32()) { + debug("Switching to non-admin mode due to explict user request!\n"); + non_admin() if !$vars{'option_w32_multi_user'}; + } # do the actual installation my $h; prepare_installation(); @@ -491,7 +522,233 @@ sub do_installation { save_options_into_tlpdb(); do_install_packages(); } + # now we save every scheme that is fully covered by the stuff we have + # installed to the $localtlpdb + foreach my $s ($tlpdb->schemes) { + my $stlp = $tlpdb->get_package($s); + die ("That cannot happen, $s not defined in tlpdb") unless defined($stlp); + my $incit = 1; + foreach my $d ($stlp->depends) { + if (!defined($localtlpdb->get_package($d))) { + $incit = 0; + last; + } + } + if ($incit) { + $localtlpdb->add_tlpobj($stlp); + } + } + $localtlpdb->save unless $vars{'from_dvd'}; + do_postinst_stuff(); +} + +# do_postinst_stuff has to fix up the texmf tree and install some missing +# files. The things to do are taken from the install-live.sh installer +# of former times, and should be critically checked. +sub do_postinst_stuff { + my $TEXDIR="$vars{'TEXDIR'}"; + my $TEXDIRW="$vars{'TEXDIRW'}"; + my $TEXMFSYSVAR="$vars{'TEXMFSYSVAR'}"; + my $TEXMFSYSCONFIG="$vars{'TEXMFSYSCONFIG'}"; + my $TEXMFLOCAL="$vars{'TEXMFLOCAL'}"; + my $tmv; + + do_texmf_cnf() unless ($opt_portable); + + # + # clean up useless files in texmf-dist/tlpkg as this is only + # created by the relocatable packages + if (-d "$TEXDIR/$TeXLive::TLConfig::RelocTree/tlpkg") { + rmtree("$TEXDIR/TeXLive::TLConfig::RelocTree/tlpkg"); + } + + # final program execution + # we have to do several things: + # - clean the environment from spurious TEXMF related variables + # - add the bin dir to the PATH + # - select perl interpreter and set the correct perllib + # - run the programs + + # Step 1: Clean the environment + my @TMFVARS0=qw(VARTEXFONTS + TEXMF SYSTEXMF VARTEXFONTS + TEXMFDBS WEB2C TEXINPUTS TEXFORMATS MFBASES MPMEMS TEXPOOL MFPOOL MPPOOL + PSHEADERS TEXFONTMAPS TEXPSHEADERS TEXCONFIG TEXMFCNF); + my @TMFVARS1=qw(TEXMFMAIN TEXMFDIST TEXMFLOCAL TEXMFSYSVAR TEXMFSYSCONFIG + TEXMFHOME TEXMFVAR TEXMFCONFIG); + + if (defined($ENV{'TEXMFCNF'}) and !$vars{'from_dvd'} and !$opt_portable) { + print "WARNING: environment variable TEXMFCNF is set. +You should know what you are doing. +We will remove that for the post install actions, but all further +operations might be disturbed.\n\n"; + } + foreach $tmv (@TMFVARS0) { + delete $ENV{$tmv} if (defined($ENV{$tmv})); + } + if (!$opt_portable) { + foreach $tmv (@TMFVARS1) { + delete $ENV{$tmv} if (defined($ENV{$tmv})); + } + } + $ENV{'TEXMFSYSVAR'} = $vars{'TEXMFSYSVAR'} if $vars{'from_dvd'}; + + # Step 2: Setup the PATH, switch to the new Perl + + my $pathsep=(win32)? ';' : ':'; + my $plat_bindir="$TEXDIR/bin/$vars{'this_platform'}"; + my $perl_bindir="$TEXDIR/tlpkg/tlperl/bin"; + my $perl_libdir="$TEXDIR/tlpkg/tlperl/lib"; + +## This won't do any good; +## have to remove other tex directories in calling batchfile +# if (win32) { +# debug("Removing other TeXs from path\n"); +# my @newpt = (); +# foreach my $d (split (';', $ENV{'PATH'})) { +# push @newpt, $d unless TeXLive::TLWinGoo::is_a_texdir($d); +# } +# $ENV{'PATH'} = join($pathsep, @newpt); +# debug("Path after removals(s):\n $ENV{'PATH'}\n"); +# } + + debug("Prepending $plat_bindir to PATH\n"); + + $ENV{'PATH'}="$plat_bindir" . "$pathsep" . "$ENV{'PATH'}"; + + if (win32) { + debug("Prepending $perl_bindir to PATH\n"); + $ENV{'PATH'}="$perl_bindir" . "$pathsep" . "$ENV{'PATH'}"; + $ENV{'PATH'} =~ s!/!\\!g; + } + + debug("\nNew PATH is now:\n"); + foreach my $dir (split $pathsep, $ENV{'PATH'}) { + debug(" $dir\n"); + } + debug("\n"); + + if (win32) { + $ENV{'PERL5LIB'}="$perl_libdir"; + } + + # + # 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"; + } + + # TODO: can the following two clauses be merged? + if (win32()) { + create_uninstaller($vars{'TEXDIR'}, $vars{'TEXDIRW'}, + $vars{'TEXMFSYSVAR'}, $vars{'TEXMFSYSCONFIG'}); + } + # (re-)initialize batchfile for uninstalling shortcuts + if (win32() and !$opt_portable) { + mkdirhier("$TEXDIRW/tlpkg/installer") if $vars{'from_dvd'}; + } + + # Step 4: run the programs + + if (!$opt_portable and !$vars{'from_dvd'}) { + info("running mktexlsr $TEXDIR/texmf-dist $TEXDIR/texmf\n"); + system('mktexlsr', "$TEXDIR/texmf-dist", "$TEXDIR/texmf"); + } + + # we have to generate the various config file. That could be done with + # 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"); + 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 ($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($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($usedtlpdb, + "$TEXMFSYSVAR/tex/generic/config/language.def", + "$TEXMFLOCAL/tex/generic/config/language-local.def"); + + info("running mktexlsr $TEXMFSYSVAR\n"); + system('mktexlsr', "$TEXMFSYSVAR"); + + info("running updmap-sys... "); + # system('updmap-sys', '--nohash'); + log(`updmap-sys --nohash 2>&1`); + info("done\n"); + + info("re-running mktexlsr $TEXMFSYSVAR\n"); + system('mktexlsr', "$TEXMFSYSVAR"); + + # now work through the options if specified at all + + # letter instead of a4 + if ($vars{'option_letter'}) { + info("Setting default paper size to letter\n"); + system("tlmgr", "paper", "letter"); + } + + # all formats option + if ($vars{'option_fmt'}) { + info("pre-generating all format files (fmtutil-sys --all), be patient..."); + log(`fmtutil-sys --all 2>&1`); + info("done\n"); + } + + # + # do path adjustments: On Windows add/remove to PATH etc, on Unix + # set symlinks + do_path_adjustments() if $vars{'option_path'}; + + # 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 postaction directives of the tlp + do_tlpdb_postactions(); +} + + +sub do_tlpdb_postactions { + info ("running package specific postactions\n"); + # Run the post installation code in the postaction tlpsrc entries + my $usedtlpdb = $vars{'from_dvd'} ? $tlpdb : $localtlpdb; + foreach my $package (sort keys %install) { + if ($install{$package}) { + &TeXLive::TLUtils::do_postaction("install", + $usedtlpdb->get_package($package), + $vars{'option_file_assocs'}, + $vars{'option_desktop_integration'}, + $vars{'option_post_code'}); + } + } + info ("finished with package specific postactions\n"); +} + +sub do_path_adjustments { + info ("running path adjustment actions\n"); + if (win32()) { + update_assocs(); + my $path = TeXLive::TLWinGoo::get_system_env() -> {'/Path'}; $path =~ s/[\s\x00]+$//; log("Old system path: $path\n"); @@ -516,29 +773,98 @@ sub do_installation { # setenv_reg('TEXMFSYSVAR', $vars{'TEXMFSYSVAR'}) if $vars{'from_dvd'}; setenv_reg('TEXMFCNF', $vars{'TEXMFSYSVAR'}.'/web2c') if $vars{'from_dvd'}; broadcast_env(); - create_uninstaller($vars{'TEXDIR'}, $vars{'TEXDIRW'}, - $vars{'TEXMFSYSVAR'}, $vars{'TEXMFSYSCONFIG'}); + } else { + $localtlpdb->add_symlinks() } - do_postinst_stuff(); - # now we save every scheme that is fully covered by the stuff we have - # installed to the $localtlpdb - foreach my $s ($tlpdb->schemes) { - my $stlp = $tlpdb->get_package($s); - die ("That cannot happen, $s not defined in tlpdb") unless defined($stlp); - my $incit = 1; - foreach my $d ($stlp->depends) { - if (!defined($localtlpdb->get_package($d))) { - $incit = 0; - last; + info ("finished with path adjustment actions\n"); +} + + +# we have to adjust the texmf.cnf file to the paths set in the configuration! +sub do_texmf_cnf { + open(TMF,"<$vars{'TEXDIR'}/texmf/web2c/texmf.cnf") + or die "$vars{'TEXDIR'}/texmf/web2c/texmf.cnf not found: $!"; + my @texmfcnflines = ; + close(TMF); + my @newtmf; + my @changedtmf; + # we have to find TEXMFLOCAL TEXMFSYSVAR and TEXMFHOME + foreach my $line (@texmfcnflines) { + if ($line =~ m/^TEXMFLOCAL/) { + # by default TEXMFLOCAL = TEXDIR/../texmf-local, if this is the case + # we don't have to change anything from the default + my $deftmlocal = dirname($vars{'TEXDIR'}); + $deftmlocal .= "/texmf-local"; + if ("$vars{'TEXMFLOCAL'}" eq "$deftmlocal") { + push @newtmf, $line; + } else { + push @newtmf, "TEXMFLOCAL = $vars{'TEXMFLOCAL'}\n"; + push @changedtmf, "TEXMFLOCAL = $vars{'TEXMFLOCAL'}\n"; } - } - if ($incit) { - $localtlpdb->add_tlpobj($stlp); + } elsif ($line =~ m/^TEXMFSYSVAR/) { + # by default TEXMFSYSVAR = TEXDIR/texmf-var, if this is the case + # we don't have to change anything from the default + if ("$vars{'TEXMFSYSVAR'}" eq "$vars{'TEXDIR'}/texmf-var") { + push @newtmf, $line; + } else { + push @newtmf, "TEXMFSYSVAR = $vars{'TEXMFSYSVAR'}\n"; + push @changedtmf, "TEXMFSYSVAR = $vars{'TEXMFSYSVAR'}\n"; + } + } elsif ($line =~ m/^TEXMFSYSCONFIG/) { + # by default TEXMFSYSCONFIG = TEXDIR/texmf-config, if this is the case + # we don't have to change anything from the default + if ("$vars{'TEXMFSYSCONFIG'}" eq "$vars{'TEXDIR'}/texmf-config") { + push @newtmf, $line; + } else { + push @newtmf, "TEXMFSYSCONFIG = $vars{'TEXMFSYSCONFIG'}\n"; + push @changedtmf, "TEXMFSYSCONFIG = $vars{'TEXMFSYSCONFIG'}\n"; + } + } elsif ($line =~ m/^TEXMFHOME/) { + # kpse now expands ~ to USERPROFILE, so we don't treat win32 and + # unix differently + push @newtmf, "TEXMFHOME = $vars{'TEXMFHOME'}\n"; + if ("$vars{'TEXMFHOME'}" ne "~/texmf") { + push @changedtmf, "TEXMFHOME = $vars{'TEXMFHOME'}\n"; + } + } elsif ($line =~ m/^OSFONTDIR/) { + if (win32()) { + push @newtmf, "OSFONTDIR = \$SystemRoot/fonts//\n"; + push @changedtmf, "OSFONTDIR = \$SystemRoot/fonts//\n"; + } else { + push @newtmf, $line; + } + } else { + push @newtmf, $line; } } - $localtlpdb->save unless $vars{'from_dvd'}; + my $TMF; + if (!$vars{'from_dvd'}) { + $TMF = ">$vars{'TEXDIR'}/texmf.cnf"; + open(TMF, $TMF) || die "open($TMF) failed: $!"; + print TMF <get_package($vars{'selected_scheme'}); - if (!defined($scheme)) { - die ("Scheme $vars{'selected_scheme'} not defined, vars:\n"); - dump_vars(\*STDOUT); - } - - for my $scheme_content ($scheme->depends) { - $install{"$scheme_content"}=1 unless ($scheme_content=~/^collection-/); + if ($vars{'selected_scheme'} ne "scheme-custom") { + # First look for packages in the selected scheme. + my $scheme=$tlpdb->get_package($vars{'selected_scheme'}); + if (!defined($scheme)) { + if ($vars{'selected_scheme'}) { + # something is written in the selected scheme but not defined, that + # is strange, so warn and die + die ("Scheme $vars{'selected_scheme'} not defined, vars:\n"); + dump_vars(\*STDOUT); + } + } else { + for my $scheme_content ($scheme->depends) { + $install{"$scheme_content"}=1 unless ($scheme_content=~/^collection-/); + } + } } # Now look for collections in the %vars hash. These are not @@ -744,7 +1076,14 @@ sub load_tlpdb { $vars{'option_fmt'} = $tlpdb->option_create_formats; $vars{'option_letter'} = defined($tlpdb->option_paper) && ($tlpdb->option_paper eq "letter" ? 1 : 0); - $vars{'option_symlinks'} = $tlpdb->option_create_symlinks; + $vars{'option_desktop_integration'} = $tlpdb->option_desktop_integration; + $vars{'option_desktop_integration'} = 1 if win32(); + $vars{'option_path'} = $tlpdb->option_path; + $vars{'option_path'} = 1 if win32(); + $vars{'option_w32_multi_user'} = $tlpdb->option_w32_multi_user; + $vars{'option_file_assocs'} = $tlpdb->option_file_assocs; + # $vars{'option_file_assocs'} = 1 if win32(); + $vars{'option_post_code'} = $tlpdb->option_post_code; $vars{'sys_bin'} = $tlpdb->option_sys_bin; $vars{'sys_man'} = $tlpdb->option_sys_man; $vars{'sys_info'} = $tlpdb->option_sys_info; @@ -846,12 +1185,9 @@ sub create_profile { foreach my $key (sort keys %vars) { print $fh "$key $vars{$key}\n" if $key=~/^collection/ and $vars{$key}==1; - print $fh "$key $vars{$key}\n" if $key=~/^option_letter/; - print $fh "$key $vars{$key}\n" if $key=~/^option_doc/; - print $fh "$key $vars{$key}\n" if $key=~/^option_fmt/; - print $fh "$key $vars{$key}\n" if $key=~/^option_src/; - print $fh "$key $vars{$key}\n" if $key=~/^option_symlinks/; - if ($vars{'option_symlinks'}) { + print $fh "$key $vars{$key}\n" if $key =~ /^option_/; + print $fh "$key $vars{$key}\n" if (($key =~ /^binary_/) && $vars{$key}); + if ($vars{'option_desktop_integration'} && unix()) { print $fh "sys_bin ", $vars{'sys_bin'}, "\n" if $key =~ /^sys_bin/; print $fh "sys_man ", $vars{'sys_man'}, "\n" if $key =~ /^sys_man/; print $fh "sys_info ", $vars{'sys_info'}, "\n" if $key =~ /^sys_info/; @@ -873,9 +1209,9 @@ sub read_profile { or die "$0: Cannot open profile $profilepath for reading.\n"; my %pro; while () { + chomp; next if m/^[[:space:]]*$/; # skip empty lines next if m/^[[:space:]]*#/; # skip comment lines - chomp; # remove eol my ($k,$v) = split (" ", $_, 2); # value might have spaces $pro{$k} = $v; } @@ -949,7 +1285,11 @@ sub save_options_into_tlpdb { $localtlpdb->option_location($location); $localtlpdb->option_paper($vars{'option_letter'} ? "letter" : "a4"); $localtlpdb->option_create_formats($vars{'option_fmt'} ? "1" : "0"); - $localtlpdb->option_create_symlinks($vars{'option_symlinks'} ? "1" : "0"); + $localtlpdb->option_desktop_integration($vars{'option_desktop_integration'} ? "1" : "0"); + $localtlpdb->option_file_assocs($vars{'option_file_assocs'} ? "1" : "0"); + $localtlpdb->option_path($vars{'option_path'} ? "1" : "0"); + $localtlpdb->option_post_code($vars{'option_post_code'} ? "1" : "0"); + $localtlpdb->option_w32_multi_user($vars{'option_w32_multi_user'} ? "1" : "0"); $localtlpdb->option_sys_bin($vars{'sys_bin'}); $localtlpdb->option_sys_info($vars{'sys_info'}); $localtlpdb->option_sys_man($vars{'sys_man'}); @@ -965,318 +1305,87 @@ sub save_options_into_tlpdb { $localtlpdb->save() unless $vars{'from_dvd'}; } -# do_postinst_stuff has to fix up the texmf tree and install some missing -# files. The things to do are taken from the install-live.sh installer -# of former times, and should be critically checked. -sub do_postinst_stuff { - my $TEXDIR="$vars{'TEXDIR'}"; - my $TEXDIRW="$vars{'TEXDIRW'}"; - my $TEXMFSYSVAR="$vars{'TEXMFSYSVAR'}"; - my $TEXMFSYSCONFIG="$vars{'TEXMFSYSCONFIG'}"; - my $TEXMFLOCAL="$vars{'TEXMFLOCAL'}"; - my $tmv; - - do_texmf_cnf() unless ($opt_portable); - - - # final program execution - # we have to do several things: - # - clean the environment from spurious TEXMF related variables - # - add the bin dir to the PATH - # - select perl interpreter and set the correct perllib - # - run the programs - - # Step 1: Clean the environment - my @TMFVARS0=qw(VARTEXFONTS - TEXMF SYSTEXMF VARTEXFONTS - TEXMFDBS WEB2C TEXINPUTS TEXFORMATS MFBASES MPMEMS TEXPOOL MFPOOL MPPOOL - PSHEADERS TEXFONTMAPS TEXPSHEADERS TEXCONFIG TEXMFCNF); - my @TMFVARS1=qw(TEXMFMAIN TEXMFDIST TEXMFLOCAL TEXMFSYSVAR TEXMFSYSCONFIG - TEXMFHOME TEXMFVAR TEXMFCONFIG); - if (defined($ENV{'TEXMFCNF'}) and !$vars{'from_dvd'} and !$opt_portable) { - print "WARNING: environment variable TEXMFCNF is set. -You should know what you are doing. -We will remove that for the post install actions, but all further -operations might be disturbed.\n\n"; - } - foreach $tmv (@TMFVARS0) { - delete $ENV{$tmv} if (defined($ENV{$tmv})); - } - if (!$opt_portable) { - foreach $tmv (@TMFVARS1) { - delete $ENV{$tmv} if (defined($ENV{$tmv})); +sub import_settings_from_old_tlpdb { + # first import the collections + # since the scheme is not the final word we select scheme-custom here + # and then set the single collections by hand + $vars{'selected_scheme'} = "scheme-custom"; + $vars{'n_collections_selected'} = 0; + # remove the selection of all collections + foreach my $entry (keys %vars) { + if ($entry=~/^(collection-.*)/) { + $vars{"$1"}=0; } } - $ENV{'TEXMFSYSVAR'} = $vars{'TEXMFSYSVAR'} if $vars{'from_dvd'}; - - # Step 2: Setup the PATH, switch to the new Perl - - my $pathsep=(win32)? ';' : ':'; - my $plat_bindir="$TEXDIR/bin/$vars{'this_platform'}"; - my $perl_bindir="$TEXDIR/tlpkg/tlperl/bin"; - my $perl_libdir="$TEXDIR/tlpkg/tlperl/lib"; - -## This won't do any good; -## have to remove other tex directories in calling batchfile -# if (win32) { -# debug("Removing other TeXs from path\n"); -# my @newpt = (); -# foreach my $d (split (';', $ENV{'PATH'})) { -# push @newpt, $d unless TeXLive::TLWinGoo::is_a_texdir($d); -# } -# $ENV{'PATH'} = join($pathsep, @newpt); -# debug("Path after removals(s):\n $ENV{'PATH'}\n"); -# } - - debug("Prepending $plat_bindir to PATH\n"); - - $ENV{'PATH'}="$plat_bindir" . "$pathsep" . "$ENV{'PATH'}"; - - if (win32) { - debug("Prepending $perl_bindir to PATH\n"); - $ENV{'PATH'}="$perl_bindir" . "$pathsep" . "$ENV{'PATH'}"; - $ENV{'PATH'} =~ s!/!\\!g; - } - - debug("\nNew PATH is now:\n"); - foreach my $dir (split $pathsep, $ENV{'PATH'}) { - debug(" $dir\n"); - } - debug("\n"); - - if (win32) { - $ENV{'PERL5LIB'}="$perl_libdir"; + for my $c ($previoustlpdb->collections) { + my $tlpobj = $tlpdb->get_package($c); + if ($tlpobj) { + $vars{$c} = 1; + ++$vars{'n_collections_selected'}; + } } - + # now take over the path + my $oldroot = $previoustlpdb->root; + my $newroot = abs_path("$oldroot/..") . "/$texlive_release"; + $vars{'TEXDIR'} = $newroot; + $vars{'TEXDIRW'} = $newroot; + $vars{'TEXMFSYSVAR'} = "$newroot/texmf-var"; + $vars{'TEXMFSYSCONFIG'} = "$newroot/texmf-config"; + # only TEXMFLOCAL is treated differently, we use what is found by kpsewhich + # in 2008 and onward this is defined as + # TEXMFLOCAL = $SELFAUTOPARENT/../texmf-local + # so kpsewhich -var-value=TEXMFLOCAL returns + # ..../2008/../texmf-local + # TODO TODO TODO + chomp (my $tml = `kpsewhich -var-value=TEXMFLOCAL`); + $tml = abs_path($tml); + $vars{'TEXMFLOCAL'} = $tml; # - # post install actions + # now for the settings + # set the defaults to what is specified in the tlpdb + $vars{'option_doc'} = + $previoustlpdb->option_pkg("00texlive-installation.config", + "opt_install_docfiles"); + $vars{'option_src'} = + $previoustlpdb->option_pkg("00texlive-installation.config", + "opt_install_srcfiles"); + $vars{'option_fmt'} = + $previoustlpdb->option_pkg("00texlive-installation.config", + "opt_create_formats"); + my $tmp = $previoustlpdb->option_pkg("00texlive-installation.config", + "opt_paper"); + $vars{'option_letter'} = defined($tmp) && ($tmp eq "letter" ? 1 : 0); + $vars{'option_desktop_integration'} = 1 if win32(); + # option_path does not exist in older installation + $vars{'option_path'} = + $previoustlpdb->option_pkg("00texlive-installation.config", + "opt_create_symlinks"); + $vars{'option_path'} = 1 if win32(); + $vars{'sys_bin'} = + $previoustlpdb->option_pkg("00texlive-installation.config", + "opt_sys_bin"); + $vars{'sys_man'} = + $previoustlpdb->option_pkg("00texlive-installation.config", + "opt_sys_man"); + $vars{'sys_info'} = + $previoustlpdb->option_pkg("00texlive-installation.config", + "opt_sys_info"); # - - if (win32()) { - debug "Actual environment:\n".`set`."\n\n"; - debug 'Effective TEXMFCNF: '.`kpsewhich -expand-path=\$TEXMFCNF`."\n"; - } - - # (re-)initialize batchfile for uninstalling shortcuts - if (win32() and !$opt_portable) { - mkdirhier("$TEXDIRW/tlpkg/installer") if $vars{'from_dvd'}; - init_unshortbat($TEXDIRW); - } - - 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); - } - } - # $opt_portable: no %install but we still want xetex postinstall - &{$PostInstall{'xetex'}}($TEXDIR, $TEXDIRW, $TEXMFSYSVAR, $TEXMFLOCAL) - if $opt_portable; - update_assocs() if win32(); - - # Step 4: run the programs - - if (!$opt_portable and !$vars{'from_dvd'}) { - info("running mktexlsr $TEXDIR/texmf-dist $TEXDIR/texmf\n"); - system('mktexlsr', "$TEXDIR/texmf-dist", "$TEXDIR/texmf"); - } - - # we have to generate the various config file. That could be done with - # 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, - "$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, - "$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, - "$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, - "$TEXMFSYSVAR/tex/generic/config/language.def", - "$TEXMFLOCAL/tex/generic/config/language-local.def"); - - info("running mktexlsr $TEXMFSYSVAR\n"); - system('mktexlsr', "$TEXMFSYSVAR"); - - info("running updmap-sys... "); - # system('updmap-sys', '--nohash'); - log(`updmap-sys --nohash 2>&1`); - info("done\n"); - - info("re-running mktexlsr $TEXMFSYSVAR\n"); - system('mktexlsr', "$TEXMFSYSVAR"); - - # now work through the options if specified at all - - # letter instead of a4 - if ($vars{'option_letter'}) { - info("Setting default paper size to letter\n"); - if (platform() eq "hppa-hpux") { - # we didn't get a texlua binary for hppa-hpux, so try texconfig - system("texconfig", "paper", "letter"); - } else { - system("texlua", "$TEXDIR/texmf/scripts/texlive/texconf.tlu", "--sys", "--noformat", "paper", "letter"); - } - } - - # all formats option - if ($vars{'option_fmt'}) { - info("pre-generating all format files (fmtutil-sys --all), be patient... "); - #system('fmtutil-sys', '--all'); - # try to capture that output - log(`fmtutil-sys --all 2>&1`); - info("done.\n"); - } - - # option_links - if ($vars{'option_symlinks'}) { - # bin files - my @files; - mkdirhier $vars{'sys_bin'}; - if (-w $vars{'sys_bin'}) { - info("linking binaries to $vars{'sys_bin'}\n"); - @files = `ls $plat_bindir`; - chomp(@files); - `cd "$vars{'sys_bin'}" && rm -f @files`; - `ln -s "$plat_bindir/"* "$vars{'sys_bin'}"`; - } else { - info("destination of bin symlink $vars{'sys_bin'} not writable, " - . "no linking of bin files done.\n"); - } - if ($vars{'option_doc'}) { - # info files - mkdirhier $vars{'sys_info'}; - if (-w $vars{'sys_info'}) { - info("linking info pages to $vars{'sys_info'}\n"); - @files = `ls "$TEXDIR/texmf/doc/info"`; - chomp(@files); - `cd "$vars{'sys_info'}" && rm -f @files`; - `ln -s "$TEXDIR/texmf/doc/info/"*info* "$vars{'sys_info'}"`; - } else { - info("destination of info symlink $vars{'sys_info'} not writable, " - . "no linking of info files done.\n"); - } - # man files - mkdirhier $vars{'sys_man'}; - if (-w $vars{'sys_man'}) { - info("linking man pages to $vars{'sys_man'}\n"); - my $foo = `(cd "$TEXDIR/texmf/doc/man" && echo *)`; - my @mans = split ' ', $foo; - chomp(@mans); - foreach my $m (@mans) { - my $mandir = "$TEXDIR/texmf/doc/man/$m"; - next unless -d $mandir; - mkdirhier "$vars{'sys_man'}/$m"; - next unless -w "$vars{'sys_man'}/$m"; - @files = `ls "$mandir"`; - chomp(@files); - `cd "$vars{'sys_man'}/$m" && rm -f @files`; - `ln -s "$mandir/"* "$vars{'sys_man'}/$m"`; - } - } else { - info("destination of man symlink $vars{'sys_man'} not writable, " - . "no linking of man files done.\n"); - } + # import the set of selected architectures + my $val = $previoustlpdb->option_pkg("00texlive-installation.config", + "available_architectures"); + my @aar; + if (defined($val)) { + @aar = split(" ", $val); + for my $b ($tlpdb->available_architectures) { + $vars{"binary_$b"} = member( $b, @aar ); } - } -} - - -# we have to adjust the texmf.cnf file to the paths set in the configuration! -sub do_texmf_cnf { - open(TMF,"<$vars{'TEXDIR'}/texmf/web2c/texmf.cnf") - or die "$vars{'TEXDIR'}/texmf/web2c/texmf.cnf not found: $!"; - my @texmfcnflines = ; - close(TMF); - my @newtmf; - my @changedtmf; - # we have to find TEXMFLOCAL TEXMFSYSVAR and TEXMFHOME - foreach my $line (@texmfcnflines) { - if ($line =~ m/^TEXMFLOCAL/) { - # by default TEXMFLOCAL = TEXDIR/../texmf-local, if this is the case - # we don't have to change anything from the default - my $deftmlocal = dirname($vars{'TEXDIR'}); - $deftmlocal .= "/texmf-local"; - if ("$vars{'TEXMFLOCAL'}" eq "$deftmlocal") { - push @newtmf, $line; - } else { - push @newtmf, "TEXMFLOCAL = $vars{'TEXMFLOCAL'}\n"; - push @changedtmf, "TEXMFLOCAL = $vars{'TEXMFLOCAL'}\n"; - } - } elsif ($line =~ m/^TEXMFSYSVAR/) { - # by default TEXMFSYSVAR = TEXDIR/texmf-var, if this is the case - # we don't have to change anything from the default - if ("$vars{'TEXMFSYSVAR'}" eq "$vars{'TEXDIR'}/texmf-var") { - push @newtmf, $line; - } else { - push @newtmf, "TEXMFSYSVAR = $vars{'TEXMFSYSVAR'}\n"; - push @changedtmf, "TEXMFSYSVAR = $vars{'TEXMFSYSVAR'}\n"; - } - } elsif ($line =~ m/^TEXMFSYSCONFIG/) { - # by default TEXMFSYSCONFIG = TEXDIR/texmf-config, if this is the case - # we don't have to change anything from the default - if ("$vars{'TEXMFSYSCONFIG'}" eq "$vars{'TEXDIR'}/texmf-config") { - push @newtmf, $line; - } else { - push @newtmf, "TEXMFSYSCONFIG = $vars{'TEXMFSYSCONFIG'}\n"; - push @changedtmf, "TEXMFSYSCONFIG = $vars{'TEXMFSYSCONFIG'}\n"; - } - } elsif ($line =~ m/^TEXMFHOME/) { - # kpse now expands ~ to USERPROFILE, so we don't treat win32 and - # unix differently - push @newtmf, "TEXMFHOME = $vars{'TEXMFHOME'}\n"; - if ("$vars{'TEXMFHOME'}" ne "~/texmf") { - push @changedtmf, "TEXMFHOME = $vars{'TEXMFHOME'}\n"; - } - } elsif ($line =~ m/^OSFONTDIR/) { - if (win32()) { - push @newtmf, "OSFONTDIR = \$SystemRoot/fonts//\n"; - push @changedtmf, "OSFONTDIR = \$SystemRoot/fonts//\n"; - } else { - push @newtmf, $line; - } - } else { - push @newtmf, $line; + $vars{'n_systems_available'} = 0; + for my $key (keys %vars) { + ++$vars{'n_systems_available'} if ($key=~/^binary/); } } - my $TMF; - if (!$vars{'from_dvd'}) { - $TMF = ">$vars{'TEXDIR'}/texmf.cnf"; - open(TMF, $TMF) || die "open($TMF) failed: $!"; - print TMF <$batfile"; -print TMPBAT 'path '.$ENV{'PATH'}."\n"; -close TMPBAT; -__END__ - -:fixpath -call %TEMP%\setpath.bat -echo Path: %path% -rem del %TEMP%\setpath.bat -"%tlroot%tlpkg\installer\perl" "%~dpn0" %* +rem Wrapper script to set up environment for installer +rem +rem Copyright 2009 by Tomasz M. Trzeciak +rem Public Domain + +rem First, check if this is DOS based system +rem in DOS '&' is just a normal character +echo.>nul & goto continue +goto DOS +:continue + +rem Now check for Windows NT which is also not supported +ver | find "NT" +if not errorlevel 1 goto WinNT + +rem Abort if we are running from UNC path +if %~d0==\\ goto UNC + +rem Localize environment changes +setlocal enableextensions + +rem Do we really need to cd to the batch location? +cd /d %~dp0 + +rem Break search path into dir list and rebuild w/o tex dirs +call :rebuildpath ";" "%path:;=" "%" + +rem Use TL Perl +path %~dp0tlpkg\tlperl\bin;%path% +set PERL5LIB=%~dp0tlpkg\tlperl\lib + +rem Start installer +path +perl "%~dpn0" %* pause Done +goto :eof -rem endlocal is implicit +rem Subroutine to build search path without tex directories +rem any dir containing pdftex.exe is considered a tex dir +:rebuildpath ";" dir list ... +shift +rem The first argument (";") serves as a marker to reset the path +if "%~0"==";" set path= +rem Finish if no more arguments to process +if "%~1"=="" goto :eof +rem Continue if tex dir +if exist "%~1\pdftex.exe" goto :rebuildpath +rem Add dir to path +if not defined path (path %~1) else (path %path%;%~1) +goto :rebuildpath rem About install-tl.bat.manifest: rem Vista assumes that a file with install in the name is rem an installer and therefore requires administrative privileges. rem The manifest file tells Vista otherwise. + +:UNC +echo Cannot run from UNC path. +echo Map network drive to a drive letter and rerun the installer. +echo Use pushd/popd commands for temporary mapping. +pause +exit /b 1 + +:WinNT +echo Windows NT is not supported. Sorry. +echo Windows 2000 or newer is required. +pause +exit /b 1 + +:DOS +echo DOS and Windows 9x systems are not supported. Sorry. +echo Windows 2000 or newer is required. +pause diff --git a/Master/texmf/scripts/texlive/tlmgr.pl b/Master/texmf/scripts/texlive/tlmgr.pl index 9afccb86c7c..fab861a322a 100755 --- a/Master/texmf/scripts/texlive/tlmgr.pl +++ b/Master/texmf/scripts/texlive/tlmgr.pl @@ -36,13 +36,13 @@ BEGIN { # make subprograms (including kpsewhich) have the right path: $mydir = $0; $mydir =~ s,/[^/]*$,,; - if (!$^O=~/^MSWin(32|64)$/i) { - $ENV{"PATH"} = "$mydir:$ENV{PATH}"; + my $kpsewhichname; + if (!$^O =~ /^MSWin/i) { + $ENV{"PATH"} = "$mydir;$ENV{PATH}"; $kpsewhichname = "kpsewhich.exe"; } else { $kpsewhichname = "kpsewhich"; } - # if (! -r "$mydir/$kpsewhichname") { # no kpsewhich in the same directory, so we are in a bootstrapping # mode, use for Master $mydir/../.. @@ -66,7 +66,6 @@ use TeXLive::TLConfig; use TeXLive::TLMedia; use TeXLive::TLPDB; use TeXLive::TLPOBJ; -use TeXLive::TLPostActions; use TeXLive::TLUtils; use TeXLive::TLWinGoo; TeXLive::TLUtils->import(qw(member info give_ctan_mirror win32 dirname @@ -80,6 +79,7 @@ binmode(STDERR, ":utf8"); our $tlmediasrc; # media from which we install/update our $tlmediatlpdb; our $location; # location from which the new packages come +our $localtlmedia; # local installation which we are munging our $localtlpdb; # local installation which we are munging my %options; # TL options from local tlpdb @@ -408,6 +408,21 @@ sub execute_action { + +sub do_cmd_and_check { + my $cmd = shift; + info("running $cmd ... "); + my ($out, $ret) = TeXLive::TLUtils::run_cmd("$cmd 2>&1"); + if ($ret == 0) { + info("done\n"); + log("Output of $cmd:\n$out\n"); + } else { + info("\n"); + tlwarn("$cmd failed (status $ret), output:\n$out\n"); + } + return $ret; +} + # run external programs (mktexlsr, updmap-sys, etc.) as specified by the # keys in the RET hash. We return the number of unsuccessful runs, zero # if all ok. @@ -420,8 +435,7 @@ sub handle_ret_hash { my $errors = 0; if (exists $ret{'mktexlsr'}) { - info("running mktexlsr\n"); - $errors += system("mktexlsr"); + $errors += do_cmd_and_check("mktexlsr"); } if (exists $ret{'map'}) { @@ -431,12 +445,9 @@ sub handle_ret_hash { # been the documented way to add fonts for many years. If we called # create_updmap, such user maps would be lost. foreach my $m (@{$ret{'map'}}) { - my $cmd = "updmap-sys --nomkmap --nohash --$m"; - info("running $cmd\n"); - $errors += system($cmd); + $errors += do_cmd_and_check("updmap-sys --nomkmap --nohash --$m"); } - info("running updmap-sys once more\n"); - $errors += system("updmap-sys"); # runs mktexlsr. + $errors += do_cmd_and_check("updmap-sys"); # runs mktexlsr. } chomp(my $TEXMFSYSVAR = `kpsewhich -var-value=TEXMFSYSVAR`); @@ -454,15 +465,13 @@ sub handle_ret_hash { "$TEXMFSYSVAR/web2c/fmtutil.cnf", "$TEXMFLOCAL/web2c/fmtutil-local.cnf"); if ($opt_fmt && !$ret{'format-regenerate'}) { - info("running fmtutil-sys --missing\n"); - $errors += system("fmtutil-sys", "--missing"); + $errors += do_cmd_and_check("fmtutil-sys --missing"); } } # if (exists $ret{'format-regenerate'}) { my $a = $opt_fmt ? "--all" : "--refresh"; - info("running fmtutil-sys $a to regenerate formats\n"); - $errors += system("fmtutil-sys", $a); + $errors += do_cmd_and_check("fmtutil-sys $a"); } if (exists $ret{'language'}) { @@ -483,95 +492,12 @@ sub handle_ret_hash { $lang = "$TEXMFSYSVAR/tex/generic/config/$lang"; } if ($localtlpdb->option_create_formats) { - info("running fmtutil-sys --byhyphen $lang\n"); - $errors += system("fmtutil-sys", "--byhyphen", $lang); + $errors += do_cmd_and_check("fmtutil-sys --byhyphen $lang"); } } } - return $errors / 256; # we were accumulating wait statuses -} - - -# -# remove_package removes a single package with all files (including the -# tlpobj files) and the entry from the tlpdb. -# -sub remove_package { - my ($pkg, $localtlpdb) = @_; - my $tlp = $localtlpdb->get_package($pkg); - my %ret; - if (!defined($tlp)) { - tlwarn ("$pkg: package not present, cannot remove\n"); - } else { - if ($pkg =~ m/^texlive\.infra/) { - log ("Not removing $pkg, it is essential!\n"); - return; - } - # we have to chdir to $localtlpdb->root - my $Master = $localtlpdb->root; - chdir ($Master) || die "chdir($Master) failed: $!"; - my @files = $tlp->all_files; - # also remove the .tlpobj file - push @files, "tlpkg/tlpobj/$pkg.tlpobj"; - # and the ones from src/doc splitting - if (-r "tlpkg/tlpobj/$pkg.source.tlpobj") { - push @files, "tlpkg/tlpobj/$pkg.source.tlpobj"; - } - if (-r "tlpkg/tlpobj/$pkg.doc.tlpobj") { - push @files, "tlpkg/tlpobj/$pkg.doc.tlpobj"; - } - # - # we want to check that a file is only listed in one package, so - # in case that a file to be removed is listed in another package - # we will warn and *not* remove it - my %allfiles; - for my $p ($localtlpdb->list_packages) { - next if ($p eq $pkg); # we have to skip the to be removed package - for my $f ($localtlpdb->get_package($p)->all_files) { - $allfiles{$f} = $p; - } - } - my @goodfiles = (); - my @badfiles = (); - for my $f (@files) { - if (defined($allfiles{$f})) { - # this file should be removed but is mentioned somewhere, too - push @badfiles, $f; - } else { - push @goodfiles, $f; - } - } - if ($#badfiles >= 0) { - # warn the user - tlwarn("The following files should be removed due to the removal of $pkg,\n"); - tlwarn("but are part of another package, too.\n"); - for my $f (@badfiles) { - tlwarn(" $f - $allfiles{$f}\n"); - } - } - my @removals = &removed_dirs (@goodfiles); - foreach my $entry (@goodfiles) { - unlink $entry; - } - foreach my $entry (@removals) { - rmdir $entry; - } - $localtlpdb->remove_package($pkg); - merge_into(\%ret, $tlp->make_return_hash_from_executes("disable")); - $ret{'mktexlsr'} = 1; - # should we save at each removal??? - # advantage: the tlpdb actually reflects what is installed - # 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($PostRemove{$pkg})) { - info("running post remove action for $pkg\n"); - &{$PostRemove{$pkg}}($localtlpdb->root); - } - } - return \%ret; + return $errors; } @@ -686,7 +612,8 @@ sub action_remove { # the rest will not be run in dry_run mode $foo{'mktexlsr'} = 1; } else { - merge_into(\%foo, &remove_package($pkg, $localtlpdb)); + merge_into(\%foo, + $localtlmedia->remove_package($pkg)); logpackage("remove: $pkg"); } if (keys %foo) { @@ -709,7 +636,8 @@ sub action_remove { info ("remove $pkg\n"); if (!$opts{"dry-run"}) { my %foo; - merge_into(\%foo, &remove_package($pkg, $localtlpdb)); + merge_into(\%foo, + $localtlmedia->remove_package($pkg)); if (keys %foo) { # removal was successful logpackage("remove: $pkg"); @@ -913,8 +841,13 @@ sub action_search { $tlpdb = $localtlpdb; } foreach my $pkg ($tlpdb->list_packages) { + my $tlp = $tlpdb->get_package($pkg); if ($opts{"file"}) { - my @ret = grep(m;$r;, $tlpdb->get_package($pkg)->all_files); + my @files = $tlp->all_files; + if ($tlp->relocated) { + for (@files) { s:^$RelocPrefix/:$RelocTree/:; } + } + my @ret = grep(m;$r;, @files); if (@ret) { print "$pkg:\n"; foreach (@ret) { @@ -983,7 +916,7 @@ sub action_restore { closedir (DIR) || warn "closedir($opts{'backupdir'}) failed: $!"; for my $dirent (@dirents) { next if (-d $dirent); - next if ($dirent !~ m/^(.*)\.r([0-9]+)\.tar\.lzma$/); + next if ($dirent !~ m/^(.*)\.r([0-9]+)\.tar\.xz$/); $backups{$1}->{$2} = 1; } my ($pkg, $rev) = @ARGV; @@ -1016,14 +949,14 @@ sub action_restore { finish(0); } } - print "Restoring $pkg, $rev from $opts{'backupdir'}/${pkg}.r${rev}.tar.lzma\n"; + print "Restoring $pkg, $rev from $opts{'backupdir'}/${pkg}.r${rev}.tar.xz\n"; if (!$opts{"dry"}) { init_local_db(1); # first remove the package, then reinstall it # this way we get rid of useless files $opts{"backupdir"} = abs_path($opts{"backupdir"}); - merge_into(\%ret, &remove_package($pkg, $localtlpdb)); - TeXLive::TLMedia->_install_package("$opts{'backupdir'}/${pkg}.r${rev}.tar.lzma" , [] ,$localtlpdb); + merge_into(\%ret, $localtlmedia->remove_package($pkg)); + TeXLive::TLMedia->_install_package("$opts{'backupdir'}/${pkg}.r${rev}.tar.xz" , [] ,$localtlpdb); logpackage("restore: $pkg ($rev)"); # now we have to read the .tlpobj file and add it to the DB my $tlpobj = TeXLive::TLPOBJ->new; @@ -1132,9 +1065,9 @@ sub action_backup { } else { my $tlp = $localtlpdb->get_package($pkg); info("saving current status of $pkg to $opts{'backupdir'}/${pkg}.r" . - $tlp->revision . "tar.lzma\n"); + $tlp->revision . "tar.xz\n"); if (!$opts{"dry-run"}) { - $tlp->make_container("lzma", $localtlpdb->root, + $tlp->make_container("xz", $localtlpdb->root, $opts{"backupdir"}, "${pkg}.r" . $tlp->revision); } } @@ -1191,22 +1124,22 @@ sub write_w32_updater { } foreach $pkg_part (@pkg_parts) { if ($media eq 'CD') { - copy("$repo/$pkg_part.tar.lzma", "$temp"); + copy("$repo/$pkg_part.tar.xz", "$temp"); } else { # net - TeXLive::TLUtils::download_file("$repo/$pkg_part.tar.lzma", "$temp/$pkg_part.tar.lzma"); + TeXLive::TLUtils::download_file("$repo/$pkg_part.tar.xz", "$temp/$pkg_part.tar.xz"); } # now we should have the file present - if (!-r "$temp/$pkg_part.tar.lzma") { - tlwarn("Couldn't get $pkg_part.tar.lzma, that is bad\n"); + if (!-r "$temp/$pkg_part.tar.xz") { + tlwarn("Couldn't get $pkg_part.tar.xz, that is bad\n"); return 1; # abort } - # unpack lzma archive - $sysret = system("$::progs{'lzmadec'} < \"$temp/$pkg_part.tar.lzma\" > \"$temp/$pkg_part.tar\""); + # unpack xz archive + $sysret = system("$::progs{'xzdec'} < \"$temp/$pkg_part.tar.xz\" > \"$temp/$pkg_part.tar\""); if ($sysret) { - tlwarn("Couldn't unpack $pkg_part.tar.lzma\n"); + tlwarn("Couldn't unpack $pkg_part.tar.xz\n"); return 1; # unpack failed? abort } - unlink("$temp/$pkg_part.tar.lzma"); # we don't need that archive anymore + unlink("$temp/$pkg_part.tar.xz"); # we don't need that archive anymore push @updater_args, $pkg_part, $oldrev, $newrev; } } @@ -1577,7 +1510,7 @@ sub action_update { } } if (!($opts{"dry-run"} or $opts{"list"} or $opts{"no-remove"})) { - merge_into(\%ret, &remove_package($p, $localtlpdb)); + merge_into(\%ret, $localtlmedia->remove_package($p)); logpackage("remove: $p"); } } @@ -1635,10 +1568,10 @@ sub action_update { } if ($opts{"backup"} && !$opts{"dry-run"}) { - $tlp->make_container("lzma", $root, + $tlp->make_container("xz", $root, $opts{"backupdir"}, "${pkg}.r" . $tlp->revision); $unwind_package = - "$opts{'backupdir'}/${pkg}.r" . $tlp->revision . ".tar.lzma"; + "$opts{'backupdir'}/${pkg}.r" . $tlp->revision . ".tar.xz"; if ($autobackup) { # in case we do auto backups we remove older backups @@ -1680,7 +1613,7 @@ sub action_update { # # the remove_package should also remove empty dirs in case # a dir is changed into a file - merge_into(\%ret, &remove_package($pkg, $localtlpdb)); + merge_into(\%ret, $localtlmedia->remove_package($pkg)); my $foo = $tlmediasrc->install_package($pkg, $localtlpdb); if (ref $foo) { # installation succeeded because we got a reference @@ -2313,7 +2246,7 @@ sub action_recreate_tlpdb { my $tlpdb = TeXLive::TLPDB->new; $tlpdb->root($Master); my $inst = TeXLive::TLPOBJ->new; - $inst->name("00texlive-installation.config"); + $inst->name("00texlive.installation"); $inst->category("TLCore"); my @deps; push @deps, "location:$TeXLive::TLConfig::TeXLiveURL"; @@ -2422,7 +2355,11 @@ sub check_files { # ignore files in the installer next if ($p eq "00texlive.installer"); my $tlp = $localtlpdb->get_package($p); - for my $f ($tlp->all_files) { + my @files = $tlp->all_files; + if ($tlp->relocated) { + for (@files) { s:^$RelocPrefix/:$RelocTree/:; } + } + for my $f (@files) { push @{$filetopacks{$f}}, $p; } } @@ -2554,10 +2491,13 @@ sub init_local_db { # if the localtlpdb is already defined do simply return here already # to make sure that the settings in the local tlpdb do not overwrite # stuff changed via the GUI + return if defined $localtlmedia; return if defined $localtlpdb; - $localtlpdb = TeXLive::TLPDB->new ("root" => $Master); + $localtlmedia = TeXLive::TLMedia->new ( $Master ); + die("cannot setup TLMedia in $Master") unless (defined($localtlmedia)); + $localtlpdb = $localtlmedia->tlpdb; die("cannot find tlpdb in $Master") unless (defined($localtlpdb)); - # setup the programs, for w32 we need the shipped wget/lzma etc, so we + # setup the programs, for w32 we need the shipped wget/xz etc, so we # pass the location of these files to setup_programs. if (!setup_programs("$Master/tlpkg/installer", $localtlpdb->option_platform)) { @@ -2668,14 +2608,14 @@ sub clear_old_backups my @backups; for my $dirent (@dirents) { next if (-d $dirent); - next if ($dirent !~ m/^$pkg\.r([0-9]+)\.tar\.lzma$/); + next if ($dirent !~ m/^$pkg\.r([0-9]+)\.tar\.xz$/); push @backups, $1; } my $i = 1; for my $e (reverse sort {$a <=> $b} @backups) { if ($i > $autobackup) { - info ("Removing backup $backupdir/$pkg.r$e.tar.lzma\n"); - unlink("$backupdir/$pkg.r$e.tar.lzma") unless $dryrun; + info ("Removing backup $backupdir/$pkg.r$e.tar.xz\n"); + unlink("$backupdir/$pkg.r$e.tar.xz") unless $dryrun; } $i++; } diff --git a/Master/texmf/scripts/texlive/tlmgrgui/do_listframe.pl b/Master/texmf/scripts/texlive/tlmgrgui/do_listframe.pl index 3eb679d9abf..3df4a668b63 100644 --- a/Master/texmf/scripts/texlive/tlmgrgui/do_listframe.pl +++ b/Master/texmf/scripts/texlive/tlmgrgui/do_listframe.pl @@ -1,7 +1,8 @@ # guinb1.pl # $Id$ # -# Copyright 2008 Tomasz Luczak, Norbert Preining +# Copyright 2008 Tomasz Luczak +# Copyright 2008, 2009 Norbert Preining # # GUI for tlmgr # diff --git a/Master/texmf/scripts/texlive/tlmgrgui/gui-arch.pl b/Master/texmf/scripts/texlive/tlmgrgui/gui-arch.pl index d475e31d62a..010c4cbf2fc 100644 --- a/Master/texmf/scripts/texlive/tlmgrgui/gui-arch.pl +++ b/Master/texmf/scripts/texlive/tlmgrgui/gui-arch.pl @@ -1,7 +1,8 @@ # gui-arch.pl # $Id$ # -# Copyright 2008 Tomasz Luczak, Norbert Preining +# Copyright 2008 Tomasz Luczak +# Copyright 2008, 2009 Norbert Preining # # GUI for tlmgr # diff --git a/Master/texmf/scripts/texlive/tlmgrgui/gui-config.pl b/Master/texmf/scripts/texlive/tlmgrgui/gui-config.pl index a90e33535e2..bc910bad907 100644 --- a/Master/texmf/scripts/texlive/tlmgrgui/gui-config.pl +++ b/Master/texmf/scripts/texlive/tlmgrgui/gui-config.pl @@ -1,7 +1,8 @@ # gui-config2.pl # $Id$ # -# Copyright 2008 Tomasz Luczak, Norbert Preining +# Copyright 2008 Tomasz Luczak +# Copyright 2008, 2009 Norbert Preining # # GUI for tlmgr # @@ -158,11 +159,29 @@ my $back_config_act = $lower->Labelframe(-text => ___"actions"); $back_config_act->Button(-text => ___"reinitlsr", - -command => sub { run_program_show_output("mktexlsr"); })->pack(-expand => 1, -fill => "x", -padx => "2m", -pady => "2m"); + -command => sub { + $mw->Busy(-recurse => 1); + info("Running mktexlsr, this may take some time ...\n"); + info(`mktexlsr 2>&1`); + $mw->Unbusy; + })->pack(-expand => 1, -fill => "x", + -padx => "2m", -pady => "2m"); $back_config_act->Button(-text => ___"recreateformats", - -command => sub { run_program_show_output("fmtutil-sys --all"); })->pack(-expand => 1, -fill => "x", -padx => "2m", -pady => "2m"); + -command => sub { + $mw->Busy(-recurse => 1); + info("Running fmtutil-sys --all, this may take some time ...\n"); + info(`fmtutil-sys --all 2>&1`); + $mw->Unbusy; + })->pack(-expand => 1, -fill => "x", + -padx => "2m", -pady => "2m"); $back_config_act->Button(-text => ___"updatemaps", - -command => sub { run_program_show_output("updmap-sys"); })->pack(-expand => 1, -fill => "x", -padx => "2m", -pady => "2m"); + -command => sub { + $mw->Busy(-recurse => 1); + info("Running updmap-sys, this may take some time ...\n"); + info(`updmap-sys 2>&1`); + $mw->Unbusy; + })->pack(-expand => 1, -fill => "x", + -padx => "2m", -pady => "2m"); $back_config_act->pack(-side => 'right', -fill => "both", -padx => "2m", -pady => "2m", -expand => 1, -ipadx => "2m", -ipady => "2m"); diff --git a/Master/texmf/scripts/texlive/tlmgrgui/gui-uninstall.pl b/Master/texmf/scripts/texlive/tlmgrgui/gui-uninstall.pl index 76caa2d4c75..ffb7623181d 100644 --- a/Master/texmf/scripts/texlive/tlmgrgui/gui-uninstall.pl +++ b/Master/texmf/scripts/texlive/tlmgrgui/gui-uninstall.pl @@ -1,7 +1,8 @@ # gui-uninstall.pl # $Id$ # -# Copyright 2008 Tomasz Luczak, Norbert Preining +# Copyright 2008 Tomasz Luczak +# Copyright 2008, 2009 Norbert Preining # # GUI for tlmgr # diff --git a/Master/texmf/scripts/texlive/tlmgrgui/tlmgrgui.pl b/Master/texmf/scripts/texlive/tlmgrgui/tlmgrgui.pl index c3990acd274..a9d9b95443a 100755 --- a/Master/texmf/scripts/texlive/tlmgrgui/tlmgrgui.pl +++ b/Master/texmf/scripts/texlive/tlmgrgui/tlmgrgui.pl @@ -2,7 +2,8 @@ # # $Id$ # -# Copyright 2008 Tomasz Luczak, Norbert Preining +# Copyright 2008 Tomasz Luczak +# Copyright 2008, 2009 Norbert Preining # # GUI for tlmgr # @@ -397,58 +398,6 @@ sub set_text_win { $w->see("0.0"); } -sub run_program_show_output { - my $td = $mw->Toplevel(-title => ___"tlmgr process"); - $td->transient($mw); - $td->grab(); - my $tf = $td->Scrolled("ROText", -width => 80, - -height => 10, - -wrap => "none", - -scrollbars => "ose" - )->pack(-expand => 1, -fill => "both"); - my $ok = $td->Button(-text => ___"ok", -padx => "3m", -pady => "3m", - -command => sub { $td->destroy; }); - # start the installation, read the output - $mw->update; - $::sww->update; - # - # ok, that stupid perl for windows does not have fork, why? no idea - # we have to deal with that - if ($^O=~/^MSWin(32|64)$/i) { - $tf->insert("end", ___("starting") . " @_\n\n" . ___"maytaketime"); - $mw->update; - $::sww->update; - my $ret = `@_`; - $tf->insert("end", "$ret\n\n" . ___("completed") . "\n"); - $tf->see("end"); - $ok->pack; - $mw->update; - $::sww->update; - } else { - my $pid = open(KID_TO_READ, "-|"); - if ($pid) { # parent - while () { - $tf->insert("end",$_); - $tf->see("end"); - $mw->update; - $::sww->update; - } - close(KID_TO_READ) || warn "kid exited $?"; - $tf->insert("end","\n\nCOMPLETED\n"); - $tf->see("end"); - $ok->pack; - } else { #kid - # do not buffer lines ... - $| = 1; - open STDERR, '>&STDOUT'; - print ___("starting") . " @_\n"; - exec(@_) - || die "can't exec program: $!"; - # NOTREACHED - } - } -} - sub install_selected_packages { if (@_) { my @args = qw/install/; @@ -539,7 +488,7 @@ sub create_update_list { $localtlpdb, @TeXLive::TLConfig::CriticalPackagesList); if (defined($tlmediatlpdb)) { foreach my $lp ($localtlpdb->list_packages) { - next if ($lp =~ m/00texlive-installation.config/); + next if ($lp =~ m/00texlive.installation/); my $lrev = $localtlpdb->get_package($lp)->revision; my $up = $tlmediatlpdb->get_package($lp); my $urev; diff --git a/Master/texmf/scripts/texlive/uninstall-win32.pl b/Master/texmf/scripts/texlive/uninstall-win32.pl index 8f14630f832..4c0e52bb7c9 100644 --- a/Master/texmf/scripts/texlive/uninstall-win32.pl +++ b/Master/texmf/scripts/texlive/uninstall-win32.pl @@ -17,6 +17,10 @@ BEGIN { } use TeXLive::TLWinGoo; +use TeXLive::TLPDB; +use TeXLive::TLPOBJ; +use TeXLive::TLConfig; +use TeXLive::TLUtils; use Tk; use Tk::Dialog; @@ -39,6 +43,19 @@ $ok->pack(-side => 'left', -padx => "3m"); $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) { + &TeXLive::TLUtils::do_postaction("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: diff --git a/Master/tlpkg/TeXLive/TLConfig.pm b/Master/tlpkg/TeXLive/TLConfig.pm index f75ed3b392d..a148fc0ae31 100644 --- a/Master/tlpkg/TeXLive/TLConfig.pm +++ b/Master/tlpkg/TeXLive/TLConfig.pm @@ -11,6 +11,7 @@ BEGIN { use vars qw( @ISA @EXPORT_OK @EXPORT ); @ISA = qw(Exporter); @EXPORT_OK = qw( + $ReleaseYear @MetaCategories @NormalCategories @Categories @@ -28,10 +29,17 @@ BEGIN { $WinSpecialUpdatePackagesRegexp @CriticalPackagesList @AllowedConfigOptions + $WindowsMainMenuName + $RelocPrefix + $RelocTree ); @EXPORT = @EXPORT_OK; } +# the year of our release, will be used in the location of the +# network packges, and in menu names, and probably many other places +$ReleaseYear = 2009; + # Meta Categories do not ship files, but call only for other packages our @MetaCategories = qw/Collection Scheme/; our $MetaCategoriesRegexp = '(Collection|Scheme)'; @@ -53,17 +61,20 @@ our $DatabaseName = "texlive.tlpdb"; our $BlockSize = 4096; # the way we package things on the web -our $DefaultContainerExtension = "tar.lzma"; +our $DefaultContainerExtension = "tar.xz"; our $Archive = "archive"; our $TeXLiveServerURL = "http://mirror.ctan.org"; -our $TeXLiveServerPath = "systems/texlive/tlnet/2008"; +our $TeXLiveServerPath = "systems/texlive/tlnet/$ReleaseYear"; our $TeXLiveURL = "$TeXLiveServerURL/$TeXLiveServerPath"; +our $RelocTree = "texmf-dist"; +our $RelocPrefix = "RELOC"; our $WinSpecialUpdatePackagesRegexp = '^(texlive\.infra|bin-tlperl\.win32$|bin-texlive)'; + our @CriticalPackagesList = qw/texlive.infra bin-texlive/; push(@CriticalPackagesList, "bin-tlperl.win32") if ($^O=~/^MSWin(32|64)$/i); @@ -84,6 +95,8 @@ our @AllowedConfigOptions = qw/ autobackup /; +our $WindowsMainMenuName = "TeX Live $ReleaseYear"; + 1; @@ -165,7 +178,16 @@ since they are too central, currently bin-texlive and texlive.infra. =item C<@TeXLive::TLConfig::AllowedConfigOptions> -A list of a config options that can be set in 00texlive-installation.config. +A list of a config options that can be set in 00texlive.installation. + +=item C<$TeXLive::TLConfig::RelocTree> + +the texmf-tree name that can be relocated, defaults to "texmf-dist" + +=item C<$TeXLive::TLConfig::RelocPrefix> + +The string that replaces the RelocTree in the tlpdb if a package is +reloaced, defaults to "RELOC". =back diff --git a/Master/tlpkg/TeXLive/TLMedia.pm b/Master/tlpkg/TeXLive/TLMedia.pm index 344b4a0d2b7..70c5cd67679 100644 --- a/Master/tlpkg/TeXLive/TLMedia.pm +++ b/Master/tlpkg/TeXLive/TLMedia.pm @@ -8,9 +8,8 @@ package TeXLive::TLMedia; use TeXLive::TLConfig; -use TeXLive::TLPostActions; use TeXLive::TLUtils qw(copy win32 dirname mkdirhier basename download_file - merge_into debug ddebug info tlwarn); + merge_into debug ddebug info tlwarn log); use TeXLive::TLPDB; sub new @@ -42,7 +41,7 @@ sub new } } debug("Loading $location/$InfraLocation/$DatabaseName ...\n"); - my $tlpdb = TeXLive::TLPDB->new(root => "$location"); + my $tlpdb = TeXLive::TLPDB->new(root => $location); return(undef) unless defined($tlpdb); my (@all_c, @std_c, @lang_c, @lang_doc_c); my (@schemes); @@ -117,6 +116,7 @@ sub install_package { # even if opt_doc is false $real_opt_doc = 1; } + my $reloc = 1 if $tlpobj->relocated; my $container; my @installfiles; my $location = $self->location; @@ -146,16 +146,17 @@ sub install_package { } elsif ($media eq 'CD') { if (-r "$location/$Archive/$pkg.zip") { $container = "$location/$Archive/$pkg.zip"; - } elsif (-r "$location/$Archive/$pkg.tar.lzma") { - $container = "$location/$Archive/$pkg.tar.lzma"; + } elsif (-r "$location/$Archive/$pkg.tar.xz") { + $container = "$location/$Archive/$pkg.tar.xz"; } else { - tlwarn("Cannot find a package $pkg (.zip or .lzma) in $location/$Archive\n"); + tlwarn("Cannot find a package $pkg (.zip or .xz) in $location/$Archive\n"); next; } } elsif (&media eq 'NET') { $container = "$location/$Archive/$pkg.$DefaultContainerExtension"; } - $self->_install_package($container,\@installfiles,$totlpdb) || return(0); + $self->_install_package ($container, $reloc, \@installfiles, $totlpdb) + || return(0); # if we are installing from CD or NET we have to fetch the respective # source and doc packages $pkg.source and $pkg.doc and install them, too if (($media eq 'NET') || ($media eq 'CD')) { @@ -164,21 +165,39 @@ sub install_package { # - src/doc files should be installed # (- the package is not already a split one (like .i386-linux)) # the above test has been removed because it would mean that - # texlive.infra.doc.tar.lzma + # texlive.infra.doc.tar.xz # will never be installed, and we do already check that there # are at all src/doc files, which in split packages of the form # foo.ARCH are not present. And if they are present, than that is fine, - # too (bin-foobar.win32.doc.tar.lzma) + # too (bin-foobar.win32.doc.tar.xz) # - there are actually src/doc files present if ($container_src_split && $opt_src && $tlpobj->srcfiles) { my $srccontainer = $container; - $srccontainer =~ s/(\.tar\.lzma|\.zip)$/.source$1/; - $self->_install_package($srccontainer,\@installfiles,$totlpdb) || return(0); + $srccontainer =~ s/(\.tar\.xz|\.zip)$/.source$1/; + $self->_install_package ($srccontainer, $reloc, \@installfiles, $totlpdb) + || return(0); } if ($container_doc_split && $real_opt_doc && $tlpobj->docfiles) { my $doccontainer = $container; - $doccontainer =~ s/(\.tar\.lzma|\.zip)$/.doc$1/; - $self->_install_package($doccontainer,\@installfiles,$totlpdb) || return(0); + $doccontainer =~ s/(\.tar\.xz|\.zip)$/.doc$1/; + $self->_install_package ($doccontainer, $reloc, \@installfiles, $totlpdb) + || return(0); + } + # + # if we installed from NET/CD and we got a relocatable container + # make sure that the stray texmf-dist/tlpkg directory is removed + # in USER MODE that should NOT be done because we keep the information + # there, but for now do it unconditionally + if ($tlpobj->relocated) { + my $reloctree = $totlpdb->root . "/" . $TeXLive::TLConfig::RelocTree; + my $tlpkgdir = $reloctree . "/" . $TeXLive::TLConfig::InfraLocation; + my $tlpod = $tlpkgdir . "/tlpobj"; + TeXLive::TLUtils::rmtree($tlpod) if (-d $tlpod); + # we try to remove the tlpkg directory, that will succeed only + # if it is empty. So in normal installations it won't be, but + # if we are installing a relocated package it is texmf-dist/tlpkg + # which will be (hopefully) empty + rmdir($tlpkgdir) if (-d "$tlpkgdir"); } } # we don't want to have wrong information in the tlpdb, so remove the @@ -190,7 +209,7 @@ sub install_package { $tlpobj->clear_docfiles; } # we have to write out the tlpobj file since it is contained in the - # archives (.tar.lzma) but at DVD install time we don't have them + # archives (.tar.xz) but at DVD install time we don't have them my $tlpod = $totlpdb->root . "/tlpkg/tlpobj"; mkdirhier( $tlpod ); open(TMP,">$tlpod/".$tlpobj->name.".tlpobj") or @@ -204,10 +223,12 @@ sub install_package { merge_into(\%ret, $tlpobj->make_return_hash_from_executes("enable")); if (!$nopostinstall) { # do the postinstallation actions - if (defined($PostInstall{$pkg})) { - 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("install", $tlpobj, + $totlpdb->option_file_assocs, + $totlpdb->option_desktop_integration, + $totlpdb->option_post_code); } return \%ret; } @@ -219,17 +240,18 @@ sub install_package { # returns 1 on success and 0 on error # sub _install_package { - my ($self, $what, $filelistref, $totlpdb) = @_; + my ($self, $what, $reloc, $filelistref, $totlpdb) = @_; my $media = $self->media; my $target = $totlpdb->root; + my $tempdir = "$target/temp"; my @filelist = @$filelistref; # we assume that $::progs has been set up! my $wget = $::progs{'wget'}; - my $lzmadec = $::progs{'lzmadec'}; - if (!defined($wget) || !defined($lzmadec)) { + my $xzdec = $::progs{'xzdec'}; + if (!defined($wget) || !defined($xzdec)) { tlwarn("_install_package: programs not set up properly, strange.\n"); return(0); } @@ -246,27 +268,31 @@ sub _install_package { } # we always assume that copy will work return(1); - } elsif ($what =~ m,\.tar(\.lzma)?$,) { - my $type = defined($1) ? "lzma" : "tar"; + } elsif ($what =~ m,\.tar(\.xz)?$,) { + my $type = defined($1) ? "xz" : "tar"; + $target .= "/$TeXLive::TLConfig::RelocTree" if $reloc; + # this is the case when we install from CD or the NET, or a backup # - # in all other cases we create temp files .tar.lzma (or use the present - # one), lzmadec them, and then call tar + # in all other cases we create temp files .tar.xz (or use the present + # one), xzdec them, and then call tar my $fn = basename($what); - mkdirhier("$target/temp"); + my $pkg = $fn; + $pkg =~ s/\.tar(\.xz)?$//; + mkdirhier("$tempdir"); my $tarfile; my $remove_tarfile = 1; - if ($type eq "lzma") { - my $lzmafile = "$target/temp/$fn"; - $tarfile = "$target/temp/$fn"; $tarfile =~ s/\.lzma$//; - my $lzmafile_quote = $lzmafile; + if ($type eq "xz") { + my $xzfile = "$tempdir/$fn"; + $tarfile = "$tempdir/$fn"; $tarfile =~ s/\.xz$//; + my $xzfile_quote = $xzfile; my $tarfile_quote = $tarfile; my $target_quote = $target; if (win32()) { - $lzmafile =~ s!/!\\!g; - $lzmafile_quote = "\"$lzmafile\""; + $xzfile =~ s!/!\\!g; + $xzfile_quote = "\"$xzfile\""; $tarfile =~ s!/!\\!g; $tarfile_quote = "\"$tarfile\""; $target =~ s!/!\\!g; @@ -275,28 +301,28 @@ sub _install_package { if ($what =~ m,http://|ftp://,) { # we are installing from the NET # download the file and put it into temp - if (!download_file($what, $lzmafile) || (! -r $lzmafile)) { + if (!download_file($what, $xzfile) || (! -r $xzfile)) { tlwarn("Downloading \n"); tlwarn(" $what\n"); tlwarn("did not succeed, please retry.\n"); - unlink($tarfile, $lzmafile); + unlink($tarfile, $xzfile); return(0); } } else { # we are installing from CD # copy it to temp - copy($what, "$target/temp"); + copy($what, $tempdir); } - debug("un-lzmaing $lzmafile to $tarfile\n"); - system("$lzmadec < $lzmafile_quote > $tarfile_quote"); + debug("un-xzing $xzfile to $tarfile\n"); + system("$xzdec < $xzfile_quote > $tarfile_quote"); if (! -f $tarfile) { - tlwarn("_install_package: Unpacking $lzmafile failed, please retry.\n"); - unlink($tarfile, $lzmafile); + tlwarn("_install_package: Unpacking $xzfile failed, please retry.\n"); + unlink($tarfile, $xzfile); return(0); } - unlink($lzmafile); + unlink($xzfile); } else { - $tarfile = "$target/temp/$fn"; + $tarfile = "$tempdir/$fn"; if ($what =~ m,http://|ftp://,) { if (!download_file($what, $tarfile) || (! -r $tarfile)) { tlwarn("Downloading \n"); @@ -310,13 +336,125 @@ sub _install_package { $remove_tarfile = 0; } } - return TeXLive::TLUtils::untar($tarfile, $target, $remove_tarfile); + my $ret = TeXLive::TLUtils::untar($tarfile, $target, $remove_tarfile); + # remove the $pkg.tlpobj, we recreate it anyway again + unlink ("$target/tlpkg/tlpobj/$pkg.tlpobj") + if (-r "$target/tlpkg/tlpobj/$pkg.tlpobj"); + return $ret; } else { tlwarn("_install_package: Don't know how to install $what\n"); return(0); } } +# +# remove_package removes a single package with all files (including the +# # tlpobj files) and the entry from the tlpdb. +sub remove_package { + my ($self, $pkg, $nopostinstall) = @_; + my $localtlpdb = $self->tlpdb; + my $tlp = $localtlpdb->get_package($pkg); + my %ret; + if (!defined($tlp)) { + tlwarn ("$pkg: package not present, cannot remove\n"); + } else { + if ($pkg =~ m/^texlive\.infra/) { + log ("Not removing $pkg, it is essential!\n"); + return; + } + # we have to chdir to $localtlpdb->root + my $Master = $localtlpdb->root; + chdir ($Master) || die "chdir($Master) failed: $!"; + my @files = $tlp->all_files; + # also remove the .tlpobj file + push @files, "tlpkg/tlpobj/$pkg.tlpobj"; + # and the ones from src/doc splitting + if (-r "tlpkg/tlpobj/$pkg.source.tlpobj") { + push @files, "tlpkg/tlpobj/$pkg.source.tlpobj"; + } + if (-r "tlpkg/tlpobj/$pkg.doc.tlpobj") { + push @files, "tlpkg/tlpobj/$pkg.doc.tlpobj"; + } + # + # some packages might be relocated, thus having the RELOC prefix + # in user mode we just remove the prefix, in normal mode we + # replace it with texmf-dist + # since we don't have user mode + if ($tlp->relocated) { + for (@files) { + s:^$RelocPrefix/:$RelocTree/:; + } + } + # + # we want to check that a file is only listed in one package, so + # in case that a file to be removed is listed in another package + # we will warn and *not* remove it + my %allfiles; + for my $p ($localtlpdb->list_packages) { + next if ($p eq $pkg); # we have to skip the to be removed package + for my $f ($localtlpdb->get_package($p)->all_files) { + $allfiles{$f} = $p; + } + } + my @goodfiles = (); + my @badfiles = (); + for my $f (@files) { + # in usermode we have to add texmf-dist again for comparison + if (defined($allfiles{$f})) { + # this file should be removed but is mentioned somewhere, too + push @badfiles, $f; + } else { + push @goodfiles, $f; + } + } + if ($#badfiles >= 0) { + # warn the user + tlwarn("The following files should be removed due to the removal of $pkg,\n"); + tlwarn("but are part of another package, too.\n"); + for my $f (@badfiles) { + tlwarn(" $f - $allfiles{$f}\n"); + } + } + # + # Run only the postaction code thing now since afterwards the + # files will be gone ... + if (!$nopostinstall) { + &TeXLive::TLUtils::do_postaction("remove", $tlp, + 0, # option_file_assocs, + 0, # option_desktop_integration, + $localtlpdb->option_post_code); + } + # + # now do the removal + foreach my $entry (@goodfiles) { + unlink $entry; + } + tlwarn("MISSING REMOVAL OF EMPTY DIRECTORIES: sub removed_dirs needed!\n"); + #my @removals = &removed_dirs (@goodfiles); + #foreach my $entry (@removals) { + # rmdir $entry; + #} + $localtlpdb->remove_package($pkg); + merge_into(\%ret, $tlp->make_return_hash_from_executes("disable")); + $ret{'mktexlsr'} = 1; + # should we save at each removal??? + # advantage: the tlpdb actually reflects what is installed + # 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; + # + # Run the post installation code in the postaction tlpsrc entries + # the postaction code part cannot be evaluated now since the + # files are already removed. + if (!$nopostinstall) { + &TeXLive::TLUtils::do_postaction("remove", $tlp, + $localtlpdb->option_file_assocs, + $localtlpdb->option_desktop_integration, + 0); + } + } + return \%ret; +} # member access functions @@ -344,10 +482,9 @@ C -- TeX Live Media module use TeXLive::TLMedia; - my $tlnet = TeXLive::TLMedia->new('NET'); - my $tlneo = TeXLive::TLMedia->new('NET','http://www.ctan.org/mirror/tl/'); - my $tlcd = TeXLive::TLMedia->new('CD','/mnt/tl-cd/'); - my $tldvd = TeXLive::TLMedia->new('DVD','/mnt/tl-dvd/'); + my $tlneo = TeXLive::TLMedia->new('http://www.ctan.org/mirror/tl/'); + my $tlcd = TeXLive::TLMedia->new('/mnt/tl-cd/'); + my $tldvd = TeXLive::TLMedia->new('/mnt/tl-dvd/'); =head1 DESCRIPTION diff --git a/Master/tlpkg/TeXLive/TLPDB.pm b/Master/tlpkg/TeXLive/TLPDB.pm index 0fdf61039ec..bd0458c963e 100644 --- a/Master/tlpkg/TeXLive/TLPDB.pm +++ b/Master/tlpkg/TeXLive/TLPDB.pm @@ -214,49 +214,49 @@ sub from_file { my $tlpdbfile; if ($path =~ m;^((http|ftp)://|file:\/\/*);) { debug("TLPDB.pm: trying to initialize from $path\n"); - # if we have lzmadec available we try the lzma file - if (defined($::progs{'lzmadec'})) { - # we first try the lzma compressed file + # if we have xzdec available we try the xz file + if (defined($::progs{'xzdec'})) { + # we first try the xz compressed file my $tmpdir = TeXLive::TLUtils::get_system_tmpdir(); my $bn = TeXLive::TLUtils::basename("$path"); - my $lzmafile = "$tmpdir/$bn.$$.lzma"; - my $lzmafile_quote = $lzmafile; + my $xzfile = "$tmpdir/$bn.$$.xz"; + my $xzfile_quote = $xzfile; # this is a variable of the whole sub as we have to remove the file # before returning $tlpdbfile = "$tmpdir/$bn.$$"; my $tlpdbfile_quote = $tlpdbfile; if (win32()) { - $lzmafile =~ s!/!\\!g; + $xzfile =~ s!/!\\!g; $tlpdbfile =~ s!/!\\!g; } - $lzmafile_quote = "\"$lzmafile\""; + $xzfile_quote = "\"$xzfile\""; $tlpdbfile_quote = "\"$tlpdbfile\""; - debug("trying to download $path.lzma to $lzmafile\n"); - my $ret = TeXLive::TLUtils::download_file("$path.lzma", "$lzmafile"); + debug("trying to download $path.xz to $xzfile\n"); + my $ret = TeXLive::TLUtils::download_file("$path.xz", "$xzfile"); # better to check both, the return value AND the existence of the file - if ($ret && (-r "$lzmafile")) { + if ($ret && (-r "$xzfile")) { # ok, let the fun begin - debug("un-lzmaing $lzmafile to $tlpdbfile\n"); - # lzmadec *hopefully* returns 0 on success and anything else on failure + debug("un-xzing $xzfile to $tlpdbfile\n"); + # xzdec *hopefully* returns 0 on success and anything else on failure # we don't have to negate since not zero means error in the shell # and thus in perl true - if (system("$::progs{'lzmadec'} <$lzmafile_quote >$tlpdbfile_quote")) { - debug("un-lzmaing $lzmafile failed, tryin gplain file\n"); - # to be sure we unlink the lzma file and the tlpdbfile - unlink($lzmafile); + if (system("$::progs{'xzdec'} <$xzfile_quote >$tlpdbfile_quote")) { + debug("un-xzing $xzfile failed, tryin gplain file\n"); + # to be sure we unlink the xz file and the tlpdbfile + unlink($xzfile); unlink($tlpdbfile); } else { - unlink($lzmafile); + unlink($xzfile); open($retfh, "<$tlpdbfile") || die "$0: open($tlpdbfile) failed: $!"; - debug("found the uncompressed lzma file\n"); + debug("found the uncompressed xz file\n"); } } } else { - debug("no lzmadec defined, not trying tlpdb.lzma ...\n"); + debug("no xzdec defined, not trying tlpdb.xz ...\n"); } if (!defined($retfh)) { - debug("TLPDB: downloading $path.lzma didn't succeed, try $path\n"); - # lzma did not succeed, so try the normal file + debug("TLPDB: downloading $path.xz didn't succeed, try $path\n"); + # xz did not succeed, so try the normal file $retfh = TeXLive::TLUtils::download_file($path, "|"); if (!$retfh) { die "open tlpdb($path) failed: $!"; @@ -277,7 +277,7 @@ sub from_file { } } until (!$ret); tlwarn("unusable location $path, could not load any packages\n") if (!$found); - # remove the un-lzma-ed tlpdb file from temp dir + # remove the un-xz-ed tlpdb file from temp dir # THAT IS RACY!!! we should fix that in some better way with tempfile unlink($tlpdbfile) if $tlpdbfile; return($found); @@ -394,13 +394,13 @@ sub _add_tlpcontainer { $container .= ".zip"; $unpackprog="unzip"; $args="-o -qq $container -d $dest"; - } elsif (-r "$container.lzma") { - $container .= ".lzma"; + } elsif (-r "$container.xz") { + $container .= ".xz"; $unpackprog="NO_IDEA_HOW_TO_UNPACK_LZMA"; $args="NO IDEA WHAT ARGS IT NEEDS"; - die "$0: lzma checked for but not implemented, maybe update TLPDB.pm"; + die "$0: xz checked for but not implemented, maybe update TLPDB.pm"; } else { - die "$0: No package $container (.zip or .lzma) in $ziplocation"; + die "$0: No package $container (.zip or .xz) in $ziplocation"; } tlwarn("Huuu, this needs testing and error checking!\n"); tlwarn("Should we use -a -- adapt line endings etc?\n"); @@ -788,7 +788,7 @@ Return the location of the actual C file used. This is a read-only function; you cannot change the root of the TLPDB using this function. -See C<00texlive-installation.config.tlpsrc> for a description of the +See C<00texlive.installation.tlpsrc> for a description of the special value C<__MASTER>. =cut @@ -1110,12 +1110,16 @@ Need to be documented =cut sub _set_option_value { - my ($self,$key,$value) = @_; - my $pkg = $self->{'tlps'}{'00texlive-installation.config'}; + my $self = shift; + $self->_set_option_value_pkg('00texlive.installation', @_); +} +sub _set_option_value_pkg { + my ($self,$pkgname,$key,$value) = @_; + my $pkg = $self->{'tlps'}{$pkgname}; my @newdeps; if (!defined($pkg)) { $pkg = new TeXLive::TLPOBJ; - $pkg->name("00texlive-installation.config"); + $pkg->name($pkgname); $pkg->category("TLCore"); push @newdeps, "$key:$value"; } else { @@ -1133,20 +1137,25 @@ sub _set_option_value { } } $pkg->depends(@newdeps); - $self->{'tlps'}{'00texlive-installation.config'} = $pkg; + $self->{'tlps'}{$pkgname} = $pkg; } sub _option_value { - my ($self,$key) = @_; - if (defined($self->{'tlps'}{'00texlive-installation.config'})) { - foreach my $d ($self->{'tlps'}{'00texlive-installation.config'}->depends) { + my $self = shift; + $self->_option_value_pkg('00texlive.installation', @_); +} + +sub _option_value_pkg { + my ($self,$pkg,$key) = @_; + if (defined($self->{'tlps'}{$pkg})) { + foreach my $d ($self->{'tlps'}{$pkg}->depends) { if ($d =~ m!^$key:(.*)$!) { return "$1"; } } return; } - tlwarn("00texlive-installation.config not found, cannot read option $key.\n"); + tlwarn("$pkg not found, cannot read option $key.\n"); return; } @@ -1156,6 +1165,15 @@ sub option { if (@_) { $self->_set_option_value($key, shift); } return $self->_option_value($key); } + +sub option_pkg { + my $self = shift; + my $pkg = shift; + my $key = shift; + if (@_) { $self->_set_option_value_pkg($pkg, $key, shift); } + return $self->_option_value_pkg($pkg, $key); +} + # TODO the above function should be used in the functions below as # far as possible ... @@ -1179,6 +1197,31 @@ sub option_create_symlinks { if (@_) { $self->_set_option_value("opt_create_symlinks", shift); } return $self->_option_value("opt_create_symlinks"); } +sub option_desktop_integration { + my $self = shift; + if (@_) { $self->_set_option_value("opt_desktop_integration", shift); } + return $self->_option_value("opt_desktop_integration"); +} +sub option_file_assocs { + my $self = shift; + if (@_) { $self->_set_option_value("opt_file_assocs", shift); } + return $self->_option_value("opt_file_assocs"); +} +sub option_post_code { + my $self = shift; + if (@_) { $self->_set_option_value("opt_post_code", shift); } + return $self->_option_value("opt_post_code"); +} +sub option_path { + my $self = shift; + if (@_) { $self->_set_option_value("opt_path", shift); } + return $self->_option_value("opt_path"); +} +sub option_w32_multi_user { + my $self = shift; + if (@_) { $self->_set_option_value("opt_w32_multi_user", shift); } + return $self->_option_value("opt_w32_multi_user"); +} sub option_install_docfiles { my $self = shift; if (@_) { $self->_set_option_value("opt_install_docfiles", shift); } @@ -1239,26 +1282,64 @@ containing only those formats present in the installation. =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 = ; - close(INFILE); - push @formatlines, @tmp; - } - return(@formatlines); + return @fmtlines; } =item C<< $tlpdb->updmap_cfg_lines >> @@ -1420,7 +1501,7 @@ named C and C. =item C> This option specifies a format for containers. The currently supported -formats are C and C. But note that C is untested. +formats are C and C. But note that C is untested. =back diff --git a/Master/tlpkg/TeXLive/TLPOBJ.pm b/Master/tlpkg/TeXLive/TLPOBJ.pm index 06233187de8..6b08caf8067 100644 --- a/Master/tlpkg/TeXLive/TLPOBJ.pm +++ b/Master/tlpkg/TeXLive/TLPOBJ.pm @@ -6,7 +6,9 @@ package TeXLive::TLPOBJ; -use TeXLive::TLConfig qw($DefaultCategory $CategoriesRegexp $MetaCategoriesRegexp $InfraLocation); +use TeXLive::TLConfig qw($DefaultCategory $CategoriesRegexp + $MetaCategoriesRegexp $InfraLocation + $RelocPrefix $RelocTree); use TeXLive::TLUtils; use TeXLive::TLTREE; @@ -22,6 +24,7 @@ sub new { shortdesc => $params{'shortdesc'}, longdesc => $params{'longdesc'}, catalogue => $params{'catalogue'}, + relocated => $params{'relocated'}, runfiles => defined($params{'runfiles'}) ? $params{'runfiles'} : [], runsize => $params{'runsize'}, srcfiles => defined($params{'srcfiles'}) ? $params{'srcfiles'} : [], @@ -29,6 +32,7 @@ sub new { 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 +96,7 @@ sub from_fh { ($lastcmd eq "docfiles") || ($lastcmd eq "srcfiles") || ($lastcmd eq "executes") || + ($lastcmd eq "postaction") || ($lastcmd eq "depend") ) { $line =~ s/^ /${lastcmd}continued /; } else { @@ -163,6 +168,10 @@ sub from_fh { $self->{'category'} = "$1"; $lastcmd = "category"; next; + } elsif ($line =~ /^relocated\s+([01])\s*/o) { + $self->relocated("$1"); + $lastcmd = "relocated"; + next; } elsif ($line =~ /^revision\s+(.*)\s*/o) { $self->{'revision'} = "$1"; $lastcmd = "revision"; @@ -216,6 +225,10 @@ sub from_fh { 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"; @@ -299,6 +312,7 @@ sub writeout { defined($self->{'catalogue'}) && print $fd "catalogue $self->{'catalogue'}\n"; defined($self->{'shortdesc'}) && print $fd "shortdesc $self->{'shortdesc'}\n"; defined($self->{'license'}) && print $fd "license $self->{'license'}\n"; + defined($self->{'relocated'}) && $self->{'relocated'} && print $fd "relocated 1\n"; # ugly hack to get rid of use FileHandle; see man perlform #format_name $fd "multilineformat"; select((select($fd),$~ = "multilineformat")[0]); @@ -316,6 +330,11 @@ sub writeout { 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 +407,11 @@ sub writeout_simple { 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'}}) { @@ -416,44 +440,70 @@ sub writeout_simple { } } +sub cancel_common_texmf_tree { + my $self = shift; + my @docfiles = $self->docfiles; + for (@docfiles) { s:^$RelocTree/:$RelocPrefix/:; } + $self->docfiles(@docfiles); + my @runfiles = $self->runfiles; + for (@runfiles) { s:^$RelocTree/:$RelocPrefix/:; } + $self->runfiles(@runfiles); + my @srcfiles = $self->srcfiles; + for (@srcfiles) { s:^$RelocTree/:$RelocPrefix/:; } + $self->srcfiles(@srcfiles); + # if there are bin files they have definitely NOT the + # texmf-dist prefix, so we cannot cancel it anyway +} + +sub common_texmf_tree { + my $self = shift; + my $tltree; + my $dd = 0; + my @files = $self->all_files; + foreach ($self->all_files) { + my $tmp; + ($tmp) = split m@/@; + if (defined($tltree) && ($tltree ne $tmp)) { + return; + } else { + $tltree = $tmp; + } + } + # if there are no files then it is by default relocatable, so + # return the right tree + if (!@files) { + $tltree = $RelocTree; + } + return $tltree; +} + -sub make_container -{ +sub make_container { my ($self,$type,$instroot,$destdir,$containername,$relative) = @_; - if (($type ne "lzma") && ($type ne "tar")) { - die "$0: TLPOBJ supports tar and lzma containers, not $type"; + if (($type ne "xz") && ($type ne "tar")) { + die "$0: TLPOBJ supports tar and xz containers, not $type"; } if (!defined($containername)) { $containername = $self->name; } - my @files = (); + my @files = $self->all_files; my $compresscmd; my $tlpobjdir = "$InfraLocation/tlpobj"; - my %binf = %{$self->{'binfiles'}}; - foreach (keys %binf) { - push @files, @{$binf{$_}}; - } - push @files, $self->runfiles; - push @files, $self->docfiles; - push @files, $self->srcfiles; @files = TeXLive::TLUtils::sort_uniq(@files); # we do relative packages ONLY if the files do NOT span multiple # texmf trees. check this here my $tltree; if ($relative) { - foreach (@files) { - my $tmp; - ($tmp) = split m@/@; - if (defined($tltree) && ($tltree ne $tmp)) { - die ("$0: package $containername spans multiple trees, " - . "relative generation not allowed"); - } else { - $tltree = $tmp; - } + $tltree = $self->common_texmf_tree; + if (!defined($tltree)) { + die ("$0: package $containername spans multiple trees, " + . "relative generation not allowed"); } - my @nf; - map { s@^$tltree/@@ ; push @nf, $_; } @files; - @files = @nf; + if ($tltree ne $RelocTree) { + die ("$0: building $pkg container relocatable but the comon prefix" + . "is not $RelocTree"); + } + s,^$RelocTree/,, foreach @files; } # load Cwd only if necessary ... require Cwd; @@ -468,7 +518,9 @@ sub make_container # and put the tlpobj into the root! if ($relative) { chdir("./$tltree"); - $tlpobjdir = "."; + # we don't need to change the $tlpobjdir because we put it in + # all cases into tlpkg/tlpobj + #$tlpobjdir = "./tlpkg/tlpobj"; } # we add the .tlpobj into the .tlpobj directory my $removetlpobjdir = 0; @@ -485,33 +537,33 @@ sub make_container if ($type eq "tar") { $containername = $tarname; } else { - $containername = "$tarname.lzma"; + $containername = "$tarname.xz"; } # start the fun my $tar = $::progs{'tar'}; - my $lzma; + my $xz; if (!defined($tar)) { tlwarn("$0: programs not set up, trying \"tar\".\n"); $tar = "tar"; } - if ($type eq "lzma") { - $lzma = $::progs{'lzma'}; - if (!defined($lzma)) { - tlwarn("$0: programs not set up, trying \"lzma\".\n"); - $lzma = "lzma"; + if ($type eq "xz") { + $xz = $::progs{'xz'}; + if (!defined($xz)) { + tlwarn("$0: programs not set up, trying \"xz\".\n"); + $xz = "xz"; } } # No owner/group options if we are being called on a user's machine to # make a backup. We only want these when we are making the master - # containers for tlnet. Also exclude .svn directories when making the + # containers for tlnet. Also exclude .svn directories when making the # masters. We determine user vs. master by whether there's a revision # suffix in the container name. my @attrs = $containername =~ /\.r[0-9]/ ? () : ("--owner", "0", "--group", "0", "--exclude", ".svn"); my @cmdline = ($tar, "-cf", "$destdir/$tarname", @attrs); - + # Get list of files and symlinks to back up. Nothing else should be # in the list. my @files_to_backup = (); @@ -553,10 +605,14 @@ sub make_container # if (length ("@files_to_backup") > 50000) { @files_to_backup = TeXLive::TLUtils::collapse_dirs(@files_to_backup); - # Yet another complication. collapse_dirs returns absolute paths. + # A complication, as always. collapse_dirs returns absolute paths. # We want to change them back to relative so that the backup tar # has the same structure. + # in relative mode we have to remove the texmf-dist prefix, too s,^$instroot/,, foreach @files_to_backup; + if ($relative) { + s,^$RelocTree/,, foreach @files_to_backup; + } } push(@cmdline, @files_to_backup); } @@ -567,11 +623,11 @@ sub make_container xsystem(@cmdline); # compress it. - if ($type eq "lzma") { + if ($type eq "xz") { if (-r "$destdir/$tarname") { - system($lzma, "--force", "-z", "$destdir/$tarname"); + system($xz, "--force", "-z", "$destdir/$tarname"); } else { - tlwarn("$0: Couldn't find $destdir/$tarname to run $lzma\n"); + tlwarn("$0: Couldn't find $destdir/$tarname to run $xz\n"); return (0, 0, ""); } } @@ -745,7 +801,7 @@ sub split_bin_package { foreach $a (keys(%binf)) { my $tlp = new TeXLive::TLPOBJ; $tlp->name($self->name . ".$a"); - $tlp->shortdesc("binary files of " . $self->name . " for $a"); + $tlp->shortdesc("$a files of " . $self->name); $tlp->revision($self->revision); $tlp->category($self->category); $tlp->add_binfiles($a,@{$binf{$a}}); @@ -840,7 +896,7 @@ sub make_return_hash_from_executes { } 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; @@ -882,6 +938,11 @@ sub revision { if (@_) { $self->{'revision'} = shift } return $self->{'revision'}; } +sub relocated { + my $self = shift; + if (@_) { $self->{'relocated'} = shift } + return ($self->{'relocated'} ? 1 : 0); +} sub catalogue { my $self = shift; if (@_) { $self->{'catalogue'} = shift } @@ -1029,6 +1090,11 @@ sub executes { 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] } @@ -1071,9 +1137,11 @@ Please see L documentation for the specification. The only differences are that the various C<*pattern> keys are invalid, and instead there are the respective C<*files> keys described below. Furthermore some more I is allowed: C which specifies the maximum of -all last changed revision of files contained in the package, and anything +all last changed revision of files contained in the package, anything starting with C specifying information coming from the -TeX Catalogue. +TeX Catalogue, and C taking either 0 or 1 indicating that +this packages has been relocated, i.e., in the containers the +initial C directory has been stripped off. All these keys have in common that they are followed by a list of files I by one space. They differ only in the first line itself @@ -1190,7 +1258,7 @@ the C function returns (and takes as argument) a hash with the architectures as keys, similar to the C functions (see above). Futhermore, if the tlpobj is contained ina tlpdb which describes a media -where the files are distributed in packed format (usually as .tar.lzma), +where the files are distributed in packed format (usually as .tar.xz), there are 6 more possible keys: $tlpobj->containersize @@ -1246,17 +1314,23 @@ or the filehandle if given: debugging function for comparison with C/C, will go away. +=item C + +if all files of the package are from the same texmf tree, this tree +is returned, otherwise an undefined value. That is also a check +whether a package is relocatable. + =item C creates a container file of the all files in the C in C<$destdir> (if not defined then C<< TLPOBJ->containerdir >> is used). The C<$type> variable specifies the type of container to be used. -Currently only C or C are allowed, and are generating -zip files and tar.lzma files, respectively. +Currently only C or C are allowed, and are generating +zip files and tar.xz files, respectively. The file name of the created container file is C<$containername.extension>, -where extension is either C<.zip> or C<.tar.lzma>, depending on the +where extension is either C<.zip> or C<.tar.xz>, depending on the setting of C<$type>. If no C<$containername> is specified the package name is used. diff --git a/Master/tlpkg/TeXLive/TLPSRC.pm b/Master/tlpkg/TeXLive/TLPSRC.pm index d2d13d98543..41ff0601915 100644 --- a/Master/tlpkg/TeXLive/TLPSRC.pm +++ b/Master/tlpkg/TeXLive/TLPSRC.pm @@ -30,6 +30,7 @@ sub new 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 @@ sub from_file my $catalogue = ""; my (@executes, @depends); my (@runpatterns, @docpatterns, @binpatterns, @srcpatterns); + my (@postactions); my $started = 0; my $finished = 0; my $savedline = ""; @@ -132,6 +134,9 @@ sub from_file } 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 @@ sub from_file $self->docpatterns(@docpatterns) if @docpatterns; $self->executes(@executes) if @executes; $self->depends(@depends) if @depends; + $self->postactions(@postactions) if @postactions; } @@ -175,6 +181,11 @@ sub writeout 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 @@ sub make_tlpobj $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 @@ sub executes { if (@_) { @{ $self->{'executes'} } = @_ } return @{ $self->{'executes'} }; } +sub postactions { + my $self = shift; + if (@_) { @{ $self->{'postactions'} } = @_ } + return @{ $self->{'postactions'} }; +} format multilineformat = longdesc ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<~~ @@ -580,7 +597,7 @@ I I where I can be C, C, C, C, C, C, C, C, C, -C, or C. +C, C, or C. Continuation lines are supported via a trailing backslash. That is, if the C<.tlpsrc> file contains two physical lines like this: @@ -631,14 +648,14 @@ The full list of currently used packages of this type is: This package contains configuration options for the TeX Live archive. If container_split_{doc,src}_files occurs in the depend lines the -{doc,src} files are split into separate containers (.tar.lzma) +{doc,src} files are split into separate containers (.tar.xz) during container build time. Note that this has NO effect on the appearance within the texlive.tlpdb. It is only on container level. The container_format/XXXXX specifies the format, currently allowed -is only "lzma", which generates .tar.lzma files. zip can be supported. +is only "xz", which generates .tar.xz files. zip can be supported. release/NNNN specifies the release number as used in the installer. -=item B<00texlive-installation.config> +=item B<00texlive.installation> This package serves a double purpose: @@ -737,9 +754,51 @@ I for that language. The additional variables I are: C, C (both integers), and C (a comma-separated list of alias names for that hyphenation). -=item C I +=item C engine=I [I...]> + +activates the format with name I based on the engine I. The +additional variables I are: +C which can only be equal to C in which case the format +will only be mentioned but disabled (prefixed with C<#!>; +C which gives the patterns file, if not present C<-> is used; +C which gives the additional options for the C file. + +=back + +=item + +gives a free from entry of post install and removal actions to be +executed. The difference to the C statement is that +C is concerned with system integration, i.e., adjusting +things outside the installation directory, while C touches +only things within the installation. + +Currently the following Cs are understood: + +=over 4 + +=item C type=menu|desktop icon=I cmd=I args=I 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 cmd=I> + +On W32 associates the file type I with the command I. + +=item C filetype=I> + +On W32 declares files with the extenstion I<.ext> of file type I. + +=item C [filew32=I]> + +This postaction executes the given I with two arguments, the first +being the root of the installation, the second being either the string +C or C. -build the format I, as specified in the C file. +If the C argument is given this script is run on Windows systems +instead of the one given via C. =back diff --git a/Master/tlpkg/TeXLive/TLTREE.pm b/Master/tlpkg/TeXLive/TLTREE.pm index 5f47771e712..95c882dfdb6 100644 --- a/Master/tlpkg/TeXLive/TLTREE.pm +++ b/Master/tlpkg/TeXLive/TLTREE.pm @@ -253,10 +253,16 @@ sub _get_files_matching_glob_pattern { } } } - if ($dirpart =~ m@^bin/win32@) { + if (($dirpart =~ m@^bin/win32@) || ($dirpart =~ m@^bin/i386-cygwin@)) { # for arch=win32 under bin we want to automatch more extensions. foreach my $f (@candfiles) { - my $w32_binext = "bat|cmd|exe|dll|texlua"; + my $w32_binext; + if ($dirpart =~ m@^bin/win32@) { + $w32_binext = "bat|cmd|exe|dll|texlua"; + } else { + # cygwin part, they have .exe, but nothing else + $w32_binext = "exe"; + } ddebug("matching $f in $dirpart via glob $globline.($w32_binext)\n"); if ($f =~ /^$basepart\.($w32_binext)$/) { ddebug("hit: globline=$globline, $dirpart/$f\n"); diff --git a/Master/tlpkg/TeXLive/TLUtils.pm b/Master/tlpkg/TeXLive/TLUtils.pm index 4b7dafbc3f3..cd5fc335235 100644 --- a/Master/tlpkg/TeXLive/TLUtils.pm +++ b/Master/tlpkg/TeXLive/TLUtils.pm @@ -32,6 +32,7 @@ C -- utilities used in the TeX Live infrastructure TeXLive::TLUtils::tl_tmpdir(); TeXLive::TLUtils::xchdir($dir); TeXLive::TLUtils::xsystem(@args); + TeXLive::TLUtils::run_cmd($cmd); =head2 File Utilities @@ -56,6 +57,7 @@ C -- utilities used in the TeX Live infrastructure 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($how, $tlpobj); =head2 Miscellaneous @@ -113,10 +115,11 @@ BEGIN { &give_ctan_mirror &tlmd5 &xsystem + &run_cmd ); @EXPORT = qw(setup_programs download_file process_logging_options tlwarn info log debug ddebug dddebug debug_hash - win32 xchdir xsystem); + win32 xchdir xsystem run_cmd); } use Cwd; @@ -398,6 +401,25 @@ sub xsystem } } +=item C + +runs a command and captures its output. Then returns a list with the +output as first element and the return value (exit code) as second. + +=cut + +sub run_cmd { + my $cmd = shift; + my $output = `$cmd`; + $retval = $? + if ($retval != 0) { + $retval /= 256 if $retval > 0; + } + return ($output, $retval); +} + + + =back @@ -949,6 +971,7 @@ sub install_packages { my $starttime = time(); foreach my $package (@packs) { my $tlpobj = $tlpobjs{$package}; + my $reloc = $tlpobj->relocated; $n++; my $remtime = "??:??"; my $tottime = "??:??"; @@ -1006,16 +1029,16 @@ sub install_packages { } elsif ($media eq 'CD') { if (-r "$root/$Archive/$package.zip") { $container = "$root/$Archive/$package.zip"; - } elsif (-r "$root/$Archive/$package.tar.lzma") { - $container = "$root/$Archive/$package.tar.lzma"; + } elsif (-r "$root/$Archive/$package.tar.xz") { + $container = "$root/$Archive/$package.tar.xz"; } else { - tlwarn("No package $package (.zip or .lzma) in $root/$Archive\n"); + tlwarn("No package $package (.zip or .xz) in $root/$Archive\n"); next; } } elsif ($media eq 'NET') { $container = "$root/$Archive/$package.$DefaultContainerExtension"; } - if (!install_package($container, $tlpobj->containersize, + if (!install_package($container, $reloc, $tlpobj->containersize, $tlpobj->containermd5, \@installfiles, $totlpdb->root, $vars{'this_platform'})) { # we already warn in install_package that something bad happened, @@ -1036,8 +1059,8 @@ sub install_packages { # - there are actually src/doc files present if ($container_src_split && $opt_src && $tlpobj->srcfiles) { my $srccontainer = $container; - $srccontainer =~ s/(\.tar\.lzma|\.zip)$/.source$1/; - if (!install_package($srccontainer, $tlpobj->srccontainersize, + $srccontainer =~ s/(\.tar\.xz|\.zip)$/.source$1/; + if (!install_package($srccontainer, $reloc, $tlpobj->srccontainersize, $tlpobj->srccontainermd5, \@installfiles, $totlpdb->root, $vars{'this_platform'})) { return 0; @@ -1045,8 +1068,8 @@ sub install_packages { } if ($container_doc_split && $real_opt_doc && $tlpobj->docfiles) { my $doccontainer = $container; - $doccontainer =~ s/(\.tar\.lzma|\.zip)$/.doc$1/; - if (!install_package($doccontainer, + $doccontainer =~ s/(\.tar\.xz|\.zip)$/.doc$1/; + if (!install_package($doccontainer, $reloc, $tlpobj->doccontainersize, $tlpobj->doccontainermd5, \@installfiles, $totlpdb->root, $vars{'this_platform'})) { @@ -1064,7 +1087,7 @@ sub install_packages { } $totlpdb->add_tlpobj($tlpobj); # we have to write out the tlpobj file since it is contained in the - # archives (.tar.lzma) but at DVD install time we don't have them + # archives (.tar.xz) but at DVD install time we don't have them my $tlpod = $totlpdb->root . "/tlpkg/tlpobj"; mkdirhier( $tlpod ); open(TMP,">$tlpod/".$tlpobj->name.".tlpobj") || @@ -1083,7 +1106,7 @@ sub install_packages { } -=item C +=item C This function installs the files given in @$filelistref from C<$what> into C<$target>. @@ -1097,29 +1120,34 @@ the way. In this case the list C<@$filelistref> is not taken into account. If C<$what> starts with C or C then C<$what> is -downloaded from the net and piped through C and C. +downloaded from the net and piped through C and C. -If $what ends with C<.tar.lzma> (but does not start with C or +If $what ends with C<.tar.xz> (but does not start with C or C, but possibly with C) it is assumed to be a readable -file on the system and is likewise piped through C and C. +file on the system and is likewise piped through C and C. In both of these cases currently the list C<$@filelistref> currently is not taken into account (should be fixed!). +if C<$reloc> is true the container (NET or CD mode) is packaged in a way +that the initial texmf-dist is missing. + Returns 1 on success and 0 on error. =cut sub install_package { - my ($what, $whatsize, $whatmd5, $filelistref, $target, $platform) = @_; + my ($what, $reloc, $whatsize, $whatmd5, $filelistref, $target, $platform) = @_; my @filelist = @$filelistref; + my $tempdir = "$target/temp"; + # we assume that $::progs has been set up! my $wget = $::progs{'wget'}; - my $lzmadec = $::progs{'lzmadec'}; - if (!defined($wget) || !defined($lzmadec)) { - tlwarn("install_package: wget/lzmadec programs not set up properly.\n"); + my $xzdec = $::progs{'xzdec'}; + if (!defined($wget) || !defined($xzdec)) { + tlwarn("install_package: wget/xzdec programs not set up properly.\n"); return 0; } if (ref $what) { @@ -1132,35 +1160,43 @@ sub install_package { mkdirhier("$target/$dn"); copy "$root/$file", "$target/$dn"; } - } elsif ($what =~ m,\.tar.lzma$,) { + } elsif ($what =~ m,\.tar.xz$,) { # this is the case when we install from CD or the NET # - # in all other cases we create temp files .tar.lzma (or use the present - # one), lzmadec them, and then call tar + # in all other cases we create temp files .tar.xz (or use the present + # one), xzdec them, and then call tar + + # if we are unpacking a relocated container we adjust the target + if ($reloc) { + $target .= "/$TeXLive::TLConfig::RelocTree" if $reloc; + mkdir($target) if (! -d $target); + } my $fn = basename($what); - mkdirhier("$target/temp"); - my $lzmafile = "$target/temp/$fn"; - my $tarfile = "$target/temp/$fn"; $tarfile =~ s/\.lzma$//; - my $lzmafile_quote = $lzmafile; + my $pkg = $fn; + $pkg =~ s/\.tar\.xz$//; + mkdirhier("$tempdir"); + my $xzfile = "$tempdir/$fn"; + my $tarfile = "$tempdir/$fn"; $tarfile =~ s/\.xz$//; + my $xzfile_quote = $xzfile; my $tarfile_quote = $tarfile; if (win32()) { - $lzmafile =~ s!/!\\!g; + $xzfile =~ s!/!\\!g; $tarfile =~ s!/!\\!g; $target =~ s!/!\\!g; } - $lzmafile_quote = "\"$lzmafile\""; + $xzfile_quote = "\"$xzfile\""; $tarfile_quote = "\"$tarfile\""; my $gotfiledone = 0; - if (-r $lzmafile) { + if (-r $xzfile) { # check that the downloaded file is not partial if ($whatsize >= 0) { # we have the size given, so check that first - my $size = (stat $lzmafile)[7]; + my $size = (stat $xzfile)[7]; if ($size == $whatsize) { # we want to check also the md5sum if we have it present if ($whatmd5) { - if (tlmd5($lzmafile) eq $whatmd5) { + if (tlmd5($xzfile) eq $whatmd5) { $gotfiledone = 1; } else { tlwarn("Downloaded $what, size equal, but md5sum differs;\n", @@ -1174,12 +1210,12 @@ sub install_package { } } else { tlwarn("Partial download of $what found, removing it.\n"); - unlink($tarfile, $lzmafile); + unlink($tarfile, $xzfile); } } else { # ok no size information, hopefully we have md5 sums if ($whatmd5) { - if (tlmd5($lzmafile) eq $whatmd5) { + if (tlmd5($xzfile) eq $whatmd5) { $gotfiledone = 1; } else { tlwarn("Downloaded file, but md5sum differs, removing it.\n"); @@ -1190,39 +1226,44 @@ sub install_package { $gotfiledone = 1; } } - debug("Reusing already downloaded container $lzmafile\n") + debug("Reusing already downloaded container $xzfile\n") if ($gotfiledone); } if (!$gotfiledone) { if ($what =~ m,http://|ftp://,) { # we are installing from the NET # download the file and put it into temp - if (!download_file($what, $lzmafile) || (! -r $lzmafile)) { + if (!download_file($what, $xzfile) || (! -r $xzfile)) { tlwarn("Downloading $what did not succeed.\n"); return 0; } } else { # we are installing from CD # copy it to temp - copy($what, "$target/temp"); + copy($what, $tempdir); } } - debug("un-lzmaing $lzmafile to $tarfile\n"); - system("$lzmadec < $lzmafile_quote > $tarfile_quote"); + debug("un-xzing $xzfile to $tarfile\n"); + system("$xzdec < $xzfile_quote > $tarfile_quote"); if (! -f $tarfile) { - tlwarn("Unpacking $lzmafile did not succeed.\n"); + tlwarn("Unpacking $xzfile did not succeed.\n"); return 0; } if (!TeXLive::TLUtils::untar($tarfile, $target, 1)) { tlwarn("Un-tarring $tarfile did not succeed.\n"); return 0; } + # we remove the created .tlpobj it is recreated anyway in + # install_packages above in the right place. This way we also + # get rid of the $pkg.source.tlpobj which are useless + unlink ("$target/tlpkg/tlpobj/$pkg.tlpobj") + if (-r "$target/tlpkg/tlpobj/$pkg.tlpobj"); if ($what =~ m,http://|ftp://,) { # we downloaded the original .tar.lzma from the net, so we keep it } else { - # we are downloading it from CD, so we can unlink it to save + # we are downloading it from CD, so we can unlink it to save # disk space - unlink($lzmafile); + unlink($xzfile); } } else { tlwarn("Sorry, no idea how to install $what\n"); @@ -1231,6 +1272,261 @@ sub install_package { return 1; } +=item C + +Evaluates the C fields in the C<$tlpobj>. The first parameter +can be either C or C. The second gives the TLPOBJ whos +postactions should be evaluated, and the last three arguments specify +what type of postactions should (or shouldn't) be evaluated. + +Returns 1 on success, and 0 on failure. + +=cut + +sub do_postaction { + my ($how, $tlpobj, $do_fileassocs, $do_shortcuts, $do_script) = @_; + my $ret = 1; + if (!defined($tlpobj)) { + tlwarn("do_postaction: didn't get a tlpobj\n"); + return 0; + } + debug("running postaction=$how for " . $tlpobj->name . "\n") + if $tlpobj->postactions; + for my $pa ($tlpobj->postactions) { + if ($pa =~ m/^\s*shortcut\s+(.*)\s*$/) { + next unless $do_shortcuts; + $ret &&= _do_postaction_shortcut($how, $tlpobj, $1); + } elsif ($pa =~ m/\s*filetype\s+(.*)\s*$/) { + next unless $do_fileassocs; + $ret &&= _do_postaction_filetype($how, $tlpobj, $1); + } elsif ($pa =~ m/\s*fileassoc\s+(.*)\s*$/) { + next unless $do_fileassocs; + $ret &&= _do_postaction_fileassoc($how, $tlpobj, $1); + } elsif ($pa =~ m/\s*script\s+(.*)\s*$/) { + next unless $do_script; + $ret &&= _do_postaction_script($how, $tlpobj, $1); + } else { + tlwarn("do_postaction: don't know how to do $pa\n"); + $ret = 0; + } + } + # nothing to do + return $ret; +} + +sub _do_postaction_fileassoc { + my ($how, $tlpobj, $pa) = @_; + return 1 unless win32(); + my ($errors, %keyval) = + parse_into_keywords($pa, qw/extension filetype/); + + if ($errors) { + tlwarn("parsing the postaction line >>$pa<< did not succeed!\n"); + return 0; + } + + # name can be an arbitrary string + if (!defined($keyval{'extension'})) { + tlwarn("extension of fileassoc postaction not given\n"); + return 0; + } + my $extension = $keyval{'extension'}; + + # cmd can be an arbitrary string + if (!defined($keyval{'filetype'})) { + tlwarn("filetype of fileassoc postaction not given\n"); + return 0; + } + my $filetype = $keyval{'filetype'}; + + if ($how eq "install") { + TeXLive::TLWinGoo::register_extension($extension, $filetype); + } elsif ($how eq "remove") { + TeXLive::TLWinGoo::unregister_extension($extension); + } else { + tlwarn("Unknown mode $how\n"); + return 0; + } + return 1; +} +sub _do_postaction_filetype { + my ($how, $tlpobj, $pa) = @_; + return 1 unless win32(); + my ($errors, %keyval) = + parse_into_keywords($pa, qw/name cmd/); + + if ($errors) { + tlwarn("parsing the postaction line >>$pa<< did not succeed!\n"); + return 0; + } + + # name can be an arbitrary string + if (!defined($keyval{'name'})) { + tlwarn("name of filetype postaction not given\n"); + return 0; + } + my $name = $keyval{'name'}; + + # cmd can be an arbitrary string + if (!defined($keyval{'cmd'})) { + tlwarn("cmd of filetype postaction not given\n"); + return 0; + } + my $cmd = $keyval{'cmd'}; + + if ($how eq "install") { + TeXLive::TLWinGoo::register_file_type($name, $cmd); + } elsif ($how eq "remove") { + TeXLive::TLWinGoo::unregister_file_type($name); + } else { + tlwarn("Unknown mode $how\n"); + return 0; + } + return 1; +} + +sub _do_postaction_script { + my ($how, $tlpobj, $pa) = @_; + my ($errors, %keyval) = + parse_into_keywords($pa, qw/file filew32/); + + if ($errors) { + tlwarn("parsing the postaction line >>$pa<< did not succeed!\n"); + return 0; + } + + # file can be an arbitrary string + if (!defined($keyval{'file'})) { + tlwarn("filename of script not given\n"); + return 0; + } + my $file = $keyval{'file'}; + if (win32() && defined($keyval{'filew32'})) { + $file = $keyval{'filew32'}; + } + my $texdir = `kpsewhich -var-value=SELFAUTOPARENT`; + chomp($texdir); + my @syscmd; + if ($file =~ m/\.pl$/i) { + # we got a perl script, call it via perl + push @syscmd, "perl", "$texdir/$file"; + } elsif ($file =~ m/\.texlua$/i) { + # we got a texlua script, call it via texlua + push @syscmd, "texlua", "$texdir/$file"; + } else { + # we got anything else, call it directly and hope it is excutable + push @syscmd, "$texdir/$file"; + } + push @syscmd, $how, $texdir; + my $ret = system (@syscmd); + if ($ret != 0) { + $ret /= 256 if $ret > 0; + my $pwd = cwd (); + warn "$0: calling post action script $file did not succeed in $pwd, status $ret"; + return 0; + } + return 1; +} + +sub _do_postaction_shortcut { + my ($how, $tlpobj, $pa) = @_; + return 1 unless win32(); + my ($errors, %keyval) = + parse_into_keywords($pa, qw/type name icon cmd args hide/); + + if ($errors) { + tlwarn("parsing the postaction line >>$pa<< did not succeed!\n"); + return 0; + } + + # type can be either menu or desktop + if (!defined($keyval{'type'})) { + tlwarn("type of shortcut postaction not given\n"); + return 0; + } + my $type = $keyval{'type'}; + if (($type ne "menu") && ($type ne "desktop")) { + tlwarn("type of shortcut postaction $type is unknown (menu, desktop)\n"); + return 0; + } + + # name can be an arbitrary string + if (!defined($keyval{'name'})) { + tlwarn("name of shortcut postaction not given\n"); + return 0; + } + my $name = $keyval{'name'}; + + # icon, cmd, args is optional + my $icon = (defined($keyval{'icon'}) ? $keyval{'icon'} : ''); + my $cmd = (defined($keyval{'cmd'}) ? $keyval{'cmd'} : ''); + my $args = (defined($keyval{'args'}) ? $keyval{'args'} : ''); + + # hide can be only 0 or 1, and defaults to 0 + my $hide = (defined($keyval{'hide'}) ? $keyval{'hide'} : 0); + if (($hide ne "0") && ($hide ne "1")) { + tlwarn("hide of shortcut postaction $hide is unknown (0, 1)\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") { + TeXLive::TLWinGoo::add_menu_shortcut( + $TeXLive::TLConfig::WindowsMainMenuName, + $name, $icon, $cmd, $args, $hide); + } elsif ($type eq "desktop") { + TeXLive::TLWinGoo::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") { + TeXLive::TLWinGoo::remove_menu_shortcut( + $TeXLive::TLConfig::WindowsMainMenuName, $name); + } elsif ($type eq "desktop") { + TeXLive::TLWinGoo::remove_desktop_shortcut($name); + } else { + tlwarn("Unknown type of shortcut: $type\n"); + return 0; + } + } else { + tlwarn("Unknown mode $how\n"); + return 0; + } + return 1; +} + +sub parse_into_keywords { + my ($str, @keys) = @_; + my @words = quotewords('\s+', 0, $str); + my %ret; + my $error = 0; + while (@words) { + $_ = shift @words; + if (/^([^=]+)=(.*)$/) { + $ret{$1} = $2; + } else { + tlwarn("parser found a invalid word in parsing keys: $_\n"); + $error++; + $ret{$_} = ""; + } + } + for my $k (keys %ret) { + if (!member($k, @keys)) { + $error++; + tlwarn("parser found invalid keyword: $k\n"); + } + } + return($error, %ret); +} =item C @@ -1270,13 +1566,12 @@ sub untar { return $ret; } - =item C Populate the global C<$::progs> hash containing the paths to the -programs C, C, C. The C<$bindir> argument specifies -the path to the location of the C binaries, the C<$platform> +programs C, C, C. The C<$bindir> argument specifies +the path to the location of the C binaries, the C<$platform> gives the TeX Live platform name, used as the extension on our executables. If a program is not present in the TeX Live tree, we also check along PATH (without the platform extension.) @@ -1290,17 +1585,17 @@ sub setup_programs { my $ok = 1; $::progs{'wget'} = "wget"; - $::progs{'lzmadec'} = "lzmadec"; - $::progs{'lzma'} = "lzma"; + $::progs{'xzdec'} = "xzdec"; + $::progs{'xz'} = "xz"; $::progs{'tar'} = "tar"; if ($^O =~ /^MSWin(32|64)$/i) { $::progs{'wget'} = conv_to_w32_path("$bindir/wget/wget.exe"); $::progs{'tar'} = conv_to_w32_path("$bindir/tar.exe"); - $::progs{'lzmadec'} = conv_to_w32_path("$bindir/lzma/lzmadec.win32.exe"); - $::progs{'lzma'} = conv_to_w32_path("$bindir/lzma/lzma.exe"); - for my $prog ("lzmadec", "wget") { - my $opt = $prog eq "lzmadec" ? "--help" : "--version"; + $::progs{'xzdec'} = conv_to_w32_path("$bindir/xz/xzdec.exe"); + $::progs{'xz'} = conv_to_w32_path("$bindir/xz/xz.exe"); + for my $prog ("xzdec", "wget") { + my $opt = $prog eq "xzdec" ? "--help" : "--version"; my $ret = system("$::progs{$prog} $opt >nul 2>&1"); # on windows if ($ret != 0) { warn "TeXLive::TLUtils::setup_programs (w32) failed"; # no nl for perl @@ -1322,8 +1617,8 @@ sub setup_programs { } my $s = 0; $s += setup_unix_one('wget', "$bindir/wget/wget.$platform", "--version"); - $s += setup_unix_one('lzmadec',"$bindir/lzma/lzmadec.$platform","--help"); - $s += setup_unix_one('lzma', "$bindir/lzma/lzma.$platform", "notest"); + $s += setup_unix_one('xzdec',"$bindir/xz/xzdec.$platform","--help"); + $s += setup_unix_one('xz', "$bindir/xz/xz.$platform", "notest"); $ok = ($s == 3); # failure return unless all are present. } @@ -1600,7 +1895,7 @@ improved (checking for duplicates). sub create_fmtutil { my ($tlpdb,$dest,$localconf) = @_; my @lines = $tlpdb->fmtutil_cnf_lines; - _create_config_files($tlpdb, "texmf/fmtutil/fmtutil-hdr.cnf", $dest, + _create_config_files($tlpdb, "texmf/web2c/fmtutil-hdr.cnf", $dest, $localconf, 0, '#', \@lines); } diff --git a/Master/tlpkg/TeXLive/TLWinGoo.pm b/Master/tlpkg/TeXLive/TLWinGoo.pm index fbc163dd39e..c4d0558ceaa 100644 --- a/Master/tlpkg/TeXLive/TLWinGoo.pm +++ b/Master/tlpkg/TeXLive/TLWinGoo.pm @@ -58,7 +58,6 @@ C -- Additional utilities for Windows $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 @@ BEGIN { &add_menu_shortcut &remove_desktop_shortcut &remove_menu_shortcut - &init_unshortbat &create_uninstaller &unregister_uninstaller ); @@ -857,8 +855,7 @@ sub menu_path() { =pod -=item C +=item C Add a desktop shortcut, with name $name and icon $icon, pointing to program $prog with parameters $args (a string). Use a non-null @@ -866,14 +863,10 @@ batgui parameter if the shortcut starts a gui program via a 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); @@ -884,15 +877,6 @@ sub add_desktop_shortcut { $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 @@ -932,39 +916,16 @@ sub add_menu_shortcut { =pod -=item C - -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 -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 @@ -1035,7 +996,6 @@ path $td\\bin\\win32;%path% 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\" diff --git a/Master/tlpkg/bin/check-duplicated-runfiles b/Master/tlpkg/bin/check-duplicated-runfiles index d212c68e589..05a51860283 100755 --- a/Master/tlpkg/bin/check-duplicated-runfiles +++ b/Master/tlpkg/bin/check-duplicated-runfiles @@ -11,7 +11,7 @@ BEGIN { unshift (@INC, "$mydir/.."); } -use TeXLive::TLConfig; +use TeXLive::TLConfig qw/$RelocPrefix $RelocTree/; use TeXLive::TLPOBJ; use TeXLive::TLPDB; @@ -31,7 +31,9 @@ my @runtime_files = (); foreach my $tlpn ($tlpdb->list_packages) { next if ($tlpn =~ /$non_normal/); my $tlp = $tlpdb->get_package($tlpn); - push @runtime_files, $tlp->runfiles; + my @files = $tlp->runfiles; + if ($tlp->relocated) { for (@files) { s:^$RelocPrefix/:$RelocTree/:; } } + push @runtime_files, @files; } # build the duplicates list diff --git a/Master/tlpkg/bin/check-tlnet-consistency b/Master/tlpkg/bin/check-tlnet-consistency index 07ce83c08c1..81e5481859c 100755 --- a/Master/tlpkg/bin/check-tlnet-consistency +++ b/Master/tlpkg/bin/check-tlnet-consistency @@ -49,13 +49,13 @@ sub main # set up the programs ... if ($opt_nosetup) { # do a minimal setup - $::progs{'lzma'} = "lzma"; + $::progs{'xz'} = "xz"; $::progs{'tar'} = "tar"; } else { # do a full setup my $ret = &TeXLive::TLUtils::setup_programs("$Master/tlpkg/installer"); if ($ret == -1) { - tlwarn("no binary of lzmadec for $::_platform_ detected, aborting.\n"); + tlwarn("no binary of xzdec for $::_platform_ detected, aborting.\n"); exit 1; } if (!$ret) { @@ -82,16 +82,16 @@ sub main my %filedifferrors; foreach my $pkg ($tlpdb->list_packages()) { next if ($pkg =~ m/^00texlive/); - my $cont = "$opt_location/archive/$pkg.tar.lzma"; - my $srccont = "$opt_location/archive/$pkg.source.tar.lzma"; - my $doccont = "$opt_location/archive/$pkg.doc.tar.lzma"; + my $cont = "$opt_location/archive/$pkg.tar.xz"; + my $srccont = "$opt_location/archive/$pkg.source.tar.xz"; + my $doccont = "$opt_location/archive/$pkg.doc.tar.xz"; my $tlpdbtlpobj = $tlpdb->get_package($pkg); my $dodoc = ($tlpdb->config_doc_container && $tlpdbtlpobj->docfiles); my $dosrc = ($tlpdb->config_src_container && $tlpdbtlpobj->srcfiles); if ($opt_filelists) { - system("cat $cont | $::progs{lzmadec} | $::progs{tar} -C \"$temp\" -xf - "); + system("cat $cont | $::progs{xzdec} | $::progs{tar} -C \"$temp\" -xf - "); } else { - system("cat $cont | $::progs{lzmadec} | $::progs{tar} -C \"$temp\" -xf - tlpkg/tlpobj"); + system("cat $cont | $::progs{xzdec} | $::progs{tar} -C \"$temp\" -xf - tlpkg/tlpobj"); } if (! -r "$temp/tlpkg/tlpobj/$pkg.tlpobj") { push @notlpobj, $pkg; @@ -101,7 +101,7 @@ sub main die "Cannot load tlpobj from $temp/$pkg.tlpobj: $!" unless defined($tartlpobj); # get the src and doc containers unpacked and add the respective files if ($dosrc) { - system("cat $srccont | $::progs{lzmadec} | $::progs{tar} -C \"$temp\" -xf - tlpkg/tlpobj"); + system("cat $srccont | $::progs{xzdec} | $::progs{tar} -C \"$temp\" -xf - tlpkg/tlpobj"); if (! -r "$temp/tlpkg/tlpobj/$pkg.source.tlpobj") { push @missingsrccontainer, $pkg; } else { @@ -112,7 +112,7 @@ sub main } } if ($dodoc) { - system("cat $doccont | $::progs{lzmadec} | $::progs{tar} -C \"$temp\" -xf - tlpkg/tlpobj"); + system("cat $doccont | $::progs{xzdec} | $::progs{tar} -C \"$temp\" -xf - tlpkg/tlpobj"); if (! -r "$temp/tlpkg/tlpobj/$pkg.doc.tlpobj") { push @missingdoccontainer, $pkg; } else { @@ -191,7 +191,7 @@ sub main } } if (@sizeerror) { - print "packages with wrong container size/md5s:\n"; + print "packages with wront container size/md5s:\n"; for my $p (@sizeerror) { print "$p\n"; } @@ -268,7 +268,7 @@ default is C<./tlnet>. =item B<-no-setup> -Does not try to setup the various programs, but uses I and I +Does not try to setup the various programs, but uses I and I from path. =item B<-help> diff --git a/Master/tlpkg/bin/tl-fix-container-infos b/Master/tlpkg/bin/tl-fix-container-infos index 2f627976713..df0ac5ed2be 100755 --- a/Master/tlpkg/bin/tl-fix-container-infos +++ b/Master/tlpkg/bin/tl-fix-container-infos @@ -64,13 +64,13 @@ sub main # set up the programs. if ($opt_nosetup) { # do a minimal setup - $::progs{'lzma'} = "lzma"; + $::progs{'xz'} = "xz"; $::progs{'tar'} = "tar"; } else { # do a full setup my $ret = &TeXLive::TLUtils::setup_programs("$Master/tlpkg/installer"); if ($ret == -1) { - tlwarn("$0: no lzmadec for $::_platform_, aborting.\n"); + tlwarn("$0: no xzdec for $::_platform_, aborting.\n"); exit 1; } if (!$ret) { @@ -93,7 +93,7 @@ sub main $tlpdb->add_tlpobj($obj); } $tlpdb->save; - system("lzma --force -k -z $opt_location/tlpkg/texlive.tlpdb"); + system("xz --force -k -z $opt_location/tlpkg/texlive.tlpdb"); return 0; } @@ -102,16 +102,16 @@ sub main sub do_containers { my ($obj, $dosrc, $dodoc) = @_; my $fbase = "$opt_location/archive/" . $obj->name; - my ($a, $b) = do_size_md ("${fbase}.tar.lzma"); + my ($a, $b) = do_size_md ("${fbase}.tar.xz"); $obj->containersize($a); $obj->containermd5($b); if ($dosrc && $obj->srcfiles) { - ($a, $b) = do_size_md ("${fbase}.source.tar.lzma"); + ($a, $b) = do_size_md ("${fbase}.source.tar.xz"); $obj->srccontainersize($a); $obj->srccontainermd5($b); } if ($dodoc && $obj->docfiles) { - ($a, $b) = do_size_md ("${fbase}.doc.tar.lzma"); + ($a, $b) = do_size_md ("${fbase}.doc.tar.xz"); $obj->doccontainersize($a); $obj->doccontainermd5($b); } @@ -146,7 +146,7 @@ of containers to be compared against; default is C<.>. =item B<-no-setup> -Does not try to setup the various programs, but uses I and I +Does not try to setup the various programs, but uses I and I from the current path. =item B<-help> diff --git a/Master/tlpkg/bin/tl-makeself-from-tlnet b/Master/tlpkg/bin/tl-makeself-from-tlnet index 450d22230ed..2ead523a0fc 100755 --- a/Master/tlpkg/bin/tl-makeself-from-tlnet +++ b/Master/tlpkg/bin/tl-makeself-from-tlnet @@ -4,7 +4,7 @@ # This file is licensed under the GNU General Public License version 2 # or any later version. # -# Creates a .run file for updating the texlive.infra and bin-texlive +# Creates a .run file for updating the texlive.infra # packages on Unix, similar to the .exe we create for Windows. Both are # created in the nightly cron from tl-update-tlcritical. @@ -28,13 +28,12 @@ cd $TMP mkdir master cd master -# unpack texlive.infra and bin-texlive archives for all platforms, -# except w32. -for pkg in texlive.infra bin-texlive; do - for i in $ARCHIVE/$pkg*.tar.lzma ; do +# unpack texlive.infra archives for all platforms, except w32. +for pkg in texlive.infra; do + for i in $ARCHIVE/$pkg*.tar.xz ; do case "$i" in *win32*) ;; - *) lzmadec <$i | tar -xf - ;; + *) xzdec <$i | tar -xf - ;; esac done done @@ -68,25 +67,24 @@ if test -r "$ROOT/tlpkg/texlive.tlpdb"; then t_instdir=$ROOT/tlpkg/installer # target installer dir # ensure these target directories exist. - mkdir -p $t_instdir/lzma + mkdir -p $t_instdir/xz mkdir -p $t_instdir/wget # start the list of tlpobjs we will install - tlpobjs="$t_objdir/bin-texlive.tlpobj $t_objdir/texlive.infra.tlpobj" + tlpobjs="$t_objdir/texlive.infra.tlpobj" for a in $ROOT/bin/*; do test -d "$a" || continue # skip any cruft files b=`basename $a` # just the architecture name # add the tlpobjs for this platform t the list. - tlpobjs="$tlpobjs $t_objdir/bin-texlive.$b.tlpobj" tlpobjs="$tlpobjs $t_objdir/texlive.infra.$b.tlpobj" # install the bin dir for this platform. (cd bin && tar cf - $b) | (cd $ROOT/bin && tar xf -) # copy the installer binaries. - cp installer/lzma/lzmadec.$b $t_instdir/lzma/ - cp installer/lzma/lzma.$b $t_instdir/lzma/ + cp installer/xz/xzdec.$b $t_instdir/xz/ + cp installer/xz/xz.$b $t_instdir/xz/ test -r installer/wget/wget.$b \ && cp installer/wget/wget.$b $t_instdir/wget done diff --git a/Master/tlpkg/bin/tl-update-containers b/Master/tlpkg/bin/tl-update-containers index 56a62be6dbb..81a6a987ceb 100755 --- a/Master/tlpkg/bin/tl-update-containers +++ b/Master/tlpkg/bin/tl-update-containers @@ -24,7 +24,7 @@ use Pod::Usage; use File::Path; # packages matching these re's will not be updated without --all. -my @critical_pkg_list = qw/bin-texlive texlive\.infra/; +my @critical_pkg_list = qw/texlive\.infra/; our ($mydir, $vc_id); my $opt_all = 0; @@ -43,6 +43,7 @@ GetOptions( "location=s" => \$opt_location, "no-setup" => \$opt_nosetup, "recreate" => \$opt_recreate, + "relative" => \$opt_relative, "version" => \$opt_version, "help|?" => \$opt_help) or pod2usage(1); @@ -71,8 +72,8 @@ sub main my $srcsplit = $tlpdb->config_src_container; my $docsplit = $tlpdb->config_doc_container; my $format = $tlpdb->config_container_format; - my $type = "lzma"; - if ($format eq "lzma" || $format eq "zip") { + my $type = "xz"; + if ($format eq "xz" || $format eq "zip") { $type = $format; } else { tlwarn("$0: unknown container format $format in 00texlive.config; ", @@ -176,24 +177,24 @@ sub main } } - # The two packages 00texlive.config and 00texlive-installation.config + # The two packages 00texlive.config and 00texlive.installation # are essential and have to be included in each and every case. # So add them ... my $tlpconfig = $tlpdb->get_package("00texlive.config"); $nettlpdb->add_tlpobj($tlpconfig); - my $tlpinstconfig = $tlpdb->get_package("00texlive-installation.config"); + my $tlpinstconfig = $tlpdb->get_package("00texlive.installation"); $nettlpdb->add_tlpobj($tlpinstconfig); # set up the programs. if ($opt_nosetup) { # do a minimal setup - $::progs{'lzma'} = "lzma"; + $::progs{'xz'} = "xz"; $::progs{'tar'} = "tar"; } else { # do a full setup my $ret = &TeXLive::TLUtils::setup_programs("$Master/tlpkg/installer"); if ($ret == -1) { - tlwarn("$0: no lzmadec for $::_platform_, aborting.\n"); + tlwarn("$0: no xzdec for $::_platform_, aborting.\n"); exit 1; } if (!$ret) { @@ -235,14 +236,36 @@ sub main debug("updating $pkg containers ...\n"); # we have to make a copy otherwise the src/doc files in the original # tlpobj are removed, and thus also in the tlpdb to be saved!!! + my $objcopy = $obj->copy; + + # if we try to create relative containers we check the package + # for residing only in texmf-dist, and being relocatable, and + # not having a dependency on $pkg.ARCH + # TLPOBJ->common_texmf_tree returns the string of the + # common temxf tree or undefined, so we can use it in && + my $ctt = $objcopy->common_texmf_tree; + my $deps_on_arch = 0; + for ($objcopy->depends) { + if (m/^$pkg\.ARCH$/) { + $deps_on_arch = 1; + last; + } + } + my $do_relative = 0; + debug("pkg=$pkg deps_on_arch=$deps_on_arch, ctt=", defined($ctt)?$ctt:"(undefined)", "\n"); + $do_relative = $opt_relative && # user option + ($deps_on_arch?0:1) && # no $pkg.ARCH dep + (defined($ctt)?1:0) && # see above + (($ctt eq $TeXLive::TLConfig::RelocTree) ? 1 : 0); + # only for texmf-dist if ($srcsplit) { if (!$opt_dry) { my $objsrc = $obj->srcfiles_package; $objcopy->clear_srcfiles; if ($objsrc) { my ($s,$m) = $objsrc->make_container($type, $Master, $opt_containerdir, - "$pkg.source", $opt_relative); + "$pkg.source", $do_relative); if ($s > 0) { # something was created # important, we have to add it to the original $obj @@ -266,7 +289,7 @@ sub main $objcopy->clear_docfiles; if ($objdoc) { my ($s,$m) = $objdoc->make_container($type, $Master, - $opt_containerdir, "$pkg.doc", $opt_relative); + $opt_containerdir, "$pkg.doc", $do_relative); if ($s > 0) { # something was created $obj->doccontainersize($s); @@ -285,7 +308,7 @@ sub main } if (!$opt_dry) { my ($s,$m) = $objcopy->make_container($type, $Master, $opt_containerdir, - $pkg, $opt_relative); + $pkg, $do_relative); if ($s > 0) { $obj->containersize($s); } @@ -293,6 +316,10 @@ sub main $obj->containermd5($m); } } + # if the container has been build relocatable we save that information + $obj->relocated($do_relative); + # and remove the common prefix from the files in the tlpobj + $obj->cancel_common_texmf_tree if $do_relative; # add the updated (or new) TLPOBJ to NET TLPDB # that way the other container sizes are not destroyed $nettlpdb->add_tlpobj($obj) unless $opt_dry; @@ -300,7 +327,7 @@ sub main # remove old containers for my $op (@removecontainers) { - if (-r "$opt_containerdir/$op.tar.lzma") { + if (-r "$opt_containerdir/$op.tar.xz") { info("$0: $op container is old, removing it\n"); `rm $opt_containerdir/$op.*` unless $opt_dry; } @@ -349,13 +376,13 @@ sub main # docfiles into the texlive.tlpdb, no idea why. So update should now # do that. $nettlpdb->save; - system("lzma --force -k -z $opt_location/tlpkg/texlive.tlpdb"); + system("$::progs{'xz'} --force -k -z $opt_location/tlpkg/texlive.tlpdb"); if (! @ARGV) { # do a last check that all the containers are actually present foreach my $p ($nettlpdb->list_packages) { next if $p =~ /00texlive/; - if (! -r "$opt_containerdir/$p.tar.lzma") { + if (! -r "$opt_containerdir/$p.tar.xz") { tlwarn("$0: container for $p is missing, strange\n"); } } @@ -392,12 +419,12 @@ C if need be. =item B<-all|-a> Include packages deemed critical in the update, currently -C and C. (That is, C itself needs +C. (That is, C itself needs testing before updating, so we don't do it by default.) =item B<-no-setup> -Does not try to setup the various programs, but uses I and I +Does not try to setup the various programs, but uses I and I from the current path. =item B<-help> diff --git a/Master/tlpkg/bin/tl-update-nsis b/Master/tlpkg/bin/tl-update-nsis index a1acbd56ebc..78ef875db99 100755 --- a/Master/tlpkg/bin/tl-update-nsis +++ b/Master/tlpkg/bin/tl-update-nsis @@ -1,6 +1,6 @@ #!/usr/bin/env perl # $Id$ -# Copyright 2008 Norbert Preining +# Copyright 2008, 2009 Norbert Preining # This file is licensed under the GNU General Public License version 2 # or any later version. # @@ -40,13 +40,9 @@ sub main chomp (my $Master = `cd $mydir/../.. && pwd`); my $tlpdb = TeXLive::TLPDB->new ("root" => $Master); die("Cannot find tlpdb in $Master\n") unless defined($tlpdb); - my $bintexlive = $tlpdb->get_package("bin-texlive"); - my $bintexlivew32 = $tlpdb->get_package("bin-texlive.win32"); my $texliveinfra = $tlpdb->get_package("texlive.infra"); my $texliveinfraw32 = $tlpdb->get_package("texlive.infra.win32"); my @allfiles = (); - push @allfiles, $bintexlive->all_files; - push @allfiles, $bintexlivew32->all_files if defined $bintexlivew32; push @allfiles, $texliveinfra->all_files; push @allfiles, $texliveinfraw32->all_files if defined $texliveinfraw32; @@ -58,7 +54,7 @@ sub main $removetlpobjdir = 1; } my $rev = 0; # we want the highest rev all these packages. - for my $p ($bintexlive, $bintexlivew32, $texliveinfra, $texliveinfraw32) { + for my $p ($texliveinfra, $texliveinfraw32) { if (defined $p) { if ($p->revision > $rev) { $rev = $p->revision; @@ -95,7 +91,7 @@ Page instfiles Name "TeX Live Manager Update ${REV}" OutFile "update-tlmgr-${REV}.exe" -InstallDir "$PROGRAMFILES\texlive\2008" +InstallDir "$PROGRAMFILES\texlive\$TeXLive::TLConfig::ReleaseYear" RequestExecutionLevel "user" @@ -135,7 +131,7 @@ EOF } } print " ExecWait \'\"\$INSTDIR\\bin\\win32\\tlmgr.bat\" _include_tlpobj"; - for my $p ($bintexlive, $bintexlivew32, $texliveinfra, $texliveinfraw32) { + for my $p ($texliveinfra, $texliveinfraw32) { if (defined $p) { print " \"\$INSTDIR\\tlpkg\\tlpobj\\", $p->name, ".tlpobj\""; } diff --git a/Master/tlpkg/bin/tl-update-tlcritical b/Master/tlpkg/bin/tl-update-tlcritical index aa88d91815f..81b28dcdd68 100755 --- a/Master/tlpkg/bin/tl-update-tlcritical +++ b/Master/tlpkg/bin/tl-update-tlcritical @@ -34,7 +34,7 @@ do_updater () # update normal containers. echo "$0: running tl-update-containers (for critical packages)..." tl-update-containers -location $tlcrit -all \ - 00texlive-installation.config 00texlive.config bin-texlive texlive.infra + 00texlive.installation 00texlive.config texlive.infra # update Unix disaster recovery. echo "$0: running tl-makeself-from-tlnet..." diff --git a/Master/tlpkg/bin/tlpfiles b/Master/tlpkg/bin/tlpfiles index e41b6cf4c7e..d5407b45aab 100755 --- a/Master/tlpkg/bin/tlpfiles +++ b/Master/tlpkg/bin/tlpfiles @@ -17,7 +17,7 @@ BEGIN { use strict; -use TeXLive::TLConfig; +use TeXLive::TLConfig qw/$RelocPrefix $RelocTree/; use TeXLive::TLPDB; use Pod::Usage; use Getopt::Long; @@ -58,6 +58,7 @@ sub main die "$0: no TeX Live package named $pkg in $Master.\n" if ! $obj; my @files = $obj->all_files; + if ($obj->relocated) { for (@files) { s:^$RelocPrefix/:$RelocTree/:; } } print "$_\n" foreach @files; return 0; diff --git a/Master/tlpkg/bin/tlpkg-by-size b/Master/tlpkg/bin/tlpkg-by-size index 9b204966e0b..3f15ffb1d3d 100755 --- a/Master/tlpkg/bin/tlpkg-by-size +++ b/Master/tlpkg/bin/tlpkg-by-size @@ -5,9 +5,9 @@ test $# -eq 0 && set - /home/ftp/texlive/tlnet/2008/archive cd "$1" || exit 1 -for pkgtar in `ls *.tar.lzma | egrep -v '\..*\.tar\.lzma$'`; do - pkg=`echo $pkgtar | sed 's/\.tar\.lzma$//'` - size=`cat $pkg.*tar.lzma | wc -c` +for pkgtar in `ls *.tar.xz | egrep -v '\..*\.tar\.xz$'`; do + pkg=`echo $pkgtar | sed 's/\.tar\.xz$//'` + size=`cat $pkg.*tar.xz | wc -c` size=`expr $size / 1024` printf "%6d %s\n" $size "$pkg" done | sort -nr diff --git a/Master/tlpkg/bin/tlpkg-ctan-check b/Master/tlpkg/bin/tlpkg-ctan-check index 3dda28951a8..6afade21522 100755 --- a/Master/tlpkg/bin/tlpkg-ctan-check +++ b/Master/tlpkg/bin/tlpkg-ctan-check @@ -8,7 +8,7 @@ BEGIN { unshift (@INC, "$mydir/.."); } -use TeXLive::TLConfig; +use TeXLive::TLConfig qw/$RelocPrefix $RelocTree/; use TeXLive::TLPOBJ; use TeXLive::TLPDB; @@ -331,6 +331,7 @@ sub do_tlp push @tpm_files, $tlp->runfiles; push @tpm_files, $tlp->docfiles; push @tpm_files, $tlp->srcfiles; + if ($tlp->relocated) { for (@tpm_files) { s:^$RelocPrefix/:$RelocTree/:; } } # we don't push bin files, should we? my @compared = (); diff --git a/Master/tlpkg/bin/tlprm b/Master/tlpkg/bin/tlprm index 997fb3b8d6a..0c2663a6d02 100755 --- a/Master/tlpkg/bin/tlprm +++ b/Master/tlpkg/bin/tlprm @@ -18,7 +18,7 @@ BEGIN { use strict; -use TeXLive::TLConfig; +use TeXLive::TLConfig qw/$RelocPrefix $RelocTree/; use TeXLive::TLPDB; use TeXLive::TLPSRC; use TeXLive::TLUtils; @@ -50,6 +50,7 @@ sub main } my @files = $obj->all_files; + if ($tlp->relocated) { for (@files) { s:^$RelocPrefix/:$RelocTree/:; } } my $tlpsrc = new TeXLive::TLPSRC; $tlpsrc->from_file ($f); push (@files, $tlpsrc->_srcfile); # also want to remove the tlpsrc file. diff --git a/Master/tlpkg/installer/install-menu-perltk.pl b/Master/tlpkg/installer/install-menu-perltk.pl index 5d1134c64a0..93c3ba90b5a 100644 --- a/Master/tlpkg/installer/install-menu-perltk.pl +++ b/Master/tlpkg/installer/install-menu-perltk.pl @@ -1,7 +1,8 @@ #!/usr/bin/env perl # $Id$ # -# Copyright 2008 Norbert Preining, Reinhard Kotucha +# Copyright 2008, 2009 Norbert Preining +# Copyright 2008 Reinhard Kotucha # This file is licensed under the GNU General Public License version 2 # or any later version. # @@ -62,7 +63,6 @@ my $texmfsysconfigtext; my $texmfhometext; my $texdirtext; my $langcoltext; -my $symlinktext; my $optletterstate; my $optfmtstate; my $optsrcstate; @@ -70,6 +70,7 @@ my $optdocstate; my $letteryesno = ( $vars{'option_letter'} ? $text{'yes'} : $text{'no'} ); my $fmtyesno = ( $vars{'option_fmt'} ? $text{'yes'} : $text{'no'} ); my $srcyesno = ( $vars{'option_src'} ? $text{'yes'} : $text{'no'} ); +my $deskintyesno = ( $vars{'option_desktop_integration'} ? $text{'yes'} : $text{'no'} ); my $docyesno = ( $vars{'option_doc'} ? $text{'yes'} : $text{'no'} ); $::run_menu = \&run_menu_perltk; @@ -258,15 +259,13 @@ sub run_menu_perltk { $fr->Button(-text => $text{'toggle'}, -command => sub { toggle_and_set_opt_variable(\$vars{'option_src'}, \$srcyesno); })->grid(-row => $row, -column => 3, -sticky => "ew", -padx => "2m"); } + $row++; + $fr->Label(-text => $labels{'desktop_integration'}, -anchor => 'w')->grid(-row => $row, -column => 1, -sticky => 'w'); + $fr->Label(-anchor => 'w', -textvariable => \$deskintyesno)->grid(-row => $row, -column => 2, -padx => "2m"); if (unix()) { - $row++; - # Symlinks - $fr->Label(-text => "------- $text{'sysint'} -------")->grid(-row => $row, -column => 1,-columnspan => 3); - - $row++; - $fr->Label(-text => $labels{'symlink'}, -anchor => 'w')->grid(-row => $row, -column => 1, -sticky => 'w'); - $symlinktext = $fr->Label(-anchor => 'w')->grid(-row => $row, -column => 2, -padx => "2m"); $fr->Button(-text => $text{'change'}, -command => sub { menu_select_symlink(); })->grid(-row => $row, -column => 3, -sticky => "ew", -padx => "2m"); + } else { + $fr->Button(-text => $text{'toggle'}, -command => sub { toggle_and_set_opt_variable(\$vars{'option_desktop_integration'}, \$deskintyesno); })->grid(-row => $row, -column => 3, -sticky => "ew", -padx => "2m"); } # install/cancel buttons @@ -596,7 +595,7 @@ sub menu_select_lang_collections { sub menu_select_symlink { our ($lbin,$lman,$linfo); - our $osym = $vars{'option_symlinks'}; + our $osym = $vars{'option_desktop_integration'}; our ($binlab,$binb,$manlab,$manb,$infolab,$infob); sub set_unset_buttons { $lbin = ($osym ? $vars{'sys_bin'} : ''); @@ -630,8 +629,8 @@ sub menu_select_symlink { $vars{'sys_info'} = $linfo; $vars{'sys_man'} = $lman; } - $vars{'option_symlinks'} = $osym; - menu_update_texts(); + $vars{'option_desktop_integration'} = $osym; + toggle_and_set_opt_variable(\$vars{'option_desktop_integration'}, \$deskintyesno); } my $sw = $mainwindow->Toplevel(-title => $labels{'symlink'}); $sw->transient($mainwindow); @@ -695,10 +694,6 @@ sub menu_set_text { $w->configure(-text => $t, @_); } -sub menu_set_symlink_text { - menu_set_text($symlinktext, (($vars{'option_symlinks'})?$text{'yes'}:$text{'no'})); -} - sub menu_set_schemebutton_text { menu_set_text($schemebutton, "$vars{'selected_scheme'}"); } @@ -762,7 +757,6 @@ sub menu_update_texts { $optfmtstate = ($vars{'option_fmt'} ? $text{'yes'} : $text{'no'}); $optsrcstate = ($vars{'option_src'} ? $text{'yes'} : $text{'no'}); $optdocstate = ($vars{'option_doc'} ? $text{'yes'} : $text{'no'}); - if (unix()) { menu_set_symlink_text; }; } sub callback_select_scheme { diff --git a/Master/tlpkg/installer/install-menu-text.pl b/Master/tlpkg/installer/install-menu-text.pl index 87c99474789..f87a0924fb1 100755 --- a/Master/tlpkg/installer/install-menu-text.pl +++ b/Master/tlpkg/installer/install-menu-text.pl @@ -2,7 +2,8 @@ # $Id$ # install-menu-txt.pl # -# Copyright 2007, 2008 Reinhard Kotucha, Norbert Preining +# Copyright 2007, 2008 Reinhard Kotucha +# Copyright 2007, 2008, 2009 Norbert Preining # This file is licensed under the GNU General Public License version 2 # or any later version. # @@ -12,6 +13,7 @@ use vars qw(@::end_install_hook $::opt_no_cls); our %vars; our $tlpdb; +our $previoustlpdb; our @collections_std; our @collections_lang; our @collections_lang_doc; @@ -109,6 +111,25 @@ sub prompt { # The menu loop. A menu is a function. Its return value is a # reference to another menu or to itself. sub run_menu_text { + my (@args) = @_; + # the text mode installer does not take interest in any argument + # but the -old-installation-found + while (@args) { + my $f = shift @args; + if ($f eq "-old-installation-found") { + print "\nAn old installation of TeX Live has been found in ", + $previoustlpdb->root, "\n"; + print " +If you want the selection of collections and various options being taken +over press `y', otherwise anything else. + +Import settings from previous TeX Live installation: (y/n): "; + chomp(my $yn = ); + if ($yn =~ m/^y$/i) { + import_settings_from_old_tlpdb(); + } + } + } my $menu=\&main_menu; while ($RETURN == $MENU_CONTINUE) { $menu=$menu->(); @@ -197,37 +218,28 @@ sub scheme_menu { menu_head 'Select a scheme:'; - foreach my $pkg ($tlpdb->list_packages) { - my $tlpobj = $tlpdb->{'tlps'}{$pkg}; - if ($tlpobj->category eq "Scheme") { - push @schemes, $pkg; - $vars{"$pkg"}=($vars{'selected_scheme'} eq $pkg)? 1:0; - } + foreach my $pkg ($tlpdb->schemes) { + push @schemes, $pkg; + $vars{"$pkg"}=($vars{'selected_scheme'} eq $pkg)? 1:0; } @schemes=sort @schemes; + push @schemes, "scheme-custom"; foreach my $scheme (@schemes) { $keyval{$keys[$index]}="$scheme"; - my $tlpobj = $tlpdb->get_package("$scheme"); - printf " %s %s %s\n", $keys[$index], button($vars{"$scheme"}), - $tlpobj->shortdesc; + if ($scheme ne "scheme-custom") { + my $tlpobj = $tlpdb->get_package("$scheme"); + printf " %s %s %s\n", $keys[$index], button($vars{"$scheme"}), + $tlpobj->shortdesc; + } else { + printf " %s %s custom selection of collections\n", + $keys[$index], button($vars{'selected_scheme'} eq "scheme-custom"); + } ++$index; } - foreach my $entry (keys %vars) { - if ($entry=~/^(collection-.*)/) { - $vars{"$1"}=0; - } - } + select_scheme($vars{'selected_scheme'}); - my $scheme_tlpobj = $tlpdb->get_package($vars{'selected_scheme'}); - if (defined ($scheme_tlpobj)) { - foreach my $dependent ($scheme_tlpobj->depends) { - if ($dependent=~/^(collection-.*)/) { - $vars{"$1"}=1; - } - } - } if ($vars{"binary_win32"}) { $vars{"collection-wintools"} = 1; } else { @@ -239,6 +251,7 @@ sub scheme_menu { if (defined $keyval{"$answer"}) { $vars{'selected_scheme'}=$keyval{"$answer"}; + select_scheme($vars{'selected_scheme'}); return $command{'self'}->(); } if (defined $command{"\u$answer"}) { @@ -368,13 +381,13 @@ sub language_menu { my $tlpobj = $tlpdb->get_package("$language"); $keyval{$lang_keys[$index]}="$language"; printf " %s %s %-33s", $lang_keys[$index], button($vars{"$language"}), - substr($tlpobj->shortdesc,0,33); + substr($tlpobj->shortdesc,0,33); if (defined $languages[$index+$lines]) { my $language=$languages[$index+$lines]; my $tlpobj = $tlpdb->get_package("$language"); $keyval{$lang_keys[$index+$lines]}="$language"; printf " %s %s %-32s\n", $lang_keys[$index+$lines], - button($vars{"$language"}), substr($tlpobj->shortdesc,0,32); + button($vars{"$language"}), substr($tlpobj->shortdesc,0,32); } else { print "\n"; } @@ -389,13 +402,13 @@ sub language_menu { my $tlpobj = $tlpdb->get_package("$lang_doc"); $keyval{$lang_doc_keys[$index]}="$lang_doc"; printf " %s %s %-33s", $lang_doc_keys[$index], button($vars{"$lang_doc"}), - substr($tlpobj->shortdesc,0,33); + substr($tlpobj->shortdesc,0,33); if (defined $lang_docs[$index+$lines]) { my $lang_doc=$lang_docs[$index+$lines]; my $tlpobj = $tlpdb->get_package("$lang_doc"); $keyval{$lang_doc_keys[$index+$lines]}="$lang_doc"; printf " %s %s %-32s\n", $lang_doc_keys[$index+$lines], - button($vars{"$lang_doc"}), substr($tlpobj->shortdesc,0,32); + button($vars{"$lang_doc"}), substr($tlpobj->shortdesc,0,32); } else { print "\n"; } @@ -675,19 +688,22 @@ sub help_menu { sub options_menu { - my $b_symlinks=button($vars{'option_symlinks'}); + my $b_path=button($vars{'option_path'}); my $b_doc=button($vars{'option_doc'}); my $b_src=button($vars{'option_src'}); my $b_fmt=button($vars{'option_fmt'}); my $b_letter=button($vars{'option_letter'}); + my $b_deskint=button($vars{'option_desktop_integration'}); + my $b_fileassocs=button($vars{'option_file_assocs'}); + my $b_admin=button($vars{'option_w32_multi_user'}); my $sys_bin=$vars{'sys_bin'}; my $sys_man=$vars{'sys_man'}; my $sys_info=$vars{'sys_info'}; - my $t_sys_bin=($vars{'option_symlinks'})? $vars{'sys_bin'}:''; - my $t_sys_man=($vars{'option_symlinks'})? $vars{'sys_man'}:''; - my $t_sys_info=($vars{'option_symlinks'})? $vars{'sys_info'}:''; + my $t_sys_bin=($vars{'option_path'})? $vars{'sys_bin'}:''; + my $t_sys_man=($vars{'option_path'})? $vars{'sys_man'}:''; + my $t_sys_info=($vars{'option_path'})? $vars{'sys_info'}:''; my %command=( 'self' => \&options_menu, @@ -700,7 +716,7 @@ sub options_menu { print <<"EOF";

use letter size instead of A4 by default: $b_letter - create all format files: $b_fmt + create format files: $b_fmt EOF ; if ($vars{'doc_splitting_supported'} and !$vars{'from_dvd'}) { @@ -709,14 +725,29 @@ EOF if ($vars{'src_splitting_supported'} and !$vars{'from_dvd'}) { print " install font/macro source tree: $b_src\n"; } - if (unix() && !$vars{'from_dvd'}) { - print <<"EOF"; - create symlinks in standard directories: $b_symlinks + if (!$vars{'from_dvd'}) { + if (unix()) { + print <<"EOF"; + create symlinks in standard directories: $b_path binaries to: $t_sys_bin manpages to: $t_sys_man info to: $t_sys_info EOF ; + } else { + print <<"EOF"; + adjust registry entry for path: $b_path +EOF +; + } + if (win32()) { + print " install menu items, shortcuts, etc: $b_deskint\n"; + print " update file associations: $b_fileassocs\n"; + if (admin()) { + # if we are admin we allow normal user installation, too + print " make installation available to all users: $b_admin\n"; + } + } } other_options qw(R Q diskspace); my $answer = prompt 'Enter command'; @@ -726,8 +757,8 @@ EOF my $home = getenv('HOME'); $home = getenv('USERPROFILE') if (win32()); $home ||= '~'; - toggle 'option_symlinks'; - if ($vars{'option_symlinks'}) { + toggle 'option_path'; + if ($vars{'option_path'}) { print "New value for binary directory [$sys_bin]: "; chomp($answer=); $vars{'sys_bin'} = "$answer" if (length $answer); @@ -751,9 +782,28 @@ EOF } return $command{'self'}; } + } else { + if (("\u$answer" eq 'L') and !$vars{'from_dvd'}) { + my $home = getenv('HOME'); + $home = getenv('USERPROFILE') if (win32()); + $home ||= '~'; + toggle 'option_path'; + return $command{'self'}; + } } + if ("\u$answer" eq 'M') { + toggle 'option_desktop_integration'; + return $command{'self'}; + + } elsif ("\u$answer" eq 'N') { + toggle 'option_file_assocs'; + return $command{'self'}; + + } elsif ("\u$answer" eq 'U') { + toggle 'option_w32_multi_user'; + return $command{'self'}; - if ("\u$answer" eq 'P') { + } elsif ("\u$answer" eq 'P') { toggle 'option_letter'; return $command{'self'}; @@ -802,11 +852,14 @@ sub dvd_hd_toggle { sub main_menu { my $this_platform=platform_desc($vars{'this_platform'}); - my $b_symlinks=button($vars{'option_symlinks'}); + my $b_path=button($vars{'option_path'}); my $b_doc=button($vars{'option_doc'}); my $b_src=button($vars{'option_src'}); my $b_fmt=button($vars{'option_fmt'}); my $b_letter=button($vars{'option_letter'}); + my $b_deskint=button($vars{'option_desktop_integration'}); + my $b_fileassocs=button($vars{'option_file_assocs'}); + my $b_admin=button($vars{'option_w32_multi_user'}); my $warn_nobin; @@ -913,8 +966,15 @@ EOF if ($vars{'src_splitting_supported'}) { print " $b_src install macro/font source tree\n"; } - if (unix()) { - print " $b_symlinks create symlinks in standard directories\n"; + if (win32()) { + print " $b_path adjust search path\n"; + print " $b_deskint add menu items, shortcuts, etc.\n"; + print " $b_fileassocs update file associations\n"; + if (admin()) { + print " $b_admin make installation available to all users\n"; + } + } else { + print " $b_path create symlinks to standard directories\n"; } } diff --git a/Master/tlpkg/installer/install-translations.pl b/Master/tlpkg/installer/install-translations.pl index 19a19fecf13..d05f78cce73 100644 --- a/Master/tlpkg/installer/install-translations.pl +++ b/Master/tlpkg/installer/install-translations.pl @@ -52,12 +52,12 @@ if (defined($::opt_lang)) { } -our %text = (title => 'TeX Live 2008 Installation', +our %text = (title => 'TeX Live 2009 Installation', basicinfo => 'Basic Information', custom => 'Further Customization', dirsetup => "Directory setup", options => 'Options', - sysint => 'System Integration', + desktop_integration => 'Desktop Integration', change => 'Change', toggle => 'Toggle', install => 'Install TeX Live', @@ -93,7 +93,7 @@ our %text = (title => 'TeX Live 2008 Installation', welcome => 'Welcome to TeX Live!', next => 'Next >', prev => '< Back', - wizhello => "Welcome to the installation of TeX Live 2008\n" + wizhello => "Welcome to the installation of TeX Live 2009\n" . "http://tug.org/texlive\n\n" . "This wizard will guide you through the installation.\n\n" . "For an advanced, customizable installation, please consult\n" @@ -101,7 +101,7 @@ our %text = (title => 'TeX Live 2008 Installation', destfolder => 'Destination folder:', advcustom => 'Advanced customization', pathinfo => "The destination folder will contain the installation.\nIt is strongly recommended to keep the year as the last component.", - readyinst => "We are ready to install TeX Live 2008.\nThe following settings will be used.\nIf you want to change something please go back,\notherwise press the \"Install\" button.", + readyinst => "We are ready to install TeX Live 2009.\nThe following settings will be used.\nIf you want to change something please go back,\notherwise press the \"Install\" button.", instshort => 'Install', wizard => 'Go to Wizard', ); @@ -121,6 +121,7 @@ our %labels = (binsys => 'Binary System(s)', optdoc => 'Install font/macro doc tree', optsrc => 'Install font/macro source tree', symlink => 'Create symlinks in system directories', + desktop_integration => 'Desktop Integration', ); if (($::lang ne "en") && ($::lang ne "C")) { diff --git a/Master/tlpkg/installer/lang/perltk-cs b/Master/tlpkg/installer/lang/perltk-cs index 60d0273fe72..7057eeadaba 100644 --- a/Master/tlpkg/installer/lang/perltk-cs +++ b/Master/tlpkg/installer/lang/perltk-cs @@ -14,7 +14,7 @@ text.basicinfo: Základní informace text.custom: Další úpravy text.dirsetup: Nastavení adresářové struktury text.options: Volby -text.sysint: Systémová integrace +text.desktop_integration: Systémová integrace text.change: Změnit text.toggle: Přepnout text.install: Instalovat TeX Live diff --git a/Master/tlpkg/installer/lang/perltk-de b/Master/tlpkg/installer/lang/perltk-de index 90f36040dad..43767c40003 100644 --- a/Master/tlpkg/installer/lang/perltk-de +++ b/Master/tlpkg/installer/lang/perltk-de @@ -7,7 +7,7 @@ text.custom: Weitere Einstellungen text.basicinfo: Grundlegende Informationen text.dirsetup: Setup der Ordner text.options: Optionen -text.sysint: Systemintegration +text.desktop_integration: Systemintegration text.change: Ändern text.toggle: Ändern text.install: TeX Live installieren diff --git a/Master/tlpkg/installer/lang/perltk-en.sample b/Master/tlpkg/installer/lang/perltk-en.sample index 857edfef7a8..eb846ae006d 100644 --- a/Master/tlpkg/installer/lang/perltk-en.sample +++ b/Master/tlpkg/installer/lang/perltk-en.sample @@ -46,7 +46,7 @@ text.selectscheme: Select a scheme text.selectstdcol: Select the collections to be installed text.selectsys: Select arch-os text.status: Status output -text.sysint: System Integration +text.desktop_integration: Desktop Integration text.title: TeX Live 2008 Installation text.toggle: Toggle text.welcome: Welcome to TeX Live! diff --git a/Master/tlpkg/installer/lang/perltk-fr b/Master/tlpkg/installer/lang/perltk-fr index 7f7fbe1d668..df7a20c275a 100644 --- a/Master/tlpkg/installer/lang/perltk-fr +++ b/Master/tlpkg/installer/lang/perltk-fr @@ -8,7 +8,7 @@ text.basicinfo: Informations générales text.custom: Personnalisation avancée text.dirsetup: Choix des répertoires text.options: Options -text.sysint: Intégration du système +text.desktop_integration: Intégration du système text.change: Changer text.toggle: (Dé)sélectionner text.install: Installer TeX Live diff --git a/Master/tlpkg/installer/lang/perltk-it b/Master/tlpkg/installer/lang/perltk-it index 16c7791137f..fc7123c8ba2 100644 --- a/Master/tlpkg/installer/lang/perltk-it +++ b/Master/tlpkg/installer/lang/perltk-it @@ -22,7 +22,7 @@ text.basicinfo: Informazioni di Base text.custom: Ulteriore Personalizzazione text.dirsetup: Configurazione delle directory text.options: Opzioni -text.sysint: Integrazione con il Sistema +text.desktop_integration: Integrazione con il Sistema text.change: Cambia text.toggle: Inverti text.install: Installa TeX Live diff --git a/Master/tlpkg/installer/lang/perltk-nl b/Master/tlpkg/installer/lang/perltk-nl index 03c0284fae3..210ef439286 100644 --- a/Master/tlpkg/installer/lang/perltk-nl +++ b/Master/tlpkg/installer/lang/perltk-nl @@ -7,7 +7,7 @@ text.basicinfo: Basisinformatie text.custom: Verfijning text.dirsetup: Folders text.options: Opties -text.sysint: Systeem-integratie +text.desktop_integration: Systeem-integratie text.change: Wijzig text.toggle: Wijzig text.install: Installeer TeX Live diff --git a/Master/tlpkg/installer/lang/perltk-pl b/Master/tlpkg/installer/lang/perltk-pl index 5b913aec03a..0650d97cc7a 100644 --- a/Master/tlpkg/installer/lang/perltk-pl +++ b/Master/tlpkg/installer/lang/perltk-pl @@ -6,7 +6,7 @@ text.custom: Dalsze ustawienia text.basicinfo: Informacje podstawowe text.dirsetup: Wybór folderów text.options: Opcje -text.sysint: Integracja systemu +text.desktop_integration: Integracja systemu text.change: Zmień text.toggle: Zmień text.install: Zainstaluj TeX Live diff --git a/Master/tlpkg/installer/lang/perltk-sl b/Master/tlpkg/installer/lang/perltk-sl index bf0b0efb1d9..c63d6e6ecd0 100644 --- a/Master/tlpkg/installer/lang/perltk-sl +++ b/Master/tlpkg/installer/lang/perltk-sl @@ -8,7 +8,7 @@ text.basicinfo: Osnovne nastavitve text.custom: Napredne nastavitve text.dirsetup: Nastavitve imenikov text.options: Ostale možnosti -text.sysint: Integracija v sistem +text.desktop_integration: Integracija v sistem text.change: Spremeni text.toggle: Vključi/Izključi text.install: Namesti TeX Live diff --git a/Master/tlpkg/installer/lang/perltk-vi b/Master/tlpkg/installer/lang/perltk-vi index 982ae6d0ef2..ffa2609fa0e 100644 --- a/Master/tlpkg/installer/lang/perltk-vi +++ b/Master/tlpkg/installer/lang/perltk-vi @@ -17,7 +17,7 @@ text.basicinfo: Thông tin cơ bản text.custom: Tinh chỉnh khác text.dirsetup: Thư mục cài đặt text.options: Tùy chọn -text.sysint: Tích hợp hệ thống +text.desktop_integration: Tích hợp hệ thống text.change: Đổi text.toggle: Toggle text.install: Cài đặt TeX Live diff --git a/Master/tlpkg/installer/lang/perltk-zh-cn b/Master/tlpkg/installer/lang/perltk-zh-cn index 82e31cb29a9..3568de8289f 100644 --- a/Master/tlpkg/installer/lang/perltk-zh-cn +++ b/Master/tlpkg/installer/lang/perltk-zh-cn @@ -8,7 +8,7 @@ text.basicinfo: 基本信息 text.custom: 进一步定制 text.dirsetup: 目录设置 text.options: 选项 -text.sysint: 系统集成 +text.desktop_integration: 系统集成 text.change: 改变 text.toggle: 切换 text.install: 安装 TeX Live diff --git a/Master/tlpkg/installer/lang/perltk-zh-tw b/Master/tlpkg/installer/lang/perltk-zh-tw index ce6a1ce5415..7c1d89339a2 100644 --- a/Master/tlpkg/installer/lang/perltk-zh-tw +++ b/Master/tlpkg/installer/lang/perltk-zh-tw @@ -8,7 +8,7 @@ text.basicinfo: 基本資訊 text.custom: 進一步定制 text.dirsetup: 目錄設置 text.options: 選項 -text.sysint: 系統集成 +text.desktop_integration: 系統集成 text.change: 改變 text.toggle: 切換 text.install: 安裝 TeX Live diff --git a/Master/tlpkg/installer/lzma/lzma.alpha-linux b/Master/tlpkg/installer/lzma/lzma.alpha-linux deleted file mode 100755 index 57a33f4ff8d..00000000000 Binary files a/Master/tlpkg/installer/lzma/lzma.alpha-linux and /dev/null differ diff --git a/Master/tlpkg/installer/lzma/lzma.amd64-freebsd b/Master/tlpkg/installer/lzma/lzma.amd64-freebsd deleted file mode 100755 index bc8d0e33166..00000000000 Binary files a/Master/tlpkg/installer/lzma/lzma.amd64-freebsd and /dev/null differ diff --git a/Master/tlpkg/installer/lzma/lzma.exe b/Master/tlpkg/installer/lzma/lzma.exe deleted file mode 100644 index f3f81891bfb..00000000000 Binary files a/Master/tlpkg/installer/lzma/lzma.exe and /dev/null differ diff --git a/Master/tlpkg/installer/lzma/lzma.hppa-hpux b/Master/tlpkg/installer/lzma/lzma.hppa-hpux deleted file mode 100755 index 5b11c340f39..00000000000 Binary files a/Master/tlpkg/installer/lzma/lzma.hppa-hpux and /dev/null differ diff --git a/Master/tlpkg/installer/lzma/lzma.i386-freebsd b/Master/tlpkg/installer/lzma/lzma.i386-freebsd deleted file mode 100755 index 2757e59f4b9..00000000000 Binary files a/Master/tlpkg/installer/lzma/lzma.i386-freebsd and /dev/null differ diff --git a/Master/tlpkg/installer/lzma/lzma.i386-linux b/Master/tlpkg/installer/lzma/lzma.i386-linux deleted file mode 100755 index 8cf5efbf978..00000000000 Binary files a/Master/tlpkg/installer/lzma/lzma.i386-linux and /dev/null differ diff --git a/Master/tlpkg/installer/lzma/lzma.i386-openbsd b/Master/tlpkg/installer/lzma/lzma.i386-openbsd deleted file mode 100755 index d8361493ab5..00000000000 Binary files a/Master/tlpkg/installer/lzma/lzma.i386-openbsd and /dev/null differ diff --git a/Master/tlpkg/installer/lzma/lzma.i386-solaris b/Master/tlpkg/installer/lzma/lzma.i386-solaris deleted file mode 100755 index b80c86c30fb..00000000000 Binary files a/Master/tlpkg/installer/lzma/lzma.i386-solaris and /dev/null differ diff --git a/Master/tlpkg/installer/lzma/lzma.mips-irix b/Master/tlpkg/installer/lzma/lzma.mips-irix deleted file mode 100755 index d07fee95753..00000000000 Binary files a/Master/tlpkg/installer/lzma/lzma.mips-irix and /dev/null differ diff --git a/Master/tlpkg/installer/lzma/lzma.powerpc-aix b/Master/tlpkg/installer/lzma/lzma.powerpc-aix deleted file mode 100755 index 47e90df49c3..00000000000 Binary files a/Master/tlpkg/installer/lzma/lzma.powerpc-aix and /dev/null differ diff --git a/Master/tlpkg/installer/lzma/lzma.powerpc-linux b/Master/tlpkg/installer/lzma/lzma.powerpc-linux deleted file mode 100755 index 626764f9111..00000000000 Binary files a/Master/tlpkg/installer/lzma/lzma.powerpc-linux and /dev/null differ diff --git a/Master/tlpkg/installer/lzma/lzma.sparc-linux b/Master/tlpkg/installer/lzma/lzma.sparc-linux deleted file mode 100755 index 4d24c9f4c66..00000000000 Binary files a/Master/tlpkg/installer/lzma/lzma.sparc-linux and /dev/null differ diff --git a/Master/tlpkg/installer/lzma/lzma.sparc-solaris b/Master/tlpkg/installer/lzma/lzma.sparc-solaris deleted file mode 100755 index 78318ee771a..00000000000 Binary files a/Master/tlpkg/installer/lzma/lzma.sparc-solaris and /dev/null differ diff --git a/Master/tlpkg/installer/lzma/lzma.universal-darwin b/Master/tlpkg/installer/lzma/lzma.universal-darwin deleted file mode 100755 index 961d374d944..00000000000 Binary files a/Master/tlpkg/installer/lzma/lzma.universal-darwin and /dev/null differ diff --git a/Master/tlpkg/installer/lzma/lzma.x86_64-linux b/Master/tlpkg/installer/lzma/lzma.x86_64-linux deleted file mode 100755 index 7efec830a52..00000000000 Binary files a/Master/tlpkg/installer/lzma/lzma.x86_64-linux and /dev/null differ diff --git a/Master/tlpkg/installer/lzma/lzmadec.alpha-linux b/Master/tlpkg/installer/lzma/lzmadec.alpha-linux deleted file mode 100755 index 7d79085fa35..00000000000 Binary files a/Master/tlpkg/installer/lzma/lzmadec.alpha-linux and /dev/null differ diff --git a/Master/tlpkg/installer/lzma/lzmadec.amd64-freebsd b/Master/tlpkg/installer/lzma/lzmadec.amd64-freebsd deleted file mode 100755 index 732abc31f01..00000000000 Binary files a/Master/tlpkg/installer/lzma/lzmadec.amd64-freebsd and /dev/null differ diff --git a/Master/tlpkg/installer/lzma/lzmadec.hppa-hpux b/Master/tlpkg/installer/lzma/lzmadec.hppa-hpux deleted file mode 100755 index f36af86f445..00000000000 Binary files a/Master/tlpkg/installer/lzma/lzmadec.hppa-hpux and /dev/null differ diff --git a/Master/tlpkg/installer/lzma/lzmadec.i386-freebsd b/Master/tlpkg/installer/lzma/lzmadec.i386-freebsd deleted file mode 100755 index 31557983e54..00000000000 Binary files a/Master/tlpkg/installer/lzma/lzmadec.i386-freebsd and /dev/null differ diff --git a/Master/tlpkg/installer/lzma/lzmadec.i386-linux b/Master/tlpkg/installer/lzma/lzmadec.i386-linux deleted file mode 100755 index 236c96924f9..00000000000 Binary files a/Master/tlpkg/installer/lzma/lzmadec.i386-linux and /dev/null differ diff --git a/Master/tlpkg/installer/lzma/lzmadec.i386-openbsd b/Master/tlpkg/installer/lzma/lzmadec.i386-openbsd deleted file mode 100755 index 8feb3679853..00000000000 Binary files a/Master/tlpkg/installer/lzma/lzmadec.i386-openbsd and /dev/null differ diff --git a/Master/tlpkg/installer/lzma/lzmadec.i386-solaris b/Master/tlpkg/installer/lzma/lzmadec.i386-solaris deleted file mode 100755 index 42eac5e4554..00000000000 Binary files a/Master/tlpkg/installer/lzma/lzmadec.i386-solaris and /dev/null differ diff --git a/Master/tlpkg/installer/lzma/lzmadec.mips-irix b/Master/tlpkg/installer/lzma/lzmadec.mips-irix deleted file mode 100755 index 7493774f81f..00000000000 Binary files a/Master/tlpkg/installer/lzma/lzmadec.mips-irix and /dev/null differ diff --git a/Master/tlpkg/installer/lzma/lzmadec.powerpc-aix b/Master/tlpkg/installer/lzma/lzmadec.powerpc-aix deleted file mode 100755 index 7204970d7f9..00000000000 Binary files a/Master/tlpkg/installer/lzma/lzmadec.powerpc-aix and /dev/null differ diff --git a/Master/tlpkg/installer/lzma/lzmadec.powerpc-linux b/Master/tlpkg/installer/lzma/lzmadec.powerpc-linux deleted file mode 100755 index 6e822ffb943..00000000000 Binary files a/Master/tlpkg/installer/lzma/lzmadec.powerpc-linux and /dev/null differ diff --git a/Master/tlpkg/installer/lzma/lzmadec.sparc-linux b/Master/tlpkg/installer/lzma/lzmadec.sparc-linux deleted file mode 100755 index 2d9658009f3..00000000000 Binary files a/Master/tlpkg/installer/lzma/lzmadec.sparc-linux and /dev/null differ diff --git a/Master/tlpkg/installer/lzma/lzmadec.sparc-solaris b/Master/tlpkg/installer/lzma/lzmadec.sparc-solaris deleted file mode 100755 index c276f77052d..00000000000 Binary files a/Master/tlpkg/installer/lzma/lzmadec.sparc-solaris and /dev/null differ diff --git a/Master/tlpkg/installer/lzma/lzmadec.universal-darwin b/Master/tlpkg/installer/lzma/lzmadec.universal-darwin deleted file mode 100755 index 897487cb4e0..00000000000 Binary files a/Master/tlpkg/installer/lzma/lzmadec.universal-darwin and /dev/null differ diff --git a/Master/tlpkg/installer/lzma/lzmadec.win32.exe b/Master/tlpkg/installer/lzma/lzmadec.win32.exe deleted file mode 100755 index f91c8eb26b5..00000000000 Binary files a/Master/tlpkg/installer/lzma/lzmadec.win32.exe and /dev/null differ diff --git a/Master/tlpkg/installer/lzma/lzmadec.x86_64-linux b/Master/tlpkg/installer/lzma/lzmadec.x86_64-linux deleted file mode 100755 index 884723f350c..00000000000 Binary files a/Master/tlpkg/installer/lzma/lzmadec.x86_64-linux and /dev/null differ diff --git a/Master/tlpkg/installer/xz/xz.exe b/Master/tlpkg/installer/xz/xz.exe new file mode 100755 index 00000000000..c4cb32e94e7 Binary files /dev/null and b/Master/tlpkg/installer/xz/xz.exe differ diff --git a/Master/tlpkg/installer/xz/xz.i386-cygwin.exe b/Master/tlpkg/installer/xz/xz.i386-cygwin.exe new file mode 100755 index 00000000000..09d47d21d52 Binary files /dev/null and b/Master/tlpkg/installer/xz/xz.i386-cygwin.exe differ diff --git a/Master/tlpkg/installer/xz/xz.i386-linux b/Master/tlpkg/installer/xz/xz.i386-linux new file mode 100755 index 00000000000..58029b1bb2e Binary files /dev/null and b/Master/tlpkg/installer/xz/xz.i386-linux differ diff --git a/Master/tlpkg/installer/xz/xz.universal-darwin b/Master/tlpkg/installer/xz/xz.universal-darwin new file mode 100755 index 00000000000..82ed1b4cb96 Binary files /dev/null and b/Master/tlpkg/installer/xz/xz.universal-darwin differ diff --git a/Master/tlpkg/installer/xz/xz.x86_64-linux b/Master/tlpkg/installer/xz/xz.x86_64-linux new file mode 100755 index 00000000000..6ca200803ff Binary files /dev/null and b/Master/tlpkg/installer/xz/xz.x86_64-linux differ diff --git a/Master/tlpkg/installer/xz/xzdec.exe b/Master/tlpkg/installer/xz/xzdec.exe new file mode 100755 index 00000000000..5023b5b9780 Binary files /dev/null and b/Master/tlpkg/installer/xz/xzdec.exe differ diff --git a/Master/tlpkg/installer/xz/xzdec.i386-cygwin.exe b/Master/tlpkg/installer/xz/xzdec.i386-cygwin.exe new file mode 100755 index 00000000000..590d93cc0f2 Binary files /dev/null and b/Master/tlpkg/installer/xz/xzdec.i386-cygwin.exe differ diff --git a/Master/tlpkg/installer/xz/xzdec.i386-linux b/Master/tlpkg/installer/xz/xzdec.i386-linux new file mode 100755 index 00000000000..52f1f5bd0f5 Binary files /dev/null and b/Master/tlpkg/installer/xz/xzdec.i386-linux differ diff --git a/Master/tlpkg/installer/xz/xzdec.universal-darwin b/Master/tlpkg/installer/xz/xzdec.universal-darwin new file mode 100755 index 00000000000..c1795bd7bcf Binary files /dev/null and b/Master/tlpkg/installer/xz/xzdec.universal-darwin differ diff --git a/Master/tlpkg/installer/xz/xzdec.x86_64-linux b/Master/tlpkg/installer/xz/xzdec.x86_64-linux new file mode 100755 index 00000000000..2f0138d8acf Binary files /dev/null and b/Master/tlpkg/installer/xz/xzdec.x86_64-linux differ diff --git a/Master/tlpkg/tlpsrc/00texlive-installation.config.tlpsrc b/Master/tlpkg/tlpsrc/00texlive-installation.config.tlpsrc deleted file mode 100644 index f7d5e0d7844..00000000000 --- a/Master/tlpkg/tlpsrc/00texlive-installation.config.tlpsrc +++ /dev/null @@ -1,30 +0,0 @@ -name 00texlive-installation.config -category TLCore -longdesc This package serves two purposes: -longdesc -longdesc 1. at installation time the present values are taken as default for -longdesc the installer -longdesc -longdesc 2. on an installed system it serves as a configuration file. -longdesc We have to remember these settings for additional package -longdesc installation, removal, etc. -longdesc -longdesc The value of __MASTER__ for the location field tells the -longdesc installer to use the present directory itself. For example, -longdesc the DVD can be mounted anywhere and we want the installer to work. -longdesc -longdesc Concerning the 00* names: -longdesc All packages starting with 00texlive are considered virtual packages -longdesc in the sense that no containers are generated and these packages -longdesc are never split into .src and .doc sub-packages in the tlpdb. - -depend platform: -depend location:__MASTER__ -depend opt_paper:a4 -depend opt_create_formats:1 -depend opt_create_symlinks:0 -depend opt_sys_bin:/usr/local/bin -depend opt_sys_info:/usr/local/info -depend opt_sys_man:/usr/local/man -depend opt_install_docfiles:1 -depend opt_install_srcfiles:1 diff --git a/Master/tlpkg/tlpsrc/00texlive.config.tlpsrc b/Master/tlpkg/tlpsrc/00texlive.config.tlpsrc index 20a37ed8c33..b32c0ade986 100644 --- a/Master/tlpkg/tlpsrc/00texlive.config.tlpsrc +++ b/Master/tlpkg/tlpsrc/00texlive.config.tlpsrc @@ -2,15 +2,15 @@ name 00texlive.config category TLCore longdesc This package contains configuration options for the TeX Live archive longdesc If container_split_{doc,src}_files occurs in the depend lines the -longdesc {doc,src} files are split into separate containers (.tar.lzma) +longdesc {doc,src} files are split into separate containers (.tar.xz) longdesc during container build time. Note that this has NO effect on the longdesc appearance within the texlive.tlpdb. It is only on container level. longdesc The container_format/XXXXX specifies the format, currently allowed -longdesc is only "lzma", which generates .tar.lzma files. zip can be supported. +longdesc is only "xz", which generates .tar.xz files. zip can be supported. longdesc release/NNNN specifies the release number as used in the installer. longdesc For information on the 00texlive prefix see -longdesc 00texlive-installation.config(.tlpsrc) +longdesc 00texlive.installation(.tlpsrc) depend container_split_src_files depend container_split_doc_files -depend container_format/lzma -depend release/2008 +depend container_format/xz +depend release/2009 diff --git a/Master/tlpkg/tlpsrc/00texlive.core.tlpsrc b/Master/tlpkg/tlpsrc/00texlive.core.tlpsrc index 2226629fbae..ce76a27207f 100644 --- a/Master/tlpkg/tlpsrc/00texlive.core.tlpsrc +++ b/Master/tlpkg/tlpsrc/00texlive.core.tlpsrc @@ -6,7 +6,7 @@ longdesc check happy. The files here are not copied by the installer longdesc and containers are not built; they exist only in the longdesc full DVD image. longdesc For information on the 00texlive prefix see -longdesc 00texlive-installation.config(.tlpsrc) +longdesc 00texlive.installation(.tlpsrc) runpattern d tlpkg/archive runpattern d tlpkg/doc runpattern d tlpkg/libexec diff --git a/Master/tlpkg/tlpsrc/00texlive.installation.tlpsrc b/Master/tlpkg/tlpsrc/00texlive.installation.tlpsrc new file mode 100644 index 00000000000..1a779a38da7 --- /dev/null +++ b/Master/tlpkg/tlpsrc/00texlive.installation.tlpsrc @@ -0,0 +1,34 @@ +name 00texlive.installation +category TLCore +longdesc This package serves two purposes: +longdesc +longdesc 1. at installation time the present values are taken as default for +longdesc the installer +longdesc +longdesc 2. on an installed system it serves as a configuration file. +longdesc We have to remember these settings for additional package +longdesc installation, removal, etc. +longdesc +longdesc The value of __MASTER__ for the location field tells the +longdesc installer to use the present directory itself. For example, +longdesc the DVD can be mounted anywhere and we want the installer to work. +longdesc +longdesc Concerning the 00* names: +longdesc All packages starting with 00texlive are considered virtual packages +longdesc in the sense that no containers are generated and these packages +longdesc are never split into .src and .doc sub-packages in the tlpdb. + +depend platform: +depend location:__MASTER__ +depend opt_paper:a4 +depend opt_create_formats:1 +depend opt_desktop_integration:0 +depend opt_file_assocs:0 +depend opt_post_code:1 +depend opt_w32_multi_user:1 +depend opt_path:0 +depend opt_sys_bin:/usr/local/bin +depend opt_sys_info:/usr/local/info +depend opt_sys_man:/usr/local/man +depend opt_install_docfiles:1 +depend opt_install_srcfiles:1 diff --git a/Master/tlpkg/tlpsrc/00texlive.installer.tlpsrc b/Master/tlpkg/tlpsrc/00texlive.installer.tlpsrc index db0a4f61bd9..d64b3c4bec4 100644 --- a/Master/tlpkg/tlpsrc/00texlive.installer.tlpsrc +++ b/Master/tlpkg/tlpsrc/00texlive.installer.tlpsrc @@ -7,7 +7,7 @@ longdesc are not allowed, but in this case, 00texlive.installer is never longdesc used *except* to build the installer archives, so it's ok. longdesc longdesc For information on the 00texlive prefix see -longdesc 00texlive-installation.config(.tlpsrc) +longdesc 00texlive.installation(.tlpsrc) category TLCore runpattern f install-tl runpattern f tlpkg/installer/install-tl.html @@ -16,8 +16,8 @@ runpattern f tlpkg/installer/config.guess #runpattern d tlpkg/TeXLive runpattern d tlpkg/installer # -# but no lzma binaries -runpattern !d tlpkg/installer/lzma +# but no xz binaries +runpattern !d tlpkg/installer/xz runpattern !d tlpkg/installer/wget # # and no perl lib @@ -28,15 +28,15 @@ runpattern !f tlpkg/installer/*.exe runpattern !f tlpkg/installer/*.dll # # binpatterns -binpattern d/win32 tlpkg/installer/perllib -binpattern f/win32 tlpkg/installer/*.exe -binpattern f/win32 tlpkg/installer/*.dll +binpattern d/win32 tlpkg/tlperl +binpattern f/win32 tlpkg/installer/tar.exe binpattern f/win32 install-tl.bat # shouldn't be in the installer packages # binpattern f/win32 tl-portable.bat binpattern f/win32 install-tl.bat.manifest -binpattern f/!win32 tlpkg/installer/lzma/lzmadec.${ARCH} +binpattern f/i386-cygwin tlpkg/installer/xz/xzdec.i386-cygwin.exe +binpattern f/!win32,i386-cygwin tlpkg/installer/xz/xzdec.${ARCH} binpattern f/!win32,i386-solaris,i386-linux,mips-irix,sparc-linux,alpha-linux,powerpc-linux,i386-freebsd,x86_64-linux tlpkg/installer/wget/wget.${ARCH} binpattern f/win32 tlpkg/installer/wget/wget.exe # why the above does not catch that one I don't know ... so add it -binpattern f/win32 tlpkg/installer/lzma/lzmadec.win32.exe +binpattern f/win32 tlpkg/installer/xz/xzdec.exe -- cgit v1.2.3