summaryrefslogtreecommitdiff
path: root/Master/bin
diff options
context:
space:
mode:
authorPiotr Strzelczyk <piotr@eps.gda.pl>2009-05-12 21:08:57 +0000
committerPiotr Strzelczyk <piotr@eps.gda.pl>2009-05-12 21:08:57 +0000
commita49e54529a48ac82058bc6aa2ac582cb2fe611c4 (patch)
tree978a139f1b52a3ee61f7a7896c2e2ed9b33362c6 /Master/bin
parente6ce1957162b178d68150f0deb7c696b850cdaeb (diff)
branch merge of bin/win32
git-svn-id: svn://tug.org/texlive/trunk@13062 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/bin')
-rwxr-xr-xMaster/bin/win32/dviout.bat79
-rwxr-xr-xMaster/bin/win32/tlmgr.bat27
2 files changed, 89 insertions, 17 deletions
diff --git a/Master/bin/win32/dviout.bat b/Master/bin/win32/dviout.bat
new file mode 100755
index 00000000000..ac5a76255fc
--- /dev/null
+++ b/Master/bin/win32/dviout.bat
@@ -0,0 +1,79 @@
+@echo off
+rem Wrapper script to configure and call dviout
+rem
+rem Copyright 2009 by Siep Kroonenberg and Tomasz M. Trzeciak
+rem Public Domain
+
+rem Make environment changes local
+rem Disable delayed expansion (makes processing bang ! char easier)
+setlocal enableextensions disabledelayedexpansion
+
+rem Ask kpsewhich for TLROOT and TEXMFVAR
+set tlroot=
+for /f "tokens=1,2 delims=;" %%I in (
+ '"%~dp0kpsewhich.exe" --expand-var "$SELFAUTOPARENT;$TEXMFVAR"'
+) do (
+ set tlroot=%%~sfI
+ set fontsdir=%%~fJ\fonts
+)
+if not defined tlroot goto :no_tl
+if not exist "%fontsdir%\" md "%fontsdir%"
+if not exist "%fontsdir%\" goto :no_fontsdir
+
+rem Ask kpsewhich for TFM search path
+for /f "delims=" %%I in (
+ '"%~dp0kpsewhich.exe" --show-path tfm'
+) do (
+ set tfmpath=%%I
+)
+rem Remove kpse specific syntax from path definition, change slash to backslash
+set tfmpath=%tfmpath:!!=%
+set tfmpath=%tfmpath:/=\%
+rem Split font path var into arguments and rebuild it with only existing 'fonts' dirs
+call :build_tfmpath ";" "%tfmpath:;=" "%"
+
+rem Use TL gostscript
+set GS_LIB=%tlroot%\tlpkg\tlgs\fonts;%tlroot%\tlpkg\tlgs\lib;%tlroot%\tlpkg\tlgs\Resource
+path %tlroot%\tlpkg\tlgs\bin;%path%
+
+rem Assemble dviout command
+set cmdstr="%tlroot%\tlpkg\dviout\dviout.exe" -TEXROOT="%tfmpath%"
+set cmdstr=%cmdstr% -TEXPK="^r\pk\\^s.^dpk;^r\tfm\\^s^tfm;^r\vf\\^s.vf;^r\ovf\\^s.ovf;^r\tfm\\^s.tfm"
+rem Start dviout
+start "" %cmdstr% %*
+goto :eof
+
+rem Soubroutine to build font path only with existing "...\fonts" directories
+rem Directories to process are supplied as arguments
+:build_tfmpath ";" dir list ...
+shift
+rem The first argument (";") serves as a marker to reset the path
+if "%~0"==";" set tfmpath=
+rem Finish if no more arguments to process
+if "%~1"=="" goto :eof
+rem Get short path (dviout has problems with long ones)
+set fontsdir=%~sf1
+rem Substitute "\fonts\tfm" in dir name with a marker
+rem String substitution in expanded vars is case insensitive
+set fontsdir=%fontsdir:\fonts\tfm=\fonts;%
+rem Continue if no substitution
+if "%fontsdir%"=="%~sf1" goto :build_tfmpath
+rem Split dir name on the marker; this leaves us with a "...\fonts" dir
+for /f "delims=;" %%I in ("%fontsdir%") do (set fontsdir=%%~sfI)
+rem Continue if dir does not exist
+if not exist "%fontsdir%\" goto :build_tfmpath
+rem Add dir to path
+if not defined tfmpath (
+ set tfmpath=%fontsdir%
+) else (
+ set tfmpath=%tfmpath%;%fontsdir%
+)
+goto :build_tfmpath
+
+:no_tl
+echo TeX Live not found; aborting...>&2
+exit /b 1
+
+:no_fontsdir
+echo No place to put bitmaps; aborting...>&2
+exit /b 1
diff --git a/Master/bin/win32/tlmgr.bat b/Master/bin/win32/tlmgr.bat
index efb1f4b2c69..8f72641d00b 100755
--- a/Master/bin/win32/tlmgr.bat
+++ b/Master/bin/win32/tlmgr.bat
@@ -1,18 +1,11 @@
@echo off
rem Advanced launcher for tlmgr with auto-update
rem
-rem Copyright 2009 by Tomasz M. Trzeciak <t.m.trzeciak@googlemail.com>
-rem This file is licensed under the GNU General Public License version 2
-rem or any later version.
-rem
-
-rem Check if we are running under NT based system
-rem (works for Vista too, extra check needed to exclude winNT4)
-if not [%OS%]==[Windows_NT] goto err_OS
+rem Copyright 2009 by Tomasz M. Trzeciak
+rem Public Domain
-rem Make environment changes local & enable delayed expansion
-setlocal enabledelayedexpansion
-(set errorlevel=)
+rem Make environment changes local
+setlocal enableextensions
rem Get TL installation root (it should be two levels up)
for %%I in ("%~dp0..\..") do (set tlroot=%%~fI)
@@ -25,17 +18,17 @@ if exist "%tlupdater%*" goto :err_updater_exists
rem Start tlmgr
(set PERL5LIB=%tlroot%\tlpkg\tlperl\lib)
-"%tlroot%\tlpkg\tlperl\bin\perl.exe" "%tlroot%\texmf\scripts\texlive\tlmgr.pl" %*
+path %tlroot%\tlpkg\tlperl\bin;%tlroot%\bin\win32;%path%
+perl "%tlroot%\texmf\scripts\texlive\tlmgr.pl" %*
-rem Exit here if there are no updates to do
-if not exist "%tlupdater%" exit /b %errorlevel%
+rem Finish if there are no updates to do; the last error code will be returned
+if not exist "%tlupdater%" goto :eof
rem Rename updater script before it is run
ren "%tlupdater%" "%tlupdatername%.bat"
if errorlevel 1 goto :err_rename_updater
-rem Run updater explicitly with cmd.exe, in case we are launched from 4NT
-rem Use delayed expansion for errorlevel, 4NT doesn't like: call exit /b %%errorlevel%%
+rem Run updater
echo Starting update ...
-endlocal & call "%tlupdater%.bat" & exit /b !errorlevel!
+endlocal & call "%tlupdater%.bat" & goto :eof
:err_updater_exists
echo %~n0: cannot remove update script, infrastructure update might be in progress>&2