summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Bex <peter@more-magic.net>2018-09-05 18:05:22 +0200
committerPeter Bex <peter@more-magic.net>2018-09-05 18:05:22 +0200
commit7c8c0ab1c48699b94327ba30e7ef450eb1a44f29 (patch)
treeadeead384336cffe91e4179e9a3bc26fac69840b
parent7dfa6f85e0a11b51eae55dca5dbe6f7af764f130 (diff)
downloadhenrietta-cache-7c8c0ab1c48699b94327ba30e7ef450eb1a44f29.tar.gz
Improve egg/meta-file handling by only allowing "distribution-files" in egg-files and "files" in meta-files
There's some minor code duplication but it's worth the loss of confusion and potential for error.
-rw-r--r--henrietta-cache.scm24
1 files changed, 16 insertions, 8 deletions
diff --git a/henrietta-cache.scm b/henrietta-cache.scm
index 832dcc3..fae2499 100644
--- a/henrietta-cache.scm
+++ b/henrietta-cache.scm
@@ -174,19 +174,27 @@ EOF
((zip) (sprintf "unzip -d ~A -o -qq ~A" (qs dir) (qs archive)))
(else (error (sprintf "Unknown archive type `~S' (shouldn't happen!)"
distribution-file-type)))))))
- ((meta-file egg-file)
+ ;; CHICKEN 5 egg description format: .egg
+ ((egg-file)
(condition-case
(let* ((meta (car (call-with-input-request uri #f read-file)))
- (files (or (alist-ref 'files meta)
- ;; Egg description files for C5 use
- ;; `distribution-files' to specify files to
- ;; cache.
- (alist-ref 'distribution-files meta))))
+ (files (alist-ref 'distribution-files meta)))
(unless files
- (error "No \"files\" entry found in meta or egg file" uri))
+ (error "No \"distribution-files\" entry found in egg file" uri))
(download-files-from-list (uri-reference uri) files cache-dir))
(e (exn http)
- (error (sprintf "Could not download meta or egg file \"~A\" -- ~A\n"
+ (error (sprintf "Could not download meta file \"~A\" -- ~A\n"
+ uri (get-condition-property e 'exn 'message))))))
+ ;; CHICKEN 4 egg meta information format: .meta
+ ((meta-file)
+ (condition-case
+ (let* ((meta (car (call-with-input-request uri #f read-file)))
+ (files (alist-ref 'files meta)))
+ (unless files
+ (error "No \"files\" entry found in meta file" uri))
+ (download-files-from-list (uri-reference uri) files cache-dir))
+ (e (exn http)
+ (error (sprintf "Could not download meta file \"~A\" -- ~A\n"
uri (get-condition-property e 'exn 'message))))))
((files-list)
(condition-case