diff options
Diffstat (limited to 'Master/setuptl/TLPM/constants.pm')
-rw-r--r-- | Master/setuptl/TLPM/constants.pm | 101 |
1 files changed, 101 insertions, 0 deletions
diff --git a/Master/setuptl/TLPM/constants.pm b/Master/setuptl/TLPM/constants.pm new file mode 100644 index 00000000000..532f81ca13e --- /dev/null +++ b/Master/setuptl/TLPM/constants.pm @@ -0,0 +1,101 @@ +# This file belongs to TLPM v2.14, TeX Live Package Manager +# Public Domain, P.Jackowski@gust.org.pl + +# widely used constants + +$true = 1; +$false = 0; + +# general files handling + +$reg_file = qr/([^\/\\]+)\z/o; +$reg_dirsep = qr/[\/\\]/o; # not /(\/|\\)/ +# TLPM was originally windowish and is tested mostly on windows so +unless(defined $tlpm_os){$tlpm_os = 'win32'} # if in distribution, always defined in BEGIN block +if($tlpm_os eq 'win32'){$win32 = $true} + +if($win32) +{ + $chr_dirsep = "\\"; # directory separator + $reg_abs = qr/\A[a-z]:/io; # absolute path + $reg_envvar = qr/\%(\w+)\%/o; # environment variable + $curr_dir = `cd`; # current directory +} +else # assuming the rest of the world +{ + $chr_dirsep = "/"; + $reg_abs = qr/\A$chr_dirsep/io; + $reg_envvar = qr/\$(\w+)/o; + $curr_dir = `pwd`; +} + +&norm_path($curr_dir); +$parent_dir = &rel2abs('..',$curr_dir); + +# tlpm related constants + +$tlpm_prompt = "tlpm>"; + +$tlpm_log = $chr_dirsep . "tlpm.log"; # log file +$tlpm_dbg = $chr_dirsep . "tlpm.debug"; # debug file + +# relative paths to lists and tpms + +$tl_texmf = $chr_dirsep . "texmf"; +$tl_lists = $tl_texmf . $chr_dirsep . "lists"; +@tl_tpms = ($chr_dirsep . "texmf" . $chr_dirsep . "tpm", + $chr_dirsep . "texmf-dist" . $chr_dirsep . "tpm", + $chr_dirsep . "texmf-doc" . $chr_dirsep . "tpm"); + +# paths to source TL directory (relative to mounting point / drive) + +@tl_roots = ('', + $chr_dirsep . "texlive", + $chr_dirsep . "texlive2004"); + +# ZIP archive + +$tl_archive = $chr_dirsep . "archive"; + +# unzipper is always available in ./support directory + +if($win32) +{ + $tl_unzip = sub {return $tl_source . $chr_dirsep . "support" . $chr_dirsep . "unzip.exe"}; + $tl_xcopy = "xcopy"; # wrrrr + $sys_redir = '>nul'; +} +else +{ + $tl_unzip = sub {return "unzip"}; # assuming in system + $tl_xcopy = "cp"; + $sys_redir = '>/dev/null'; +} + +# handling package names heuristic do NOT match TL2003 and older! + +$reg_binary = qr/\Abin-[^.]+(.*)/io; # on TL2004 there is ie. bin-<pkg>.sparc-solaris2.7.zip +$reg_library = qr/\Alib-[^.]+(.*)/io; +$reg_scheme = qr/\Ascheme-/io; +# no longer used +#$reg_win32 = qr/\.win32/io; # also 'win32-static' +#$reg_collec = qr/\Acollection-/io; + +# handling package list files +$reg_require = qr/\A[+-]/o; +$reg_action = qr/\A!/o; +$reg_about = qr/\A\*/o; +$reg_empty = qr/\A\s*\z/o; + +$, = "\n"; +$| = 1; + +# formatting + +$row_length = 80; +$row_skip = 42; +$wrd_skip = 12; +$row_fmt = "%-${row_skip}s"; +$wrd_fmt = "%-${wrd_skip}s"; + +1; |