Subject: Re: [bug#41219] [PATCH 2/2] guix: Enforce package.json "files" directive.

From: paul <[email-masked]>
Date: Tue, 22 Sep 2020 17:47:23 +0200

Hi Jelle,

just a quick follow up that I forgot yesterday.

>>> +                 (map (lambda (path)
>>> +                        (string-drop path 2))
>>                             ^
>>                           If this is meant to drop the "./" prefix, you
>>                           should be able to leave it out.
>>
This seems to be necessary because given the way glob-match? is 
implemented a string matches a pattern iif either they start with the 
same character or the pattern starts with a wildcard. So for example:

scheme@(guix-user)> ,use (guix glob)

scheme@(guix-user)> (string->compiled-sglob "*.json")

$1 = (* ".json")

scheme@(guix-user)> (string->compiled-sglob "package.json")

$2 = "package.json"

scheme@(guix-user)> (glob-match? $1 "./package.json")

$3 = #t

scheme@(guix-user)> (glob-match? $2 "./package.json")

$4 = #f

Thank you again for your help,

Cheers

Giacomo