summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Master/tlpkg/TeXLive/TLPOBJ.pm10
1 files changed, 7 insertions, 3 deletions
diff --git a/Master/tlpkg/TeXLive/TLPOBJ.pm b/Master/tlpkg/TeXLive/TLPOBJ.pm
index 5a84b3697d0..55ead17b769 100644
--- a/Master/tlpkg/TeXLive/TLPOBJ.pm
+++ b/Master/tlpkg/TeXLive/TLPOBJ.pm
@@ -736,9 +736,13 @@ sub make_container {
tlwarn("$0: Couldn't compress $destdir/$tarname\n");
return (0,0, "");
}
- # make sure we remove the original tar since lc does not
- # automatically remove it
- unlink("$destdir/$tarname") if (-r "$destdir/$tarname");
+ # make sure we remove the original tar since old lz4 versions
+ # cannot automatically delete it.
+ # We remove the tar file only when the compressed file was
+ # correctly created, something that should only happen in the
+ # most strange cases.
+ unlink("$destdir/$tarname")
+ if ((-r "$destdir/$tarname") && (-r "$destdir/$containername"));
} else {
tlwarn("$0: Couldn't find $destdir/$tarname to run $compressor\n");
return (0, 0, "");