I'm trying to pack the updated version of rubocop (1.4.2). The problem is that a patch must be applied, and it affects two files that aren't writable, .rubocop.yml and .rubocop_todo.yml. I've tried making it writable after unpacking: (arguments ... ... (add-after 'unpack 'make-yml-files-writable (lambda _ (let ((yml-files (find-files "\\.yml$"))) (for-each make-file-writable yml-files)) #t)) ...) I've tried as well doing it with a snippet: (source ... ... (modules '((guix build utils))) (snippet '(begin (for-each (make-file-writable (find-files "\\.yml$"))) #t)) ...) However, I haven't been successful and the files remain non-writable when the patch is applied. What am I doing wrong? Tomás
I'm trying to pack the updated version of rubocop (1.4.2). The problem is that a patch must be applied, and it affects two files that aren't writable, .rubocop.yml and .rubocop_todo.yml. I've tried making it writable after unpacking: (arguments ... ... (add-after 'unpack 'make-yml-files-writable (lambda _ (let ((yml-files (find-files "\\.yml$"))) (for-each make-file-writable yml-files)) #t)) ...) I've tried as well doing it with a snippet: (source ... ... (modules '((guix build utils))) (snippet '(begin (for-each (make-file-writable (find-files "\\.yml$"))) #t)) ...) However, I haven't been successful and the files remain non-writable when the patch is applied. What am I doing wrong? Tomás
Hey Tomás,
Check your parens:
(for-each (make-file-writable (find-files "\\.yml$")))
Should be
(for-each make-file-writable (find-files "\\.yml$"))
That’s because for-each is a higher order function which takes a procedure and a list.
Good luck!
- John
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
Hello John,
You're right, but that's only because I made a mistake when pasting it on my email client, sorry :)
I think the problem is related to the phase when it runs. However, I don't understand why the current package for version 0.88 doesn't have that issue...
Thank you for your reply!
Tomás
On 11/27/20 9:19 PM, John Soo wrote:
> Hey Tomás,
>
> Check your parens:
>
> (for-each (make-file-writable (find-files "\\.yml$")))
>
> Should be
>
> (for-each make-file-writable (find-files "\\.yml$"))
>
> That’s because for-each is a higher order function which takes a procedure and a list.
>
> Good luck!
>
> - John
>
>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
Hey Tomás, Could you share your definition and errors? Maybe we can help better if we had more information. Kindly, John