diff options
author | Karl Berry <karl@freefriends.org> | 2008-11-11 00:14:08 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2008-11-11 00:14:08 +0000 |
commit | 7804ac014c701179c2106c05a8336da1debac0bf (patch) | |
tree | c87d969732d2c9206b8537f1fe62ab07f4561da3 /Master | |
parent | a9c51408c0b144d5b488b82be2ccff9cdab1a98c (diff) |
update mpman.pdf from CTAN (by hand)
git-svn-id: svn://tug.org/texlive/trunk@11250 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r-- | Master/tlpkg/TeXLive/TLMedia.pm | 24 | ||||
-rw-r--r-- | Master/tlpkg/TeXLive/TLUtils.pm | 40 |
2 files changed, 34 insertions, 30 deletions
diff --git a/Master/tlpkg/TeXLive/TLMedia.pm b/Master/tlpkg/TeXLive/TLMedia.pm index 218987dbcb3..0fbf9f49743 100644 --- a/Master/tlpkg/TeXLive/TLMedia.pm +++ b/Master/tlpkg/TeXLive/TLMedia.pm @@ -84,7 +84,6 @@ sub new return $self; } -# # returns a scalar (0) on error # returns a reference to a hash with actions on success sub install_package { @@ -119,7 +118,7 @@ sub install_package { $real_opt_doc = 1; } foreach my $h (@::install_packages_hook) { - &$h("install: $package"); + &$h("install: $pkg"); } my $container; my @installfiles; @@ -234,8 +233,7 @@ sub _install_package { # we assume that $::progs has been set up! my $wget = $::progs{'wget'}; my $lzmadec = $::progs{'lzmadec'}; - my $tar = $::progs{'tar'}; - if (!defined($wget) || !defined($lzmadec) || !defined($tar)) { + if (!defined($wget) || !defined($lzmadec)) { tlwarn("_install_package: programs not set up properly, strange.\n"); return(0); } @@ -293,10 +291,10 @@ sub _install_package { # copy it to temp copy($what, "$target/temp"); } - debug("Un-lzmaing $lzmafile to $tarfile\n"); + debug("un-lzmaing $lzmafile to $tarfile\n"); system("$lzmadec < $lzmafile_quote > $tarfile_quote"); if (! -f $tarfile) { - tlwarn("Unpacking $lzmafile did not succeed, please retry!\n"); + tlwarn("_install_package: Unpacking $lzmafile failed, please retry.\n"); unlink($tarfile, $lzmafile); return(0); } @@ -307,7 +305,7 @@ sub _install_package { if (!download_file($what, $tarfile) || (! -r $tarfile)) { tlwarn("Downloading \n"); tlwarn(" $what\n"); - tlwarn("did not succeed, please retry!\n"); + tlwarn("failed, please retry.\n"); unlink($tarfile); return(0); } @@ -316,17 +314,9 @@ sub _install_package { $remove_tarfile = 0; } } - debug("Unpacking $tarfile\n"); - if (system($tar,"-x","-C",$target,"-f",$tarfile) != 0) { - tlwarn("Untarring $tarfile did not succeed, please retry!\n"); - unlink($tarfile) if $remove_tarfile; - return(0); - } - # we are still here, so success! - unlink($tarfile) if $remove_tarfile; - return(1); + return TeXLive::TLUtils::untar($tarfile, $target, $remove_tarfile); } else { - tlwarn("Don't know how to install $what!\n"); + tlwarn("_install_package: Don't know how to install $what\n"); return(0); } } diff --git a/Master/tlpkg/TeXLive/TLUtils.pm b/Master/tlpkg/TeXLive/TLUtils.pm index 9f1f6b5ed30..db10017f4b0 100644 --- a/Master/tlpkg/TeXLive/TLUtils.pm +++ b/Master/tlpkg/TeXLive/TLUtils.pm @@ -873,10 +873,10 @@ sub install_packages { } $totlpdb->save; } - + =pod -=item C<install_package($what, $size, $filelistref, $target, $platform)> +=item C<install_package($what, $size, $md5, $filelistref, $target, $platform)> This function installs the files given in @$filelistref from C<$what> into C<$target>. @@ -894,10 +894,9 @@ downloaded from the net and piped through C<lzmadec> and C<tar>. If $what ends with C<.tar.lzma> (but does not start with C<http://> or C<ftp://>, but possibly with C<file:/>) it is assumed to be a readable -file on the system and is -piped through C<lzmadec> and C<tar> in the very same way. +file on the system and is likewise piped through C<lzmadec> and C<tar>. -In both of the last cases currently the list C<$@filelistref> currently +In both of these cases currently the list C<$@filelistref> currently is not taken into account (should be fixed!). =cut @@ -910,8 +909,7 @@ sub install_package { # we assume that $::progs has been set up! my $wget = $::progs{'wget'}; my $lzmadec = $::progs{'lzmadec'}; - my $tar = $::progs{'tar'}; - if (!defined($wget) || !defined($lzmadec) || !defined($tar)) { + if (!defined($wget) || !defined($lzmadec)) { die "install_package: programs not set up properly, strange"; } if (ref $what) { @@ -936,7 +934,6 @@ sub install_package { my $tarfile = "$target/temp/$fn"; $tarfile =~ s/\.lzma$//; my $lzmafile_quote = $lzmafile; my $tarfile_quote = $tarfile; - my $target_quote = $target; if (win32()) { $lzmafile =~ s!/!\\!g; $tarfile =~ s!/!\\!g; @@ -944,7 +941,6 @@ sub install_package { } $lzmafile_quote = "\"$lzmafile\""; $tarfile_quote = "\"$tarfile\""; - $target_quote = "\"$target\""; my $gotfiledone = 0; if (-r $lzmafile) { # check that the downloaded file is not partial @@ -1012,16 +1008,34 @@ sub install_package { if (! -f $tarfile) { die "Unpacking $lzmafile did not succeed, please retry"; } - debug("unpacking $tarfile\n"); - system($tar,"-x","-C",$target,"-f",$tarfile); - unlink($tarfile); + TeXLive::TLUtils::untar($tarfile, $target, 1); debug("keeping $lzmafile for restarting ...\n"); # unlink($lzmafile); } else { - die "Don't know how to install $what!\n"; + die "install_package: Don't know how to install $what\n"; + } +} + +# 1 if success, 0 if failure. +sub untar { + my ($tarfile, $targetdir, $remove_tarfile) = @_; + my $ret; + + my $tar = $::progs{'tar'}; # assume it's been set up + + debug("unpacking $tarfile in $targetdir\n"); + # cd $targetdir xx + if (system($tar, "xf", $tarfile) != 0) { + tlwarn("untarring $tarfile failed, please retry\n"); + $ret = 0; + } else { + $ret = 1; } + unlink($tarfile) if $remove_tarfile; + return $ret; } + =pod =item C<setup_programs( $bindir, $platform )> |