summaryrefslogtreecommitdiff
path: root/Master/texmf
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2009-01-19 17:28:49 +0000
committerNorbert Preining <preining@logic.at>2009-01-19 17:28:49 +0000
commit5fa9b92e3aceb82b4b0730c725d86424f0e1af78 (patch)
tree92b23576b76a5162d640d576f4a8e32de28c038a /Master/texmf
parentd4f51a125407d5711cbdd86302ea9d168a0b2a03 (diff)
more updates to tlmgr2 auto-self-update by Tomek
git-svn-id: svn://tug.org/texlive/trunk@11916 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf')
-rwxr-xr-xMaster/texmf/scripts/texlive/tlmgr2.pl35
1 files changed, 25 insertions, 10 deletions
diff --git a/Master/texmf/scripts/texlive/tlmgr2.pl b/Master/texmf/scripts/texlive/tlmgr2.pl
index a7f15673ec3..8bb82837756 100755
--- a/Master/texmf/scripts/texlive/tlmgr2.pl
+++ b/Master/texmf/scripts/texlive/tlmgr2.pl
@@ -1117,7 +1117,7 @@ $::updater_started = 0;
#
sub grow_w32_updater {
- my ($tlp, $dry) = @_;
+ my ($tlp, $dry, $oldrev, $newrev) = @_;
my $pkg = $tlp->name;
# that could be more intelligent for decent $dry output
my $root = $localtlpdb->root;
@@ -1126,23 +1126,38 @@ sub grow_w32_updater {
if (!$::updater_started) {
$::updater_started = 1;
$::updater_string = <<'EOF';
-rem update program, can savely removed after it has been done
+@echo off
+rem Update script for TeX-Live infrastructure
+rem called automatically after creation by tlmgr.bat wrapper
+rem left only for inspection, can be safely removed
+setlocal
cd /d %~dp0
rem now we are in .../tlpkg/installer
rem create tar.exe backup
-copy tar.exe tarsave.exe
+>nul copy tar.exe tarsave.exe
cd ..\..
rem now we are in the root
+rem get location of the log file
+for /f "delims=" %%D in ('kpsewhich -var-value=TEXMFSYSVAR') do set "web2c=%%~fD\web2c\"
+rem set up perl environment
+set PERL5LIB=%cd%\tlpkg\tlperl\lib
+
+echo Performing an update of TeX-Live infrastructure
+echo In case of a disaster download and run:
+echo http://mirror.ctan.org/systems/texlive/tlnet/2008/update-tlmgr-latest.exe
+echo Do not close this window
EOF
;
}
sub do_one {# moved down to 'preserve' the flow of the batch script upon reading
- my $pkg = shift;
+ my ($pkg, $oldrev, $newrev) = @_;
$::updater_string .= "
tlpkg\\installer\\lzma\\lzmadec.win32.exe < temp\\$pkg.tar.lzma > temp\\$pkg.tar
tlpkg\\installer\\tarsave.exe -x -f temp\\$pkg.tar
-call tlmgr _include_tlpobj tlpkg\\tlpobj\\$pkg.tlpobj
+tlpkg\\tlperl\\bin\\perl.exe texmf\\scripts\\texlive\\tlmgr2.pl _include_tlpobj tlpkg\\tlpobj\\$pkg.tlpobj
+echo update: $pkg ($oldrev -^> $newrev)
+>>%web2c%tlmgr.log echo [%date% %time%] update: $pkg ($oldrev -^> $newrev)
del temp\\$pkg.tar.lzma temp\\$pkg.tar
";
}
@@ -1187,14 +1202,14 @@ del temp\\$pkg.tar.lzma temp\\$pkg.tar
tlwarn ("Couldn't get $pkg.tar.lzma, that is bad\n");
} else {
# add lines to the un-archiver
- do_one ($pkg);
+ do_one ($pkg, $oldrev, $newrev);
}
if ($do_src) {
if (! -r "$temp/$pkg.src.tar.lzma") {
tlwarn ("Couldn't get $pkg.src.tar.lzma, that is bad\n");
} else {
# add lines to the un-archiver
- do_one ("$pkg.src");
+ do_one ("$pkg.src", $oldrev, $newrev);
}
}
if ($do_doc) {
@@ -1202,7 +1217,7 @@ del temp\\$pkg.tar.lzma temp\\$pkg.tar
tlwarn ("Couldn't get $pkg.doc.tar.lzma, that is bad\n");
} else {
# add lines to the un-archiver
- do_one ("$pkg.doc");
+ do_one ("$pkg.doc", $oldrev, $newrev);
}
}
}
@@ -1213,7 +1228,7 @@ sub write_w32_updater {
$::updater_string .= <<'EOF';
del tlpkg\installer\tarsave.exe
-rmdir temp
+rem rmdir temp
EOF
;
open UPDATER, ">" . $localtlpdb->root . "/tlpkg/installer/updater.bat"
@@ -1636,7 +1651,7 @@ sub action_update {
}
if (win32() && ($pkg =~ m/$WinSpecialUpdatePackagesRegexp/)) {
- grow_w32_updater($mediatlp, $opts{"dry-run"});
+ grow_w32_updater($mediatlp, $opts{"dry-run"}, $rev, $mediarev);
} else {
if ($::machinereadable) {
machine_line($pkg, $FLAG_UPDATE, $rev, $mediarev, $sizes{$pkg});