bug-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: guix-package --search


From: Nikita Karetnikov
Subject: Re: guix-package --search
Date: Wed, 23 Jan 2013 10:33:30 -0500

> Instead, you can directly build the list of matching packages, like:

>   (fold-packages (lambda (package result)
>                    (if (or (regexp-exec rx (package-synopsis package))
>                            (regexp-exec rx (package-description package)))
>                        (cons package result)
>                        result))
>                  '())

> This way, only one traversal is done.

'regexp-exec' will raise an error if either 'synopsis' or 'description'
is not a string.  That's why I wrapped it in 'false-if-exception'.

> For i18n, we should actually use (gettext (package-description
> package)), likewise for synopsis.  This way, that will search through
> text in the user’s native language.

I added it, but I haven't properly tested it.  Also, there is
'remove-duplicates' that works in the REPL.  But it doesn't remove
duplicates when I call it via 'guix-package -s'.  (Sometimes they appear
and sometimes they don't show up.)  Anyway, I'm attaching the patch.

Nikita

Attachment: 0001-guix-package-Add-search.patch
Description: Text Data

Attachment: pgpLQQa1dn2l5.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]