summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2018-06-01 00:20:05 +0000
committerNorbert Preining <preining@logic.at>2018-06-01 00:20:05 +0000
commitb8fef688da7eb09d63db3f658e95de1dbbeefbee (patch)
tree679b49ddb2f2325b3adf1df83697aa1db2d1310f
parent5ea56c2d50ac9b868d45a30ac30771f863acd055 (diff)
fix rollback container if no backup is made
git-svn-id: svn://tug.org/texlive/trunk@47896 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/tlpkg/TeXLive/TLPOBJ.pm44
1 files changed, 25 insertions, 19 deletions
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.