From b8fef688da7eb09d63db3f658e95de1dbbeefbee Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Fri, 1 Jun 2018 00:20:05 +0000 Subject: fix rollback container if no backup is made git-svn-id: svn://tug.org/texlive/trunk@47896 c570f23f-e606-0410-a88d-b1316a301751 --- Master/tlpkg/TeXLive/TLPOBJ.pm | 44 ++++++++++++++++++++++++------------------ 1 file changed, 25 insertions(+), 19 deletions(-) (limited to 'Master/tlpkg') diff --git a/Master/tlpkg/TeXLive/TLPOBJ.pm b/Master/tlpkg/TeXLive/TLPOBJ.pm index 24dd2aa781e..72a72b95feb 100644 --- a/Master/tlpkg/TeXLive/TLPOBJ.pm +++ b/Master/tlpkg/TeXLive/TLPOBJ.pm @@ -561,8 +561,9 @@ sub common_texmf_tree { sub make_container { my ($self,$type,$instroot,$destdir,$containername,$relative) = @_; - if (!TeXLive::TLUtils::member($type, @{$::progs{'working_compressors'}})) { - tlwarn "$0: TLPOBJ supports @{$::progs{'working_compressors'}} containers, not $type\n"; + if (!($type eq 'tar' || + TeXLive::TLUtils::member($type, @{$::progs{'working_compressors'}}))) { + tlwarn "$0: TLPOBJ supports @{$::progs{'working_compressors'}} and tar containers, not $type\n"; tlwarn "$0: falling back to $DefaultCompressorFormat as container type!\n"; $type = $DefaultCompressorFormat; } @@ -636,17 +637,8 @@ sub make_container { $tar = "tar"; } - my $compressor = $::progs{$CompressorProgram{$type}}; - my @compressorargs = @{$CompressorArgs{$type}}; - my $compressorextension = $CompressorExtension{$type}; - $containername = "$tarname.$compressorextension"; - debug("selected compressor: $compressor with @compressorargs\n"); - if (!defined($compressor)) { - # fall back to $type as compressor, but that shouldn't happen - tlwarn("$0: programs not set up, trying \"$type\".\n"); - $compressor = $type; - } - + $containername = $tarname; + # Here we need to distinguish between making the master containers for # tlnet (where we can assume GNU tar) and making backups on a user's # machine (where we can assume nothing). We determine this by whether @@ -724,12 +716,26 @@ sub make_container { unlink("$destdir/$containername"); xsystem(@cmdline); - # compress it. - if (-r "$destdir/$tarname") { - system($compressor, @compressorargs, "$destdir/$tarname"); - } else { - tlwarn("$0: Couldn't find $destdir/$tarname to run $compressor\n"); - return (0, 0, ""); + if ($type ne 'tar') { + # compress it + my $compressor = $::progs{$CompressorProgram{$type}}; + my @compressorargs = @{$CompressorArgs{$type}}; + my $compressorextension = $CompressorExtension{$type}; + $containername = "$tarname.$compressorextension"; + debug("selected compressor: $compressor with @compressorargs\n"); + if (!defined($compressor)) { + # fall back to $type as compressor, but that shouldn't happen + tlwarn("$0: programs not set up, trying \"$type\".\n"); + $compressor = $type; + } + + # compress it. + if (-r "$destdir/$tarname") { + system($compressor, @compressorargs, "$destdir/$tarname"); + } else { + tlwarn("$0: Couldn't find $destdir/$tarname to run $compressor\n"); + return (0, 0, ""); + } } # compute the size. -- cgit v1.2.3