summaryrefslogtreecommitdiff
path: root/Master/texmf
diff options
context:
space:
mode:
authorPiotr Strzelczyk <piotr@eps.gda.pl>2009-08-03 15:04:46 +0000
committerPiotr Strzelczyk <piotr@eps.gda.pl>2009-08-03 15:04:46 +0000
commit330853d14e08ad9d787d7b0ad1d2b4907e6ace5a (patch)
tree0981c6cca25aca1182c2c3f0d43721501f1e1128 /Master/texmf
parent660ccf0ff17bb81dd62bcb21838d12ba95778c46 (diff)
fixes for tlmgr restart in GUI mode and double backslashes in paths
git-svn-id: svn://tug.org/texlive/trunk@14520 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf')
-rw-r--r--Master/texmf/scripts/texlive/updater-w3237
1 files changed, 20 insertions, 17 deletions
diff --git a/Master/texmf/scripts/texlive/updater-w32 b/Master/texmf/scripts/texlive/updater-w32
index 59f6788bf3e..f2a831f6726 100644
--- a/Master/texmf/scripts/texlive/updater-w32
+++ b/Master/texmf/scripts/texlive/updater-w32
@@ -77,7 +77,11 @@ if not defined w32upd_args (
exit /b 1
)
set dbg=rem
-if /i %w32upd_debug%0 GTR 0 set dbg=echo D:updater-w32:
+if /i %w32upd_debug%0 GTR 0 (
+ set dbg=echo D:updater-w32:
+ echo D:updater-w32: updater data:
+ set w32upd_
+)
if "%~1"=="main" goto :main
@@ -85,15 +89,19 @@ rem Restart in cmd.exe to avoid problems if 4NT is used
set respawn=cmd.exe /c call
rem For gui mode console window might be hidden, so open a new one
if /i %w32upd_gui_mode%0==10 set respawn=start /wait %respawn%
+set exitcode=0
rem Lock this file write-open during execution to signal running state
call %dbg% respawning in cmd.exe ...
%respawn% "%~f0" main 9^>^>"%~f0"
+if errorlevel 1 goto :sefldel
+if not defined w32upd_rerun_args goto :selfdel
+
+echo Restarting tlmgr to complete update ...
+call %dbg% tlmgr.bat %w32upd_rerun_args%
+call tlmgr.bat %w32upd_rerun_args%
+
+:selfdel
set exitcode=%errorlevel%
-if /i %exitcode%0 NEQ 0 (
- call %dbg% update script left for inspection at: %~f0.txt
- copy /y "%~f0" "%~f0.txt" >nul
- exit /b %exitcode%
-)
rem Self-delete without error message about missing file
start /b cmd.exe /c del "%~f0" & exit /b %exitcode%
@@ -102,11 +110,12 @@ title %w32upd_title%
rem Get TL installation root and log file location
for /f "tokens=1-2 delims=;" %%I in (
- 'kpsewhich -expand-var=$SELFAUTOPARENT/.;$TEXMFSYSVAR/web2c'
+ 'kpsewhich -expand-var=$SELFAUTOLOC/:;$TEXMFSYSVAR/web2c'
) do (
set tlroot=%%~fI
set logdir=%%~fJ
)
+set "tlroot=%tlroot:\bin\win32\:=%"
if not exist "%tlroot%\texmf\scripts\texlive\tlmgr.pl" (
echo updater-w32: cannot locate installation root.>&2
exit /b 1
@@ -142,12 +151,8 @@ if errorlevel 1 goto :rollback
call :foreachpkg incltlpobj "%tlroot%\tlpkg\tlpobj\" %pkgpartslist%
if errorlevel 1 goto :rollback
call :foreachpkg updateinfo "update" %pkglist%
-if not defined w32upd_rerun_args goto :finishmsg
-echo Restarting tlmgr to complete update ...
-call %dbg% tlmgr %w32upd_rerun_args%
-"%tlroot%\tlpkg\tlperl\bin\perl.exe" "%tlroot%\texmf\scripts\texlive\tlmgr.pl" %w32upd_rerun_args%
-set exitcode=%errorlevel%
-goto :finishmsg
+call :printmsg%w32upd_gui_mode% "TeX Live infrastructure update complete." 0 "%w32upd_title%"
+goto :finish
:rollback
call :foreachpkg updateinfo "failed update" %pkglist% >&2
@@ -167,10 +172,8 @@ call :printmsg%w32upd_gui_mode% "TeX Live infrastructure update failed and backu
rem Evil has taken over - emit adequate exit code
exit /b 666
-:finishmsg
-call :printmsg%w32upd_gui_mode% "TeX Live infrastructure update complete." 0 "%w32upd_title%"
:finish
-del "%tlroot%\temp\tar-w32.exe" "%tlroot%\temp\__BACKUP_*" >nul 2>&1
+del "%tlroot%\temp\tar-w32.exe" "%tlroot%\temp\__BACKUP_*" 1>nul 2>nul
exit /b %exitcode%
REM SUBROUTINES
@@ -194,7 +197,7 @@ exit /b 0
:untar %tlroot%\temp\[__BACKUP_] pkgname
set "suffix=tar"
if %~n1_==__BACKUP__ set "suffix=r%~3.tar"
-call %dbg% untar: "%~1%~2.%suffix%"
+call %dbg% untar: "%tlroot%\temp\tar-w32.exe" -C "%tlroot%" -f "%~1%~2.%suffix%" -x
"%tlroot%\temp\tar-w32.exe" -C "%tlroot%" -f "%~1%~2.%suffix%" -x && del "%~1%~2.%suffix%"
exit /b %errorlevel%