GNU bug report logs - #35588
guix package --search does not search output names

Previous Next

Package: guix;

Reported by: Chris Marusich <cmmarusich <at> gmail.com>

Date: Sun, 5 May 2019 19:40:01 UTC

Severity: normal

Tags: fixed

Done: Chris Marusich <cmmarusich <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Chris Marusich <cmmarusich <at> gmail.com>
To: Tobias Geerinckx-Rice <me <at> tobias.gr>
Cc: 35588 <at> debbugs.gnu.org
Subject: bug#35588: [PATCH] ui: Search matches additional package outputs.
Date: Mon, 06 May 2019 02:08:58 -0700
[Message part 1 (text/plain, inline)]
Hi Tobias!

Tobias Geerinckx-Rice <me <at> tobias.gr> writes:

> Here's a patch to match package outputs (except ‘out’, since it can't affect the relative score) in ‘guix search’.

Wow, thank you for the quick patch!  Indeed, it works as advertised.

That said, I see that your patch only omits the "out" output, and it
also changes the way the regular expression matching works for all
fields.  Previously, a regex like "foo$" would have matched against
"foo" at the end of a package's description string, but now it matches
"foo" right before any newline in the description.  In practice, it
seems we have many newlines in the descriptions, since people wrap the
lines in the source code with non-escaped newlines.  I doubt anyone is
relying on the use of $ or ^ to match at the start of end of the
description, so this probably isn't a big deal, but it made me wonder
how else we might be able to accomplish the same task without changing
the way the regexes already work.

I've attached a patch that attempts to do that.  Basically, this patch
is like yours in spirit, but it excludes a few more "common" outputs,
and it splits the outputs into a list, rather than separating them by
newlines in a single string.  The downside is that I had to update all
the other "metrics" procedures so they would always return a list.  I
kind of feel like returning the same type of object is an upside, not a
downside, but I guess the pattern of returning #f for special cases is
pretty common in Guile, so maybe my change isn't very idiomatic.

What do you think of this solution?  I think it's a little more drastic,
but it feels cleaner to me.  If I'm bike shedding, feel free to call me
out on that!  ;-)

-- 
Chris
[0001-ui-Make-package-outputs-searchable.patch (text/x-patch, attachment)]
[signature.asc (application/pgp-signature, inline)]

This bug report was last modified 6 years and 11 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.