diff options
Diffstat (limited to 'Master/tlpkg/TeXLive/TLMedia.pm')
-rw-r--r-- | Master/tlpkg/TeXLive/TLMedia.pm | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/Master/tlpkg/TeXLive/TLMedia.pm b/Master/tlpkg/TeXLive/TLMedia.pm index 218987dbcb3..7102bbf2766 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 { @@ -96,7 +95,7 @@ sub install_package { if (!defined($tlpobj)) { if (defined($fallbackmedia)) { if ($ret = $fallbackmedia->install_package($pkg,$totlpdb, $nopostinstall)) { - debug("installed $pkg from fallback"); + debug("installed $pkg from fallback\n"); return $ret; } else { tlwarn("$0: Cannot find package $pkg (in fallback, either)\n"); @@ -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); } } |