GNU bug report logs -
#77072
[PATCH v1] channels: add transformer field
Previous Next
Full log
View this message in rfc822 format
Hello Jakob,
I also encountered this issue and would like a way to transform
channels. However, I have a few notes.
While looking through the code I noticed latest-channel-instance
has an argument called patches. This argument is already capable of
applying patches. Each patch has a predicate and application function,
First the predicate is ran to know if the patch is applicable,
and if so, then it's applied with the application function.
Wouldn't it make sense to rather than making a new mechanism,
extend the current one, by adding to channels a new field
that will hold list of `patch` records, and then in
latest-channels-instance we would just do
```
(apply-patches checkout commit (channel-patches patches))
```
?
Apart from that I am wondering if this is going to be user friendly,
because I would imagine most people will just want to patch with already
existing commits. And for that it would be much easier to just have a
list of files to apply, similar to what origin has.
While this will be possible with this transformer field, it will mean
calling the patch (or I could've missed a function that does that
already).
So maybe at least exposing a new procedure to apply a list of patches
would be good, so users can then just do something like:
```
(channel
(patches ;; already expecting list of patch records
(make-channel-patches
(list (local-file "fix-1.patch")))))
```
Where make-channel-patches takes a list of files
and returns a patch record returning #t for predicate,
and applying by calling the patch executable for each file, similarly
to what patch-and-repack in guix/packages.scm does.
Note that I am not sure if local-file is appropriate here
or if gexps are unusable.
What do you think?
Regards,
Rutherther
This bug report was last modified 77 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.