summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Bex <peter@more-magic.net>2019-09-12 08:11:02 +0200
committerPeter Bex <peter@more-magic.net>2019-09-12 08:11:02 +0200
commit2045c4156b58d5df6a98346e7ee3c2fd42f8d330 (patch)
tree6fc83f2146c15233494b4f471f72b1a587b0a4f1
parent804bf2cda41eb1200229f144ff03eb32bd179ddf (diff)
downloadhenrietta-cache-2045c4156b58d5df6a98346e7ee3c2fd42f8d330.tar.gz
Fix sloppy code dealing with tmpdir parent deletion
Somehow this now causes an exception to be raised when the temp dir was the contents dir, because move-to-cache already removes that directory.
-rw-r--r--henrietta-cache.scm3
1 files changed, 2 insertions, 1 deletions
diff --git a/henrietta-cache.scm b/henrietta-cache.scm
index 9daa883..15921af 100644
--- a/henrietta-cache.scm
+++ b/henrietta-cache.scm
@@ -169,7 +169,8 @@ EOF
(make-pathname tmp-dir dir))
(else tmp-dir))))
(move-to-cache contents-dir cache-dir)
- (delete-directory tmp-dir #t) ; sloppy; don't know which dir selected
+ (unless (eq? contents-dir tmp-dir)
+ (delete-directory tmp-dir #t)) ; remove parent if needed
(delete-file tmp-file) ))))
(define (download-release distribution-file-type uri cache-dir)