diff options
author | Norbert Preining <preining@logic.at> | 2009-01-19 17:28:49 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2009-01-19 17:28:49 +0000 |
commit | 5fa9b92e3aceb82b4b0730c725d86424f0e1af78 (patch) | |
tree | 92b23576b76a5162d640d576f4a8e32de28c038a /Master | |
parent | d4f51a125407d5711cbdd86302ea9d168a0b2a03 (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')
-rwxr-xr-x | Master/bin/win32/tlmgr2.bat | 21 | ||||
-rwxr-xr-x | Master/texmf/scripts/texlive/tlmgr2.pl | 35 |
2 files changed, 34 insertions, 22 deletions
diff --git a/Master/bin/win32/tlmgr2.bat b/Master/bin/win32/tlmgr2.bat index a9906bdb9f9..3227c961498 100755 --- a/Master/bin/win32/tlmgr2.bat +++ b/Master/bin/win32/tlmgr2.bat @@ -1,27 +1,24 @@ @echo off
rem Advanced started for tlmgr2 with auto-update
-rem Copyright 2009 by Tomasz M. Trzeciak <t34www@googlemail.com>
+rem Copyright 2009 by Tomasz M. Trzeciak <t.m.trzeciak@googlemail.com>
rem Public Domain
rem
setlocal
-
-for %%P in ("%~dp0..\..") do set "TLdir=%%~fP"
-set PERL5LIB=%TLdir%\tlpkg\tlperl\lib
-path %TLdir%\tlpkg\installer;%path%
+rem TL installation root
+for %%P in ("%~dp0..\..") do set "tlroot=%%~fP"
rem Start tlmgr
-"%TLdir%\tlpkg\tlperl\bin\perl.exe" "%TLdir%\texmf\scripts\texlive\tlmgr2.pl" %*
+set PERL5LIB=%tlroot%\tlpkg\tlperl\lib
+"%tlroot%\tlpkg\tlperl\bin\perl.exe" "%tlroot%\texmf\scripts\texlive\tlmgr2.pl" %*
-set "updater=%TLdir%\tlpkg\installer\updater.bat"
+rem Check for updater script
+set "updater=%tlroot%\tlpkg\installer\updater.bat"
if not exist "%updater%" exit /b
if exist "%updater%.bat" del "%updater%.bat"
ren "%updater%" updater.bat.bat
-if errorlevel 1 exit /b %errorlevel%
+if errorlevel 1 exit /b 1
rem Run updater script
-echo Performing an update. Do not close this window.
-rem Check for updater script
-rem unset echo off so that we see what is going on with updater.bat
-@echo on
endlocal & call "%updater%.bat" & exit /b
+
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}); |