texlive[47896] Master/tlpkg/TeXLive/TLPOBJ.pm: fix rollback container
commits+preining at tug.org
commits+preining at tug.org
Fri Jun 1 02:20:05 CEST 2018
Revision: 47896
http://tug.org/svn/texlive?view=revision&revision=47896
Author: preining
Date: 2018-06-01 02:20:05 +0200 (Fri, 01 Jun 2018)
Log Message:
-----------
fix rollback container if no backup is made
Modified Paths:
--------------
trunk/Master/tlpkg/TeXLive/TLPOBJ.pm
Modified: trunk/Master/tlpkg/TeXLive/TLPOBJ.pm
===================================================================
--- trunk/Master/tlpkg/TeXLive/TLPOBJ.pm 2018-06-01 00:19:02 UTC (rev 47895)
+++ trunk/Master/tlpkg/TeXLive/TLPOBJ.pm 2018-06-01 00:20:05 UTC (rev 47896)
@@ -561,8 +561,9 @@
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 @@
$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 @@
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.
More information about the tex-live-commits
mailing list