From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Subject: bug#35588: [PATCH] ui: Search matches additional package outputs. Date: Tue, 07 May 2019 10:25:39 +0200 Message-ID: <87mujy8yd8.fsf@gnu.org> References: <87r29czo6e.fsf@gmail.com> <20190505214153.32372-1-me@tobias.gr> <87bm0g6jbp.fsf@garuda.local.i-did-not-set--mail-host-address--so-tickle-me> <87muk0kjxf.fsf@gnu.org> <87zhnzxer9.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([209.51.188.92]:59565) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hNvQL-0006Xa-8V for bug-guix@gnu.org; Tue, 07 May 2019 04:26:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hNvQK-0004AP-BM for bug-guix@gnu.org; Tue, 07 May 2019 04:26:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:44633) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hNvQJ-00046E-5w for bug-guix@gnu.org; Tue, 07 May 2019 04:26:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hNvQI-0001kF-R4 for bug-guix@gnu.org; Tue, 07 May 2019 04:26:02 -0400 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <87zhnzxer9.fsf@gmail.com> (Chris Marusich's message of "Mon, 06 May 2019 17:57:46 -0700") List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: Chris Marusich Cc: 35588@debbugs.gnu.org Hello, Chris Marusich skribis: > From c1150a217a416ef4ceccf87c56e36e8e921f873a Mon Sep 17 00:00:00 2001 > From: Chris Marusich > Date: Mon, 6 May 2019 01:51:30 -0700 > Subject: [PATCH] ui: Make package outputs searchable. > > * guix/ui.scm (relevance): Allow the "field" procedure of a metric to > return a list, and handle that case appropriately. Update docstring. > (%package-metrics): Add a metric for package outputs. > * guix/scripts/package.scm (find-packages-by-description): Update > docstring. > > Co-authored-by: Tobias Geerinckx-Rice [...] > (match (field obj) > (#f relevance) > - (str (+ relevance > - (* (score str) weight))))))) > + ((? string? str) (+ relevance > + (* (score str) weight))) > + ((? list? lst) (+ relevance > + (* weight > + (apply + (map score lst))))))))) Nitpick: it=E2=80=99s a bit subjective, but I think this clause might be slightly nicer like this: ((lst ...) (+ relevance (* weight (reduce + 0 (map score lst))))) Anyway, LGTM! Thanks, Ludo=E2=80=99.