diff options
author | Karl Berry <karl@freefriends.org> | 2008-11-30 00:02:35 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2008-11-30 00:02:35 +0000 |
commit | 29b8325a76c6f02a202f3d9aeb7ed9bbed84747b (patch) | |
tree | fda45098d112367d6f539a38ee9e00993df5268b | |
parent | d4865fd31153bc70cd2bc085707eb20ef294188a (diff) |
(install_files): rework logic for unzipping the
unpacked installer.
git-svn-id: svn://tug.org/texlive/trunk@11471 c570f23f-e606-0410-a88d-b1316a301751
-rwxr-xr-x | Master/tlpkg/bin/tl-update-install-pkg | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/Master/tlpkg/bin/tl-update-install-pkg b/Master/tlpkg/bin/tl-update-install-pkg index d699c6d380b..40c02b5bc22 100755 --- a/Master/tlpkg/bin/tl-update-install-pkg +++ b/Master/tlpkg/bin/tl-update-install-pkg @@ -209,15 +209,30 @@ sub install_files # create unpacked installer that can run in that directory, # for the sake of people mirroring. # We'd like to specify exactly what we want to unpack, - # but unzip doesn't allow for unpacking a directory, + # but unzip doesn't support recursively unpacking a directory, # and it's too painful to specify all the (many dozens of) files. - # So remove the unnecessary doc files after unpacking everything. + # So unpack directly in the real dir. Scary. xchdir ($outputdir); - xsystem ("unzip -q -o install-tl.zip"); - xsystem ("mv install-tl junkdir"); - xsystem ("mv junkdir/install-tl* ."); - xsystem ("mv junkdir/tlpkg/* tlpkg/"); - xsystem ("rm -rf junkdir"); + + # save what we've got now. + my $savedir = "/tmp/tluip.$$.save"; + xsystem ("rm -rf $savedir"); + mkdir ($savedir); + xsystem ("mv install-tl install-tl.bat* tlpkg/TeXLive tlpkg/installer $savedir/"); + + # unpack in a temp directory. + my $junkdir = "/tmp/tluip.$$.temp"; + xsystem ("rm -rf $junkdir"); + mkdir ($junkdir); + xsystem ("cd $junkdir && unzip -q $outputdir/install-tl.zip"); + + # move what we want (corresponds to the mv into savedir) and erase the rest. + xsystem ("mv $junkdir/install-tl* ."); + xsystem ("mv $junkdir/tlpkg/* tlpkg/"); + xsystem ("rm -rf $junkdir"); + + # if we made this far, we don't need to preserve the previous version. + xsystem ("rm -rf $savedir"); } @@ -240,7 +255,8 @@ sub xsystem my $retval = system (@args); if ($retval != 0) { $retval /= 256; - die "system(@args) failed, status $retval"; + chomp (my $pwd = `pwd`); + die "system(@args) failed in $pwd, status $retval"; } } |