From d85421b6e6d49e1ba6916c57fd8b53fef089d667 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Mon, 21 Sep 2009 11:26:59 +0000 Subject: update and extended the usermode patch git-svn-id: svn://tug.org/texlive/trunk@15396 c570f23f-e606-0410-a88d-b1316a301751 --- Master/tlpkg/dev/dev.usermode-tlmgr.README | 7 +- Master/tlpkg/dev/dev.usermode-tlmgr.patch | 170 +++++++++++++++++------------ 2 files changed, 108 insertions(+), 69 deletions(-) (limited to 'Master/tlpkg/dev') diff --git a/Master/tlpkg/dev/dev.usermode-tlmgr.README b/Master/tlpkg/dev/dev.usermode-tlmgr.README index e79fce55af1..9f1ae445d77 100644 --- a/Master/tlpkg/dev/dev.usermode-tlmgr.README +++ b/Master/tlpkg/dev/dev.usermode-tlmgr.README @@ -29,7 +29,6 @@ Using the TeX Live Manager in Usermode - update, install, remove, paper done - postinstall action call -sys variant if !$opts{"usermode"} - most other actions exit 1 with warning if in usermode -- backup and restore should be checked --------------------------------------------------------------- @@ -131,6 +130,12 @@ install: on single package, what to do with collections and other dependencies? Maybe the user has to install all packages by hand? + Currently installing a collection installs all depending packages, + but in contrast to normal mode does not install depending collections. + So in *normal* mode tlmgr install collection-context would install + collection-metapost, c-basic, c-documentation-base, too. In *usermode* + only the packages mentioned in collection-context are installed. + backup, restore, remove, update: in usermode the tlmgr action update will check that all packages to be updated are installed in the user tree, otherwise it behaves diff --git a/Master/tlpkg/dev/dev.usermode-tlmgr.patch b/Master/tlpkg/dev/dev.usermode-tlmgr.patch index bfe0c81c8ee..ba3a85122dd 100644 --- a/Master/tlpkg/dev/dev.usermode-tlmgr.patch +++ b/Master/tlpkg/dev/dev.usermode-tlmgr.patch @@ -1,8 +1,8 @@ Index: tlpkg/TeXLive/TLConfig.pm =================================================================== ---- tlpkg/TeXLive/TLConfig.pm (revision 14577) +--- tlpkg/TeXLive/TLConfig.pm (revision 15374) +++ tlpkg/TeXLive/TLConfig.pm (working copy) -@@ -183,7 +183,8 @@ +@@ -169,7 +169,8 @@ our %TLPDBSettings = ( "platform" => [ "s", "Main platform for this computer" ], @@ -14,9 +14,9 @@ Index: tlpkg/TeXLive/TLConfig.pm our $WindowsMainMenuName = "TeX Live $ReleaseYear"; Index: tlpkg/TeXLive/TLPOBJ.pm =================================================================== ---- tlpkg/TeXLive/TLPOBJ.pm (revision 14577) +--- tlpkg/TeXLive/TLPOBJ.pm (revision 15374) +++ tlpkg/TeXLive/TLPOBJ.pm (working copy) -@@ -459,6 +459,21 @@ +@@ -458,6 +458,21 @@ sub cancel_reloc_prefix { my $self = shift; my @docfiles = $self->docfiles; @@ -40,7 +40,7 @@ Index: tlpkg/TeXLive/TLPOBJ.pm my @runfiles = $self->runfiles; Index: tlpkg/TeXLive/TLMedia.pm =================================================================== ---- tlpkg/TeXLive/TLMedia.pm (revision 14577) +--- tlpkg/TeXLive/TLMedia.pm (revision 15374) +++ tlpkg/TeXLive/TLMedia.pm (working copy) @@ -60,6 +60,8 @@ } @@ -87,7 +87,7 @@ Index: tlpkg/TeXLive/TLMedia.pm if (!defined($tlp)) { tlwarn ("$pkg: package not present, cannot remove\n"); } else { -@@ -425,9 +436,12 @@ +@@ -426,9 +437,12 @@ # in user mode we just remove the prefix, in normal mode we # replace it with texmf-dist # since we don't have user mode @@ -103,9 +103,9 @@ Index: tlpkg/TeXLive/TLMedia.pm # Index: tlpkg/TeXLive/TLUtils.pm =================================================================== ---- tlpkg/TeXLive/TLUtils.pm (revision 14577) +--- tlpkg/TeXLive/TLUtils.pm (revision 15374) +++ tlpkg/TeXLive/TLUtils.pm (working copy) -@@ -1198,7 +1198,7 @@ +@@ -1237,7 +1237,7 @@ # if a package is relocatable we have to cancel the reloc prefix # before we save it to the local tlpdb if ($tlpobj->relocated) { @@ -116,9 +116,9 @@ Index: tlpkg/TeXLive/TLUtils.pm # we have to write out the tlpobj file since it is contained in the Index: texmf/scripts/texlive/tlmgr.pl =================================================================== ---- texmf/scripts/texlive/tlmgr.pl (revision 14581) +--- texmf/scripts/texlive/tlmgr.pl (revision 15374) +++ texmf/scripts/texlive/tlmgr.pl (working copy) -@@ -122,6 +122,8 @@ +@@ -123,6 +123,8 @@ "machine-readable" => 1, "package-logfiles" => "=s", "pause" => 1, @@ -127,7 +127,7 @@ Index: texmf/scripts/texlive/tlmgr.pl "version" => 1, "help|h|?" => 1); -@@ -285,13 +287,30 @@ +@@ -296,13 +298,30 @@ pod2usage(-msg => $msg, -exitstatus => 1, -verbose => 1, @noperldoc); } @@ -159,7 +159,7 @@ Index: texmf/scripts/texlive/tlmgr.pl # # Try to open the packagelog file, but do NOT die when that does not work if (!open(PACKAGELOG, ">>$packagelogfile")) { -@@ -427,6 +446,9 @@ +@@ -438,6 +457,9 @@ } elsif ($action =~ m/^show$/i) { action_show(); finish(0); @@ -169,16 +169,16 @@ Index: texmf/scripts/texlive/tlmgr.pl } elsif ($action =~ m/^remove$/i) { action_remove(); } elsif ($action =~ /^paper$/) { -@@ -480,6 +502,8 @@ - # - sub handle_execute_actions { +@@ -499,6 +521,8 @@ + { + my $errors = 0; + my $sysmode = ($opts{"usermode"} ? "" : "-sys"); + - my $errors = 0; - if ($::files_changed) { -@@ -512,14 +536,14 @@ + $errors += do_cmd_and_check("mktexlsr"); + $::files_changed = 0; +@@ -529,14 +553,14 @@ } } for my $m (keys %do_disable) { @@ -196,25 +196,23 @@ Index: texmf/scripts/texlive/tlmgr.pl } -@@ -561,7 +585,7 @@ - if ($opt_fmt && !$::regenerate_all_formats) { +@@ -581,13 +605,13 @@ + # first regenerate all formats --byengine + for my $e (keys %updated_engines) { + log ("updating formats based on $e\n"); +- $errors += do_cmd_and_check("fmtutil-sys --byengine $e"); ++ $errors += do_cmd_and_check("fmtutil$sysmode --byengine $e"); + } + # now rebuild all other formats for my $f (keys %do_enable) { + next if defined($updated_engines{$format_to_engine{$f}}); log ("(re)creating format dump $f\n"); - $errors += do_cmd_and_check("fmtutil-sys --byfmt $f"); + $errors += do_cmd_and_check("fmtutil$sysmode --byfmt $f"); $done_formats{$f} = 1; } - -@@ -576,7 +600,7 @@ - for my $e (@upen) { - if ($def{'engine'} eq $e) { - log ("updating format $def{'name'} (engine $e updated)\n"); -- $errors += do_cmd_and_check("fmtutil-sys --byfmt $def{'name'}"); -+ $errors += do_cmd_and_check("fmtutil$sysmode --byfmt $def{'name'}"); - $done_formats{$def{'name'}} = 1; - } - } -@@ -618,7 +642,7 @@ + } +@@ -625,7 +649,7 @@ $lang = "$TEXMFSYSVAR/tex/generic/config/$lang"; } if ($localtlpdb->option("create_formats") && !$::regenerate_all_formats) { @@ -223,7 +221,7 @@ Index: texmf/scripts/texlive/tlmgr.pl } } } -@@ -627,7 +651,7 @@ +@@ -634,7 +658,7 @@ # if ($::regenerate_all_formats) { info("Regenerating all formats, this may take some time ..."); @@ -232,7 +230,7 @@ Index: texmf/scripts/texlive/tlmgr.pl info("done\n"); $::regenerate_all_formats = 0; } -@@ -799,8 +823,13 @@ +@@ -807,8 +831,13 @@ action_gui("config") if $opts{"gui"}; init_local_db(); @@ -248,7 +246,7 @@ Index: texmf/scripts/texlive/tlmgr.pl my $action = shift @ARGV; if ($action =~ m/^paper$/i) { # generic paper -@@ -812,14 +841,14 @@ +@@ -820,7 +849,7 @@ "as in: tlmgr pdftex paper --list\n"); } elsif (!defined($newpaper)) { # tlmgr paper => show all current sizes. @@ -257,47 +255,48 @@ Index: texmf/scripts/texlive/tlmgr.pl } elsif ($newpaper !~ /^(a4|letter)$/) { # tlmgr paper junk => complain. $newpaper = "the empty string" if !defined($newpaper); - tlwarn("tlmgr: expected `a4' or `letter' after paper, not $newpaper\n"); +@@ -828,7 +857,7 @@ } else { # tlmgr paper {a4|letter} => do it. + return if !check_on_writable(); - TeXLive::TLPaper::paper_all($texmfsysconfig,$newpaper); + TeXLive::TLPaper::paper_all($texmfconfig,$newpaper); } } else { # program-specific paper -@@ -833,7 +862,7 @@ - # the do_paper progs check for the argument --list, so if given - # restore it to the cmd line. - unshift(@ARGV, "--list") if $opts{"list"}; +@@ -845,7 +874,7 @@ + if (@ARGV) { + return if !check_on_writable(); + } - TeXLive::TLPaper::do_paper($prog,$texmfsysconfig,@ARGV); + TeXLive::TLPaper::do_paper($prog,$texmfconfig,@ARGV); } } -@@ -874,13 +903,14 @@ +@@ -886,13 +915,14 @@ # include arbitrary package in the list of collections, but # only collectons: @colls = grep {m;^collection-;} @colls; -- print "Package: ", $tlp->name, "\n"; -- print "Category: ", $tlp->category, "\n"; -- print "ShortDesc: ", $tlp->shortdesc, "\n" if ($tlp->shortdesc); -- print "LongDesc: ", $tlp->longdesc, "\n" if ($tlp->longdesc); -- print "Installed: ", ($installed ? "Yes" : "No"), "\n"; -- print "Revision: ", $tlp->revision, "\n" if ($installed); -- print "Collection: ", @colls, "\n" if (@colls); -+ print "Package: ", $tlp->name, "\n"; -+ print "Category: ", $tlp->category, "\n"; -+ print "ShortDesc: ", $tlp->shortdesc, "\n" if ($tlp->shortdesc); -+ print "LongDesc: ", $tlp->longdesc, "\n" if ($tlp->longdesc); -+ print "Installed: ", ($installed ? "Yes" : "No"), "\n"; -+ print "Revision: ", $tlp->revision, "\n" if ($installed); -+ print "Relocatable: ", ($tlp->relocated ? "Yes" : "No"), "\n"; -+ print "Collection: ", @colls, "\n" if (@colls); +- print "package: ", $tlp->name, "\n"; +- print "category: ", $tlp->category, "\n"; +- print "shortdesc: ", $tlp->shortdesc, "\n" if ($tlp->shortdesc); +- print "longdesc: ", $tlp->longdesc, "\n" if ($tlp->longdesc); +- print "installed: ", ($installed ? "Yes" : "No"), "\n"; +- print "revision: ", $tlp->revision, "\n" if ($installed); +- print "collection: ", @colls, "\n" if (@colls); ++ print "package: ", $tlp->name, "\n"; ++ print "category: ", $tlp->category, "\n"; ++ print "shortdesc: ", $tlp->shortdesc, "\n" if ($tlp->shortdesc); ++ print "longdesc: ", $tlp->longdesc, "\n" if ($tlp->longdesc); ++ print "installed: ", ($installed ? "Yes" : "No"), "\n"; ++ print "revision: ", $tlp->revision, "\n" if ($installed); ++ print "relocatable: ", ($tlp->relocated ? "Yes" : "No"), "\n"; ++ print "collection: ", @colls, "\n" if (@colls); if ($opts{"list"}) { if ($tlp->category eq "Collection" || $tlp->category eq "Scheme") { # in the case of collections of schemes we list the deps -@@ -944,6 +974,10 @@ - # SYMLINKS +@@ -956,6 +986,10 @@ + # PATH # sub action_path { + if ($opts{"usermode"}) { @@ -307,7 +306,7 @@ Index: texmf/scripts/texlive/tlmgr.pl my $what = shift @ARGV; if (!defined($what) || ($what !~ m/^(add|remove)$/i)) { tlwarn("action path needs one argument, either add or remove\n"); -@@ -1424,7 +1458,10 @@ +@@ -1664,7 +1698,10 @@ # check for updates to tlmgr and die unless either --force or --list or --self # is given @@ -319,7 +318,7 @@ Index: texmf/scripts/texlive/tlmgr.pl my $dry_run_cont = $opts{"dry-run"} && ($opts{"dry-run"} < 0); if ( !$dry_run_cont && !$opts{"self"} && @critical) { critical_updates_warning(); -@@ -2060,16 +2097,18 @@ +@@ -2412,16 +2449,18 @@ init_tlmedia(); # check for updates to tlmgr itself, and die unless --force is given @@ -347,10 +346,19 @@ Index: texmf/scripts/texlive/tlmgr.pl } } } -@@ -2106,6 +2145,15 @@ - } - } - foreach my $pkg (@inst_packs, @inst_colls, @inst_schemes) { +@@ -2434,7 +2473,7 @@ + @packs = $tlmediatlpdb->expand_dependencies("-only-arch", $localtlpdb, @ARGV) unless $opts{"no-depends-at-all"}; + # now expand all others unless $opts{"no-depends"} + # if $opts{"reinstall"} do not collection->collection dependencies +- if ($opts{"reinstall"}) { ++ if ($opts{"reinstall"} || $opts{"usermode"}) { + @packs = $tlmediatlpdb->expand_dependencies("-no-collections", $localtlpdb, @packs) unless $opts{"no-depends"}; + } else { + @packs = $tlmediatlpdb->expand_dependencies($localtlpdb, @packs) unless $opts{"no-depends"}; +@@ -2502,6 +2541,15 @@ + foreach my $pkg (@todo) { + my $flag = $FLAG_INSTALL; + my $re = ""; + my $tlp = $tlmediasrc->tlpdb->get_package($pkg); + if (!defined($tlp)) { + info("Unknown package $pkg\n"); @@ -360,10 +368,24 @@ Index: texmf/scripts/texlive/tlmgr.pl + info("Package $pkg is not relocatable, cannot install it in user mode!\n"); + next; + } - my $re = ""; if (defined($localtlpdb->get_package($pkg))) { if ($opts{"reinstall"}) { -@@ -2321,6 +2369,10 @@ + $re = "re"; +@@ -2730,11 +2778,11 @@ + # now also save the TLPOBJ of 00texlive.installation + my $tlpo = $localtlpdb->get_package("00texlive.installation"); + if ($tlpo) { +- if (open(TOFD, ">$Master/tlpkg/tlpobj/00texlive.installation.tlpobj")) { ++ if (open(TOFD, ">$::maintree/tlpkg/tlpobj/00texlive.installation.tlpobj")) { + $tlpo->writeout(\*TOFD); + close(TOFD); + } else { +- tlwarn("Cannot save 00texlive.installation to $Master/tlpkg/tlpobj/00texlive.installation.tlpobj\n"); ++ tlwarn("Cannot save 00texlive.installation to $::maintree/tlpkg/tlpobj/00texlive.installation.tlpobj\n"); + } + } + } else { +@@ -2766,6 +2814,10 @@ if ($^O=~/^MSWin(32|64)$/i) { warn("action `arch' not supported on Windows\n"); } @@ -374,7 +396,7 @@ Index: texmf/scripts/texlive/tlmgr.pl if ($opts{"gui"}) { action_gui("arch"); } -@@ -2402,6 +2454,10 @@ +@@ -2899,6 +2951,10 @@ # GENERATE # sub action_generate { @@ -385,7 +407,7 @@ Index: texmf/scripts/texlive/tlmgr.pl my $dest = defined($opts{"dest"}) ? $opts{"dest"} : ""; my $localconf = defined($opts{"localcfg"}) ? $opts{"localcfg"} : ""; my $what = shift @ARGV; -@@ -3209,6 +3265,34 @@ +@@ -3708,6 +3764,38 @@ # @@ -413,6 +435,10 @@ Index: texmf/scripts/texlive/tlmgr.pl + $inst->depends(@deps); + $tlpdb->add_tlpobj($inst); + $tlpdb->save; ++ # ++ # we need to create web2c dir for TLMedia to succeed setting up ++ # and for tlmgr.log file ++ mkdir ("$usertree/web2c"); +} + + @@ -420,7 +446,7 @@ Index: texmf/scripts/texlive/tlmgr.pl # action conf # tries to mimick texconfig conf but probably will add some more things # -@@ -3272,10 +3356,10 @@ +@@ -3771,10 +3859,10 @@ # stuff changed via the GUI return if defined $localtlmedia; return if defined $localtlpdb; @@ -434,3 +460,11 @@ Index: texmf/scripts/texlive/tlmgr.pl # 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", $localtlmedia->platform)) { +@@ -4082,6 +4170,7 @@ + } + + sub check_on_writable { ++ return 1 if $opts{"usermode"}; + if (!TeXLive::TLUtils::dir_writable("$Master/tlpkg")) { + tlwarn("You don't have permission to change the installation in any way,\n"); + tlwarn("specifically, the directory $Master/tlpkg/ is not writable.\n"); -- cgit v1.2.3