diff options
Diffstat (limited to 'Master/tlpkg/TeXLive')
-rw-r--r-- | Master/tlpkg/TeXLive/TLMedia.pm | 3 | ||||
-rw-r--r-- | Master/tlpkg/TeXLive/TLPostActions.pm | 12 | ||||
-rw-r--r-- | Master/tlpkg/TeXLive/TLUtils.pm | 54 |
3 files changed, 42 insertions, 27 deletions
diff --git a/Master/tlpkg/TeXLive/TLMedia.pm b/Master/tlpkg/TeXLive/TLMedia.pm index 78234641097..82030e0881e 100644 --- a/Master/tlpkg/TeXLive/TLMedia.pm +++ b/Master/tlpkg/TeXLive/TLMedia.pm @@ -10,7 +10,8 @@ package TeXLive::TLMedia; use TeXLive::TLConfig; use TeXLive::TLPostActions; -use TeXLive::TLUtils qw(copy win32 dirname mkdirhier conv_to_win_path basename download_file merge_into debug ddebug info tlwarn); +use TeXLive::TLUtils qw(copy win32 dirname mkdirhier basename download_file + merge_into debug ddebug info tlwarn); use TeXLive::TLPDB; use Cwd qw/abs_path/; diff --git a/Master/tlpkg/TeXLive/TLPostActions.pm b/Master/tlpkg/TeXLive/TLPostActions.pm index a0c54aca93a..e91a468f457 100644 --- a/Master/tlpkg/TeXLive/TLPostActions.pm +++ b/Master/tlpkg/TeXLive/TLPostActions.pm @@ -17,7 +17,7 @@ BEGIN { @EXPORT = @EXPORT_OK; } -use TeXLive::TLUtils qw(win32 mkdirhier copy conv_to_win_path log debug info); +use TeXLive::TLUtils qw(win32 mkdirhier copy conv_to_w32_path log debug info); use TeXLive::TLWinGoo; my $mainmenu = "TeX Live 2008"; @@ -85,14 +85,14 @@ sub do_install_xetex { push @cpycmd, "cp", "-R"; } system(@cpycmd, - (win32() ? conv_to_win_path("$texdir/bin/win32/conf") : + (win32() ? conv_to_w32_path("$texdir/bin/win32/conf") : "$texdir/bin/win32/conf"), - (win32() ? conv_to_win_path("$texmfsysvar/fonts/conf") : + (win32() ? conv_to_w32_path("$texmfsysvar/fonts/conf") : "$texmfsysvar/fonts/conf")); system(@cpycmd, - (win32() ? conv_to_win_path("$texdir/bin/win32/cache") : + (win32() ? conv_to_w32_path("$texdir/bin/win32/cache") : "$texdir/bin/win32/cache"), - (win32() ? conv_to_win_path("$texmfsysvar/fonts/cache") : + (win32() ? conv_to_w32_path("$texmfsysvar/fonts/cache") : "$texmfsysvar/fonts/cache")); if (open(FONTSCONF, "<$texdir/bin/win32/conf/fonts.conf")) { my @lines = <FONTSCONF>; @@ -135,7 +135,7 @@ $PostInstall{"xetex"} = \&do_install_xetex; sub do_install_bin_dviout_win32 { my ($texdir, $texdirw) = @_; if (win32()) { - my $texdir_bsl = conv_to_win_path($texdir); + my $texdir_bsl = conv_to_w32_path($texdir); add_menu_shortcut( $mainmenu, 'DVIOUT Dvi Viewer', diff --git a/Master/tlpkg/TeXLive/TLUtils.pm b/Master/tlpkg/TeXLive/TLUtils.pm index e5f4def0774..c557afd9d16 100644 --- a/Master/tlpkg/TeXLive/TLUtils.pm +++ b/Master/tlpkg/TeXLive/TLUtils.pm @@ -62,7 +62,7 @@ C<TeXLive::TLUtils> -- utilities used in the TeX Live infrastructure TeXLive::TLUtils::member($item, @list); TeXLive::TLUtils::merge_into(\%to, \%from); TeXLive::TLUtils::texdir_check($texdir); - TeXLive::TLUtils::conv_to_win_path($path); + TeXLive::TLUtils::conv_to_w32_path($path); TeXLive::TLUtils::give_ctan_mirror($path); TeXLive::TLUtils::tlmd5($path); @@ -104,7 +104,7 @@ BEGIN { &texdir_check &member "ewords - &conv_to_win_path + &conv_to_w32_path &setup_programs &download_file &merge_into @@ -1012,14 +1012,15 @@ sub install_package { =item C<setup_programs( $bindir, $platform )> -Populate the global $::progs hash containing the paths to the programs -C<wget>, C<tar>, C<lzmadec>. The C<$bindir> argument specifies the path -to the location of the C<lzmadec> binaries, the C<$platform> gives the -TeX Live platform name, used as the extension on the executables. +Populate the global C<$::progs> hash containing the paths to the +programs C<wget>, C<tar>, C<lzmadec>. The C<$bindir> argument specifies +the path to the location of the C<lzmadec> binaries, the C<$platform> +gives the TeX Live platform name, used as the extension on the +executables. Returns -1 if the architecture is not supported (i.e., there is no -lzmadec binary for that arch present), 0 for programs don't work, -and 1 for success. +C<lzmadec> binary for that arch present), 0 for programs don't work, and +1 for success. =cut @@ -1039,16 +1040,23 @@ sub setup_programs { $::progs{'tar'} = "tar"; if ($^O =~ /^MSWin(32|64)$/i) { - $::progs{'wget'} = conv_to_win_path("$bindir/wget/wget.exe"); - $::progs{'tar'} = conv_to_win_path("$bindir/tar.exe"); - $::progs{'lzmadec'} = conv_to_win_path("$bindir/lzma/lzmadec.win32.exe"); - $::progs{'lzma'} = conv_to_win_path("$bindir/lzma/lzma.exe"); + $::progs{'wget'} = conv_to_w32_path("$bindir/wget/wget.exe"); + $::progs{'tar'} = conv_to_w32_path("$bindir/tar.exe"); + $::progs{'lzmadec'} = conv_to_w32_path("$bindir/lzma/lzmadec.win32.exe"); + $::progs{'lzma'} = conv_to_w32_path("$bindir/lzma/lzma.exe"); } elsif (-r "$bindir/wget/wget.$platform") { $::progs{'wget'} = "$bindir/wget/wget.$platform"; } - return(-1) if (! -r $::progs{'lzmadec'}); - # + + # check for existence of lzmadec; this determines whether the present + # pltform is supported. Because of conv_to_w32_path possibly adding + # quotes, strip them away for the file test. Since all other uses of + # conv_to_w32_path use the result in shell commands, this is the most + # expedient thing to do. + (my $lzmadec = $::progs{'lzmadec'}) =~ s/^"(.*)"/$1/; + return(-1) if (! -r $lzmadec); + # check that the programs are actually working my $nul = "/dev/null"; $nul = "nul" if ($^O =~ /^MSWin(32|64)$/i); @@ -1634,17 +1642,23 @@ EOF =pod -This function returns a "windowsified" path, i.e., replacing all forward -slashes to backslashes, and adding additional " around (in case of spaces -in $path). Furthermore it makes the path absolute. So if $path does not -start with an arbitrary char followed by : we add the output of `cd`. +This function returns a "windowsified" version of its single argument +I<path>, i.e., replaces all forward slashes with backslashes, and adds +an additional C<"> at the beginning and end if I<path> contains any +spaces. It also makes the path absolute. So if $path does not start +with one (arbitrary) characer followed by C<:>, we add the output of +C<`cd`>. + +The result is suitable for running in shell commands, but not file tests +or other manipulations, since in such internal Perl contexts, the quotes +would be considered part of the filename. =cut -sub conv_to_win_path { +sub conv_to_w32_path { my $p = shift; $p =~ s!/!\\!g; - # we need absolute pathes, too + # we need absolute paths, too if ($p !~ m!^.:!) { my $cwd = `cd`; die "sorry, could not find current working directory via cd?!" if ! $cwd; |