Hi,

On Mon, 03 Sep 2018 07:14:18 +0200 Mario Domenech Goulart 
<ma...@parenteses.org> wrote:

> On Sun, 02 Sep 2018 13:34:27 +0200 felix.winkelm...@bevuta.com wrote:
>
>>> Attached is a small patch to address http://bugs.call-cc.org/ticket/1511
>>> 
>>> If it looks good, I propose the documentation that you can see in the
>>> second patch (files-doc.diff).
>>> 
>>
>> OK, I applied these patches. The second gave some trouble so I had to
>> apply it by hand and add a few words to the manual entry myself.
>
> Unfortunately, that little patch broke chicken-install.  Now `files' is
> only valid at the toplevel.
>
> Attached are patches to revert the changes.

Here's another attempt.  Attached are two patches:

* 0001-chicken-install-accept-distribution-files-egg-proper.patch
  That's for chicken-core.  It reverts the change to `files' (i.e., the
  previous patch to revert the change that broke things does NOT need to
  be applied) and adds support for `distribution-files'.

* 0001-Support-for-CHICKEN-5-s-egg-description-files.patch
  That's for henrietta-cache for C4, to support `egg-file' and
  `distribution-files'.

The commit messages contain more details.

All the best.
Mario
-- 
http://parenteses.org/mario
>From ab5af88b87db2629f986ea97e0908d7a8456feb5 Mon Sep 17 00:00:00 2001
From: Mario Domenech Goulart <ma...@parenteses.org>
Date: Wed, 5 Sep 2018 09:46:37 +0200
Subject: [PATCH] chicken-install: accept `distribution-files' egg property

Make chicken-install accept `distribution-files' in the toplevel of
egg description files.  chicken-install will actually not do anything
with `distribution-files' -- it will be handled by henrietta-cache.

Also revert d72c0b240a, which introduced a bug (`files' could only be
used at the toplevel).
---
 chicken-install.scm             | 3 ++-
 manual/Egg specification format | 4 ++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/chicken-install.scm b/chicken-install.scm
index ae292111..c01a1556 100644
--- a/chicken-install.scm
+++ b/chicken-install.scm
@@ -177,7 +177,8 @@
     (platform #t #f #f)
     (installed-files #t #f #f ,list?)
     (maintainer #t #f #f)
-    (files #t #f #f ,list?)
+    (files #f #f #f ,list?)
+    (distribution-files #t #f #f ,list?) ;; handled by henrietta-cache
     (source #f #f #f)
     (csc-options #f #f #f)
     (link-options #f #f #f)
diff --git a/manual/Egg specification format b/manual/Egg specification format
index ea288ba3..d00344cd 100644
--- a/manual/Egg specification format	
+++ b/manual/Egg specification format	
@@ -106,9 +106,9 @@ If the expression can not be satisfied, then installation of this
 egg will abort.
 les
 
-===== files
+===== distribution-files
 
- [egg property] (files FILE ...)
+ [egg property] (distribution-files FILE ...)
 
 List of files required for the installation of the egg.  This
 form is not handled by chicken-install, but by henrietta-cache to
-- 
2.11.0

>From 043f6108ae0fa33a587eddc6d8a5f919798f6f85 Mon Sep 17 00:00:00 2001
From: Mario Domenech Goulart <ma...@parenteses.org>
Date: Wed, 5 Sep 2018 09:55:59 +0200
Subject: [PATCH] Support for CHICKEN 5's egg description files

Support both `meta-file' and `egg-file' as URI types, and both `files'
and `distribution-files' forms in egg description files (.meta for C4
and .egg for C5).

Note that:

* Although `distribution-files' is intended to be used by C5's
  chicken-install, it can also be used in the toplevel of .meta files,
  as chicken-install for C4 is very permissive.  `files', however,
  cannot be used in the toplevel of .egg files.

* (uri meta-file ...) can point to a .egg file, and (uri egg-file ...)
  can point to a .meta file.  `egg-file' is just and alias to
  `meta-file' for naming consistency in C5.

* henrietta-cache for C4 can be used to cache eggs for C5 (and
  supports `egg-file' and `distribution-files').
---
 henrietta-cache.scm | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/henrietta-cache.scm b/henrietta-cache.scm
index ba99aa2..832dcc3 100644
--- a/henrietta-cache.scm
+++ b/henrietta-cache.scm
@@ -174,15 +174,19 @@ 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)
+    ((meta-file egg-file)
      (condition-case
          (let* ((meta (car (call-with-input-request uri #f read-file)))
-                (files (alist-ref 'files meta)))
+                (files (or (alist-ref 'files meta)
+                           ;; Egg description files for C5 use
+                           ;; `distribution-files' to specify files to
+                           ;; cache.
+                           (alist-ref 'distribution-files meta))))
            (unless files
-             (error "No \"files\" entry found in meta file" uri))
+             (error "No \"files\" entry found in meta or egg 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"
+          (error (sprintf "Could not download meta or egg file \"~A\" -- ~A\n"
                           uri (get-condition-property e 'exn 'message))))))
     ((files-list)
      (condition-case
-- 
2.11.0

_______________________________________________
Chicken-hackers mailing list
Chicken-hackers@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-hackers

Reply via email to