summaryrefslogtreecommitdiff
path: root/henrietta-cache.scm
diff options
context:
space:
mode:
Diffstat (limited to 'henrietta-cache.scm')
-rw-r--r--henrietta-cache.scm11
1 files changed, 8 insertions, 3 deletions
diff --git a/henrietta-cache.scm b/henrietta-cache.scm
index 58d7f90..e5311b2 100644
--- a/henrietta-cache.scm
+++ b/henrietta-cache.scm
@@ -143,9 +143,14 @@ EOF
;; Some people extract to the current directory, some include the
;; directory
(let* ((contents (directory tmp-dir))
- (contents-dir (if (= 1 (length contents))
- (make-pathname tmp-dir (car contents))
- tmp-dir))
+ (contents-dir (match contents
+ ;; Silly pax archives contain this bogus entry.
+ ;; Some pax-aware tar(1)s skip it, others don't.
+ ((or (dir "pax_global_header")
+ ("pax_global_header" dir)
+ (dir))
+ (make-pathname tmp-dir dir))
+ (else tmp-dir)))
(cmd (sprintf "mv ~A/* ~A" (qs contents-dir) (qs cache-dir)))
(status (system cmd)))
(unless (zero? status)