From unknown Sun Aug 17 01:51:40 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#58136] [PATCH] ui: Improve sort order when searching package names. Resent-From: Lars-Dominik Braun Original-Sender: "Debbugs-submit" Resent-CC: ludo@gnu.org, guix-patches@gnu.org Resent-Date: Wed, 28 Sep 2022 09:28:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 58136 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 58136@debbugs.gnu.org Cc: ludo@gnu.org X-Debbugs-Original-To: guix-patches@gnu.org X-Debbugs-Original-Xcc: ludo@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.166435727620014 (code B ref -1); Wed, 28 Sep 2022 09:28:02 +0000 Received: (at submit) by debbugs.gnu.org; 28 Sep 2022 09:27:56 +0000 Received: from localhost ([127.0.0.1]:60140 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1odTMA-0005Cj-PX for submit@debbugs.gnu.org; Wed, 28 Sep 2022 05:27:55 -0400 Received: from lists.gnu.org ([209.51.188.17]:45830) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1odTM6-0005CV-VI for submit@debbugs.gnu.org; Wed, 28 Sep 2022 05:27:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59710) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odTM6-0000xv-1s for guix-patches@gnu.org; Wed, 28 Sep 2022 05:27:50 -0400 Received: from mout-p-101.mailbox.org ([80.241.56.151]:58070) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256) (Exim 4.90_1) (envelope-from ) id 1odTM1-0001qc-TH for guix-patches@gnu.org; Wed, 28 Sep 2022 05:27:49 -0400 Received: from smtp102.mailbox.org (smtp102.mailbox.org [IPv6:2001:67c:2050:b231:465::102]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-101.mailbox.org (Postfix) with ESMTPS id 4McrkM1kYDz9sm7 for ; Wed, 28 Sep 2022 11:27:39 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6xq.net; s=MBO0001; t=1664357259; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tMDOUhTonqWUQcCDPMYxDx63BpgJ3CHa5CelZbcPYDg=; b=sCR+nBduy+cBdvsiRtWB4HyQnW/VA13h2ekgU2fDPxjwgLvslCLUWp+xb0URrTmBbG7tUI /Czyu5dcK0YgYN3X2vPJL3fVGltW1gXFPC22modthOgVK2LDYxCBwCPEOQEafOVT+Q3fwi wzTrGE3cLKtxsi8PxDwpVxd+/xYWsaMMyooS8LM4K+uEsJHzSfJyjKQHnQrltJNSE6zCcS qmMlPXWZ3QdhKNm8+MnRlyCog1ZxUkaxUPELbyWXM6Dz5nWVZd8xaoM0eh4SUc9k/nVqo1 J1eMkEw5zokOL2yspE9WcZYUPXmk+AEjZp3xNS30ZqEoqkHGkSPUAysWWQqVjg== Date: Wed, 28 Sep 2022 11:27:37 +0200 From: Lars-Dominik Braun Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4McrkM1kYDz9sm7 Received-SPF: pass client-ip=80.241.56.151; envelope-from=lars@6xq.net; helo=mout-p-101.mailbox.org X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.6 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.6 (--) Hi, we provide a `guix serach`-based package search to our users and noticed that searching for “ggplot2” yields the package r-ggplot2 on position 11 only – when it should be the first. Looking at other potential search terms (haven, shiny, ape, renv, here, ini, setuptools) reveals similar issues. I propose we also score the unprefixed package name, so SCORE can award bonus points for a full string match. I don’t like that we have to maintain a list of common prefixes for this and that package names are scored twice now, but I can’t think of a better solution right now. Cheers, Lars * guix/ui.scm (%package-metrics): Increase score for PACKAGE-NAME and add score for unprefixed package name. --- guix/ui.scm | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/guix/ui.scm b/guix/ui.scm index dad2b853ac..55b596ed35 100644 --- a/guix/ui.scm +++ b/guix/ui.scm @@ -1655,7 +1655,38 @@ (define (regexp->score regexp) (define %package-metrics ;; Metrics used to compute the "relevance score" of a package against a set ;; of regexps. - `((,package-name . 4) + `((,package-name . 8) + + ;; For packages with a language prefix (namespaces), also compare the + ;; unprefixed name, so searching for “ggplot2” yields + ;; r-ggplot2 as first result instead of other, higher-ranked packages, + ;; which contain “ggplot2” in their description alot. + (,(lambda (package) + (let ((namespaces (list "cl-" + "ecl-" + "emacs-" + "ghc-" + "go-" + "guile-" + "java-" + "julia-" + "node-" + "ocaml-" + "perl-" + "python-" + "r-" + "ruby-" + "rust-" + "sbcl-" + "texlive-")) + (name (package-name package))) + (fold (lambda (prefix accum) + (if (string-prefix? prefix name) + (cons (substring name (string-length prefix)) accum) + accum)) + '() + namespaces))) + . 4) ;; Match against uncommon outputs. (,(lambda (package) -- 2.35.1 From unknown Sun Aug 17 01:51:40 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#58136] [PATCH] ui: Improve sort order when searching package names. Resent-From: zimoun Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 28 Sep 2022 14:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58136 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Lars-Dominik Braun , 58136@debbugs.gnu.org Cc: ludo@gnu.org Received: via spool by 58136-submit@debbugs.gnu.org id=B58136.166437616431173 (code B ref 58136); Wed, 28 Sep 2022 14:43:02 +0000 Received: (at 58136) by debbugs.gnu.org; 28 Sep 2022 14:42:44 +0000 Received: from localhost ([127.0.0.1]:34125 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1odYGp-00086g-QB for submit@debbugs.gnu.org; Wed, 28 Sep 2022 10:42:44 -0400 Received: from mail-wm1-f54.google.com ([209.85.128.54]:40479) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1odYGn-00086T-87 for 58136@debbugs.gnu.org; Wed, 28 Sep 2022 10:42:42 -0400 Received: by mail-wm1-f54.google.com with SMTP id u16-20020a05600c211000b003b5152ebf09so1390739wml.5 for <58136@debbugs.gnu.org>; Wed, 28 Sep 2022 07:42:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:from:to:cc:subject:date; bh=a5R2Y6idmqUJB43TeXLZv1Jv2eAXN72xx+BfH3GmMJ8=; b=Dmgfl8NFYwgkQbCcDxAc8qTS/gywdhkz76ue5hOvtB/Rl/WaImoEELzMGX2ORzKBEJ tjrmlslG4BLsQH1O5bX/vtBDo5PnCm8id4W+r5XEyoG8QVfBo1zNudUEDD27e2MrieFy lQAM9OLvKl0ntLMbcRnmniWRk5hBOM9a0lGB1cU/0Qba3B4uGP6GKao0SgCm3sHgrftI cJNfFLEBddcP3Ib6uzc2XPkAhS+WlnBQ4xWqUNy4RpTXtFZTLDiikU+YvEcO6gM8AqCm 3Ay+qyS56o/N5sk1Kg3J99nYVZlADLAR3hMPdcy+Y2k1LiMNCnCyKQogVqAl5LlRlCdF rJ7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=a5R2Y6idmqUJB43TeXLZv1Jv2eAXN72xx+BfH3GmMJ8=; b=G5eG5k541OTCMdUflKsxow3vRDocwSAWNnB8qpLWXapH6d79Qs4Tj0LUMSFjw8Pqw1 vBiRT712Bef8XcGDpn1vFYFyG9NIYyxwYtiYlV3LDVs2OriJ17khr3hc8gUJEMF6vHA9 bKb4pveBovX2S19LR/HzgOD1WiVd7Ek+zJGIsDZh7ssutU5wjVsbcLbQcsBDmDYkaWtX kDFPW5NxMAoyJa6BG7jb/dV4KC7443fDos2UO0HcosFIhUuffNYicLff1yV7eNqmO1Tj NBS6Q023q7nFn8fFpm1Igsduabob7pETzwAxWLTULflRKXtjGYrHM2WQdiRJClYKVFk/ FXRw== X-Gm-Message-State: ACrzQf15ZWaEuw64KF/XqczgLJIbi/7+O+SbRxbFLaod/Plpbl8ahodP xZbW27bAt68tj5iy7C4fNOc= X-Google-Smtp-Source: AMsMyM5y5g+RUcvPX9DKGx/5TnzOETZh2o+t0kYDGGVC0YlGzC3UMlaosWwMK8x3n77djiK2gnCEDw== X-Received: by 2002:a05:600c:1c03:b0:3b4:618b:5d14 with SMTP id j3-20020a05600c1c0300b003b4618b5d14mr6857540wms.59.1664376155171; Wed, 28 Sep 2022 07:42:35 -0700 (PDT) Received: from lili ([2a01:e0a:59b:9120:65d2:2476:f637:db1e]) by smtp.gmail.com with ESMTPSA id iv16-20020a05600c549000b003b4c40378casm2096979wmb.39.2022.09.28.07.42.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Sep 2022 07:42:34 -0700 (PDT) From: zimoun In-Reply-To: References: Date: Wed, 28 Sep 2022 16:26:38 +0200 Message-ID: <86wn9na82p.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Lars, On Wed, 28 Sep 2022 at 11:27, Lars-Dominik Braun wrote: > I propose we also score the unprefixed package name, so SCORE can award > bonus points for a full string match. I don=E2=80=99t like that we have to > maintain a list of common prefixes for this and that package names are > scored twice now, but I can=E2=80=99t think of a better solution right no= w. In addition to your proposal which LGTM, maybe we could also use the =E2=80=99upstream-name=E2=80=99 properties. Most of the time, the Guix nam= e matches the upstream name, but sometimes not. Although, it would not fix the issue for ggplot2 since there is no upstream-name for this package. :-) Well, I propose something like see below (based on your patch): 1. keep the weight as 4 2. set the =E2=80=9Cnamespace=E2=80=9D weight to 1 (or 2 if you prefer) Otherwise, for example, generic name as CSV could artificially bump the relevance and hide relevant packages. For instance, compare guix search csv 3. use upstream-name if provided WDYT? --8<---------------cut here---------------start------------->8--- diff --git a/guix/ui.scm b/guix/ui.scm index 55b596ed35..14f296a546 100644 --- a/guix/ui.scm +++ b/guix/ui.scm @@ -1655,7 +1655,7 @@ (define (regexp->score regexp) (define %package-metrics ;; Metrics used to compute the "relevance score" of a package against a = set ;; of regexps. - `((,package-name . 8) + `((,package-name . 4) =20 ;; For packages with a language prefix (namespaces), also compare the ;; unprefixed name, so searching for =E2=80=9Cggplot2=E2=80=9D yields @@ -1684,9 +1684,9 @@ (define %package-metrics (if (string-prefix? prefix name) (cons (substring name (string-length prefix)) accum) accum)) - '() + (list (package-upstream-name package)) namespaces))) - . 4) + . 1) =20 ;; Match against uncommon outputs. (,(lambda (package) --8<---------------cut here---------------end--------------->8--- Cheers, simon From unknown Sun Aug 17 01:51:40 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#58136] [PATCH] ui: Improve sort order when searching package names. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 28 Sep 2022 20:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58136 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: zimoun , Lars-Dominik Braun , 58136@debbugs.gnu.org Cc: ludo@gnu.org Received: via spool by 58136-submit@debbugs.gnu.org id=B58136.16643965882303 (code B ref 58136); Wed, 28 Sep 2022 20:24:02 +0000 Received: (at 58136) by debbugs.gnu.org; 28 Sep 2022 20:23:08 +0000 Received: from localhost ([127.0.0.1]:34834 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oddaG-0000b5-1f for submit@debbugs.gnu.org; Wed, 28 Sep 2022 16:23:08 -0400 Received: from michel.telenet-ops.be ([195.130.137.88]:45350) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oddaE-0000av-Ac for 58136@debbugs.gnu.org; Wed, 28 Sep 2022 16:23:06 -0400 Received: from [IPV6:2a02:1811:8c09:9d00:5dba:d409:33f7:a16] ([IPv6:2a02:1811:8c09:9d00:5dba:d409:33f7:a16]) by michel.telenet-ops.be with bizsmtp id RYP42800E20ykKC06YP4a0; Wed, 28 Sep 2022 22:23:05 +0200 Message-ID: <47edd297-92ec-d8a1-5999-813f4b9644db@telenet.be> Date: Wed, 28 Sep 2022 22:23:04 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 Content-Language: en-US References: <86wn9na82p.fsf@gmail.com> From: Maxime Devos In-Reply-To: <86wn9na82p.fsf@gmail.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------VRpqZKEdXYcL7VgtsiMK7Ych" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1664396585; bh=GiXcFmZYBmzN8g0yIfMOL6VY6u3zy7IiY2lHS6+S+ms=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=S69WEmlwQIVonpGyrg1alA5Uv0b7buhmHMzRjC5WXROj+6tRjRrb8ltVOABDcqkno dxtwUkWzNUwf8PnhYJD/Dbbor+aj/djuodywGI2G+v7lKPSqUM1sy4MDPehV3FPvKO rXDRFEZ8a1asO08KNiIu6iUqN+Q72yEu64SeV8u0TD6VXW52L/9dd24rG+sDxMh36A +t5Q3Inr+DT1cPP/25qRt7moSLfsuVAZH+J/IE2ziNPttqeMWtp9jmFGXGqXysbUhW pIiqf3Nc9Wj0WVYgHgm9VjhMCPAlDfwixKMEc9q6wlR7NPrB6Tj+q7XvDvk/Xvv2/B bbMI9+tzdwJCA== X-Spam-Score: -1.8 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.8 (--) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------VRpqZKEdXYcL7VgtsiMK7Ych Content-Type: multipart/mixed; boundary="------------ULk0SbC0m8ZxbIrjF4oZungj"; protected-headers="v1" From: Maxime Devos To: zimoun , Lars-Dominik Braun , 58136@debbugs.gnu.org Cc: ludo@gnu.org Message-ID: <47edd297-92ec-d8a1-5999-813f4b9644db@telenet.be> Subject: Re: [bug#58136] [PATCH] ui: Improve sort order when searching package names. References: <86wn9na82p.fsf@gmail.com> In-Reply-To: <86wn9na82p.fsf@gmail.com> --------------ULk0SbC0m8ZxbIrjF4oZungj Content-Type: multipart/mixed; boundary="------------cipyNXXEvotUpKU2rc0KABdu" --------------cipyNXXEvotUpKU2rc0KABdu Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: base64 PiArICAgIDs7IEZvciBwYWNrYWdlcyB3aXRoIGEgbGFuZ3VhZ2UgcHJlZml4IChuYW1lc3Bh Y2VzKSwgYWxzbyBjb21wYXJlIHRoZQ0KDQpZb3UgbWlzc2VkICJtaW5ldGVzdC0iDQoNCk9u IDI4LTA5LTIwMjIgMTY6MjYsIHppbW91biB3cm90ZToNCj4gICAzLiB1c2UgdXBzdHJlYW0t bmFtZSBpZiBwcm92aWRlZA0KPiANCj4gV0RZVD8NCg0KRm9yIHRoZSBNaW5ldGVzdCBtb2Rz ICh3aGljaCBoYXZlIHVwc3RyZWFtLW5hbWVzIGxpa2UgIkplaWphL21lc2Vjb25zIiksIA0K SSBkb24ndCB0aGluayB0aGluayB0aGUgdXBzdHJlYW0tbmFtZSBpcyB1c2VmdWwgYXMtaXMN Cg0KR3JlZXRpbmdzLA0KTWF4aW1lLg0K --------------cipyNXXEvotUpKU2rc0KABdu Content-Type: application/pgp-keys; name="OpenPGP_0x49E3EE22191725EE.asc" Content-Disposition: attachment; filename="OpenPGP_0x49E3EE22191725EE.asc" Content-Description: OpenPGP public key Content-Transfer-Encoding: quoted-printable -----BEGIN PGP PUBLIC KEY BLOCK----- xjMEX4ch6BYJKwYBBAHaRw8BAQdANPb/d6MrGnGi5HyvODCkBUJPRjiFQcRU5V+m xvMaAa/NL01heGltZSBEZXZvcyA8bWF4aW1lLmRldm9zQHN0dWRlbnQua3VsZXV2 ZW4uYmU+wpAEExYIADgWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCX4ch6AIbAwUL CQgHAwUVCgkICwUWAgMBAAIeAQIXgAAKCRBJ4+4iGRcl7japAQC3opZ2KGWzWmRc /gIWSu0AAcfMwyinFEEPa/QhUt2CogD/e2RdF4CYAgaRHJJmZ9WU7piKbLZ7llB4 LzgezVDHggzNJU1heGltZSBEZXZvcyA8bWF4aW1lZGV2b3NAdGVsZW5ldC5iZT7C kAQTFggAOBYhBMHzPuIMUo/bfdcBH0nj7iIZFyXuBQJf56ycAhsDBQsJCAcDBRUK CQgLBRYCAwEAAh4BAheAAAoJEEnj7iIZFyXujpQBAKV1SwDDl4f24rXciDlB9L8W ycZt30CgbewMSRQk4mvbAP9dFMbVVixYBd6C8cfhR+NsOBGiOJnQABlUmgNuqGFJ Dc44BF+HIegSCisGAQQBl1UBBQEBB0BOlzIWiJzgobMF6/cqwLaLk7jIcFSZ++c0 k9cCNT6YXwMBCAfCeAQYFggAIBYhBMHzPuIMUo/bfdcBH0nj7iIZFyXuBQJfhyHo AhsMAAoJEEnj7iIZFyXuMr0BAJc8cl5PGvVmVuSQVKjleNl4DK1/XAaPAYPe34AE fZJPAP9IqLCQhH/FeJanHqBP8gNdGNI2qn8RnnLVfRJgUjZ1BA=3D=3D =3DOVqp -----END PGP PUBLIC KEY BLOCK----- --------------cipyNXXEvotUpKU2rc0KABdu-- --------------ULk0SbC0m8ZxbIrjF4oZungj-- --------------VRpqZKEdXYcL7VgtsiMK7Ych Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature" -----BEGIN PGP SIGNATURE----- wnsEABYIACMWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYzStKAUDAAAAAAAKCRBJ4+4iGRcl7lPm AP9bWR8sDbTkIqHlH3TzYt+m+8SMe5VbUqJHRIS537M+DgD+IMs5rCtZ3UKqDp62ZoI8RUzvLU6c TZAOStl1eOWDYQ0= =61Q5 -----END PGP SIGNATURE----- --------------VRpqZKEdXYcL7VgtsiMK7Ych-- From unknown Sun Aug 17 01:51:40 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#58136] [PATCH] ui: Improve sort order when searching package names. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 28 Sep 2022 20:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58136 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: zimoun , Lars-Dominik Braun , 58136@debbugs.gnu.org Cc: ludo@gnu.org Received: via spool by 58136-submit@debbugs.gnu.org id=B58136.166439794514538 (code B ref 58136); Wed, 28 Sep 2022 20:46:02 +0000 Received: (at 58136) by debbugs.gnu.org; 28 Sep 2022 20:45:45 +0000 Received: from localhost ([127.0.0.1]:34920 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oddw9-0003lm-59 for submit@debbugs.gnu.org; Wed, 28 Sep 2022 16:45:45 -0400 Received: from baptiste.telenet-ops.be ([195.130.132.51]:36516) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oddw4-0003Vt-QB for 58136@debbugs.gnu.org; Wed, 28 Sep 2022 16:45:41 -0400 Received: from [IPV6:2a02:1811:8c09:9d00:5dba:d409:33f7:a16] ([IPv6:2a02:1811:8c09:9d00:5dba:d409:33f7:a16]) by baptiste.telenet-ops.be with bizsmtp id RYle2800G20ykKC01Ylfxw; Wed, 28 Sep 2022 22:45:39 +0200 Message-ID: Date: Wed, 28 Sep 2022 22:45:38 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 Content-Language: en-US From: Maxime Devos References: <86wn9na82p.fsf@gmail.com> <47edd297-92ec-d8a1-5999-813f4b9644db@telenet.be> In-Reply-To: <47edd297-92ec-d8a1-5999-813f4b9644db@telenet.be> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------Rr0OzhZA9osOVmGVcy7lbzUH" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1664397939; bh=X/k8pwZAU0ujMo3X+w7jHQ2GvJSxGTN09QYZwVsyX1w=; h=Date:Subject:From:To:Cc:References:In-Reply-To; b=eSzIeyScgi6dqHGxENbfWB+yI9rIJfANj/uMqa3wNn4ZY33dQudm1f5bOKr0eKan8 96Q8LcRaQIVH3EO3DZ2WDMGMYAWkYW1M3J6YTRNIQSmvtmw2VGLahqeug41bEcWfwG E7W5zwqOHa4u6m+g40TwFY+wNlSytLK+qau/235IjEzeCxF6UHkA+mIDetm1S7UwR9 My6oQeXmepUMoXRfN3hhVxyxA4DbraNx+8AbUQU/59iIav/mEAtbPCmPCka4yHRMt4 lU5yVDLpNAFQD4pJjFikopXgJhBuha1PBXzLn49bby7UD57HAw65wun3GQ0HTDdRjS dTwMKY9Hwq5zg== X-Spam-Score: -2.5 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.5 (---) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------Rr0OzhZA9osOVmGVcy7lbzUH Content-Type: multipart/mixed; boundary="------------qCjG6e6Sf4oavodlIjtFAxbt"; protected-headers="v1" From: Maxime Devos To: zimoun , Lars-Dominik Braun , 58136@debbugs.gnu.org Cc: ludo@gnu.org Message-ID: Subject: Re: [bug#58136] [PATCH] ui: Improve sort order when searching package names. References: <86wn9na82p.fsf@gmail.com> <47edd297-92ec-d8a1-5999-813f4b9644db@telenet.be> In-Reply-To: <47edd297-92ec-d8a1-5999-813f4b9644db@telenet.be> --------------qCjG6e6Sf4oavodlIjtFAxbt Content-Type: multipart/mixed; boundary="------------ZkIaZiCLi6QZp0AwQWx2Iquu" --------------ZkIaZiCLi6QZp0AwQWx2Iquu Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: base64 DQoNCk9uIDI4LTA5LTIwMjIgMjI6MjMsIE1heGltZSBEZXZvcyB3cm90ZToNCj4gWW91wqBt aXNzZWTCoCJtaW5ldGVzdC0iDQoNCkFsc28sICJsdWEtIi4NCg== --------------ZkIaZiCLi6QZp0AwQWx2Iquu Content-Type: application/pgp-keys; name="OpenPGP_0x49E3EE22191725EE.asc" Content-Disposition: attachment; filename="OpenPGP_0x49E3EE22191725EE.asc" Content-Description: OpenPGP public key Content-Transfer-Encoding: quoted-printable -----BEGIN PGP PUBLIC KEY BLOCK----- xjMEX4ch6BYJKwYBBAHaRw8BAQdANPb/d6MrGnGi5HyvODCkBUJPRjiFQcRU5V+m xvMaAa/NL01heGltZSBEZXZvcyA8bWF4aW1lLmRldm9zQHN0dWRlbnQua3VsZXV2 ZW4uYmU+wpAEExYIADgWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCX4ch6AIbAwUL CQgHAwUVCgkICwUWAgMBAAIeAQIXgAAKCRBJ4+4iGRcl7japAQC3opZ2KGWzWmRc /gIWSu0AAcfMwyinFEEPa/QhUt2CogD/e2RdF4CYAgaRHJJmZ9WU7piKbLZ7llB4 LzgezVDHggzNJU1heGltZSBEZXZvcyA8bWF4aW1lZGV2b3NAdGVsZW5ldC5iZT7C kAQTFggAOBYhBMHzPuIMUo/bfdcBH0nj7iIZFyXuBQJf56ycAhsDBQsJCAcDBRUK CQgLBRYCAwEAAh4BAheAAAoJEEnj7iIZFyXujpQBAKV1SwDDl4f24rXciDlB9L8W ycZt30CgbewMSRQk4mvbAP9dFMbVVixYBd6C8cfhR+NsOBGiOJnQABlUmgNuqGFJ Dc44BF+HIegSCisGAQQBl1UBBQEBB0BOlzIWiJzgobMF6/cqwLaLk7jIcFSZ++c0 k9cCNT6YXwMBCAfCeAQYFggAIBYhBMHzPuIMUo/bfdcBH0nj7iIZFyXuBQJfhyHo AhsMAAoJEEnj7iIZFyXuMr0BAJc8cl5PGvVmVuSQVKjleNl4DK1/XAaPAYPe34AE fZJPAP9IqLCQhH/FeJanHqBP8gNdGNI2qn8RnnLVfRJgUjZ1BA=3D=3D =3DOVqp -----END PGP PUBLIC KEY BLOCK----- --------------ZkIaZiCLi6QZp0AwQWx2Iquu-- --------------qCjG6e6Sf4oavodlIjtFAxbt-- --------------Rr0OzhZA9osOVmGVcy7lbzUH Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature" -----BEGIN PGP SIGNATURE----- wnsEABYIACMWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYzSycgUDAAAAAAAKCRBJ4+4iGRcl7kdV AP9HAIjLsVfv4TUhdXQzMHTn959UC85BBOX9d+64f/ZA7gD/YMcA1663VeyXP0m1Smpo/sIPQSkL 2nb/NI6Ayf8U7gQ= =zr2A -----END PGP SIGNATURE----- --------------Rr0OzhZA9osOVmGVcy7lbzUH-- From unknown Sun Aug 17 01:51:40 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#58136] [PATCH] ui: Improve sort order when searching package names. Resent-From: zimoun Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 28 Sep 2022 21:41:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58136 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Maxime Devos , Lars-Dominik Braun , 58136@debbugs.gnu.org Cc: ludo@gnu.org Received: via spool by 58136-submit@debbugs.gnu.org id=B58136.166440121828986 (code B ref 58136); Wed, 28 Sep 2022 21:41:01 +0000 Received: (at 58136) by debbugs.gnu.org; 28 Sep 2022 21:40:18 +0000 Received: from localhost ([127.0.0.1]:35066 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1odemv-0007XR-GL for submit@debbugs.gnu.org; Wed, 28 Sep 2022 17:40:17 -0400 Received: from mail-wm1-f50.google.com ([209.85.128.50]:43529) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1odemr-0007X8-6h for 58136@debbugs.gnu.org; Wed, 28 Sep 2022 17:40:15 -0400 Received: by mail-wm1-f50.google.com with SMTP id r3-20020a05600c35c300b003b4b5f6c6bdso1702104wmq.2 for <58136@debbugs.gnu.org>; Wed, 28 Sep 2022 14:40:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:from:to:cc:subject:date; bh=wIeAGmfme+/k658scHTgXTUyTswPpM9bJyZcCoJ9I/c=; b=DIx5LV64dhK2yfFg7FcO18SsAajr1RVR0iL9Fp/bB/tWsRcOpI1t50w0+wJBkEfi0r bImfuDvYAW4vnL7lvN57DrBYwBtnjhY/zsFJR2ev4Isoh3H/O5tUcxAgQGEm03jr6GFZ KWX/K32+olzsh3meugcDnykX5Ms0DihQ91XCKFHddIx7ittgJeQ15VDgCo6aurDIEUOf BRHX66e1JpyhLoN6Sl6v5rqVQRWBSOeM0Ixn4tpgR03poaMOI1V+6vvm76RbZ+QhvBG3 /+14K8QjfZ2t6A2znkK6CvaA15gPOcuHwpHYJBG5ReU4Y3X8HdIDnN5/ck2L4uW8xqwQ 9zEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=wIeAGmfme+/k658scHTgXTUyTswPpM9bJyZcCoJ9I/c=; b=GX9X6zQRI3Gipwfgeq7iS54++fDb3wOnIMMJ4YX6KFfcYsIvMutFyNKkdn7QpxXt1b PS8Y+re5LUZiFsXJI/irLWdzcy0FUSnU7HBAYBzXoOm8gsYpoQyjbGCKcfDT3XNd2dCB Wk2ax5p+WWhA5ATEZA5zFOHOVVKQnujtLYT1xihncbJnso22OYv2FcwlGe7r8tMlm2nG fGvOGIgsvXIXn5Xy8RZyx+vP/8I0vwZJNhy+lO9jfOTyhyuF44LITaJD0Gb1J7fHYIuI PvghV4gOzrsnDKx3fusW05E6aXoWOEsiOygQIMAY/HArNxR2II9wgAKobS1wr/GQzIoA t+Cw== X-Gm-Message-State: ACrzQf09FdAoYVWemXx0WbHrGlEkE7MLgPuDJ7lye1Mj7o6EuDsYlAlM 4c2fCyes7qqr9Bwf5Un4weU= X-Google-Smtp-Source: AMsMyM5AX4xCIPBuTdd+w9Lwe/ZCHN3+GKe4NJifzKI4KRRTvQEj1tqzHvWb3lM1HWL1x7Qvq7Ks1Q== X-Received: by 2002:a7b:cc96:0:b0:3b4:ffb5:6366 with SMTP id p22-20020a7bcc96000000b003b4ffb56366mr36600wma.48.1664401207169; Wed, 28 Sep 2022 14:40:07 -0700 (PDT) Received: from pfiuh07 ([193.48.40.241]) by smtp.gmail.com with ESMTPSA id q4-20020adf9dc4000000b0022cce7689d3sm765243wre.36.2022.09.28.14.40.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Sep 2022 14:40:06 -0700 (PDT) From: zimoun In-Reply-To: <47edd297-92ec-d8a1-5999-813f4b9644db@telenet.be> References: <86wn9na82p.fsf@gmail.com> <47edd297-92ec-d8a1-5999-813f4b9644db@telenet.be> Date: Wed, 28 Sep 2022 23:40:02 +0200 Message-ID: <87v8p7b2kt.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi, On mer., 28 sept. 2022 at 22:23, Maxime Devos wrot= e: > On 28-09-2022 16:26, zimoun wrote: >> 3. use upstream-name if provided > > For the Minetest mods (which have upstream-names like "Jeija/mesecons"),= =20 > I don't think think the upstream-name is useful as-is Using the change I am proposing, just knowing =E2=80=99jeija=E2=80=99 retur= ns a match: --8<---------------cut here---------------start------------->8--- $ ./pre-inst-env guix search jeija name: minetest-mesecons version: 1.2.1-63.27c3c51 outputs: + out: everything else systems: x86_64-linux dependencies:=20 location: gnu/packages/minetest.scm:367:4 homepage: https://mesecons.net license: LGPL 3, CC-BY-SA 3.0 synopsis: Digital circuitry for Minetest, including wires, buttons and ligh= ts=20=20 description: Mesecons is a mod for Minetest implementing various items + related to digital circuitry, such as wires, buttons, lights and programm= able + controllers. Among other things, there are also pistons, solar panels, + pressure plates and note blocks. +=20 + Mesecons has a similar goal to Redstone in Minecraft, but works in its own + way, with different rules and mechanics. relevance: 4 --8<---------------cut here---------------end--------------->8--- which is better than nothing. Well, upstream-name is not so much useful as-is but it can help for some cases. Cheers, simon From unknown Sun Aug 17 01:51:40 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#58136] [PATCH] ui: Improve sort order when searching package names. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 28 Sep 2022 21:44:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58136 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: zimoun , Lars-Dominik Braun , 58136@debbugs.gnu.org Cc: ludo@gnu.org Received: via spool by 58136-submit@debbugs.gnu.org id=B58136.166440143229360 (code B ref 58136); Wed, 28 Sep 2022 21:44:01 +0000 Received: (at 58136) by debbugs.gnu.org; 28 Sep 2022 21:43:52 +0000 Received: from localhost ([127.0.0.1]:35080 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1odeqO-0007dU-5v for submit@debbugs.gnu.org; Wed, 28 Sep 2022 17:43:52 -0400 Received: from baptiste.telenet-ops.be ([195.130.132.51]:50800) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1odeqM-0007dL-N6 for 58136@debbugs.gnu.org; Wed, 28 Sep 2022 17:43:51 -0400 Received: from [IPV6:2a02:1811:8c09:9d00:5dba:d409:33f7:a16] ([IPv6:2a02:1811:8c09:9d00:5dba:d409:33f7:a16]) by baptiste.telenet-ops.be with bizsmtp id RZjl2800820ykKC01Zjl2u; Wed, 28 Sep 2022 23:43:48 +0200 Message-ID: <4dc4d1e1-9775-5c29-877f-91022b794348@telenet.be> Date: Wed, 28 Sep 2022 23:43:44 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 Content-Language: en-US References: <86wn9na82p.fsf@gmail.com> <47edd297-92ec-d8a1-5999-813f4b9644db@telenet.be> <87v8p7b2kt.fsf@gmail.com> From: Maxime Devos In-Reply-To: <87v8p7b2kt.fsf@gmail.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------6goxKr2BsWNzD5hKx6c82YLb" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1664401428; bh=ft25LErALfuCYhbyDZL3hqv3oRkj8vFtTfZfOf2o+AQ=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=GBPpUOWdVG5QKfqGQXWakE5WxpcphJeIGmimEaXjVaLXC1cL+sxg+a0nL47zfy11r DGWYdpvQq6MX8lUDnPf2jHYVR2B+GPvu7w9U6r041nmi+Ls6Nr2cwjBzw3jjLIArxm +u/8u9N3YxXy16TA31WBLuLnVBBSVt00QZ+nfCFbinzUkq18kO2rsawXMW9fM/3cue qI7vYYUma3QrOQ2HyP0OS4Lvusz0kDFREEiTUJPq5sYU8putFwNrOrcRMK8DEk3anx 3U6zrsrliZOhJwsdMr4zN3B95foMvMOPucbRyT8BbfbpQZAw1Tr/RQH09v/ccGGlTd ndG1ywDjrRWCQ== X-Spam-Score: -2.5 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.5 (---) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------6goxKr2BsWNzD5hKx6c82YLb Content-Type: multipart/mixed; boundary="------------RXSSOzE309XksWnSvw90W6C8"; protected-headers="v1" From: Maxime Devos To: zimoun , Lars-Dominik Braun , 58136@debbugs.gnu.org Cc: ludo@gnu.org Message-ID: <4dc4d1e1-9775-5c29-877f-91022b794348@telenet.be> Subject: Re: [bug#58136] [PATCH] ui: Improve sort order when searching package names. References: <86wn9na82p.fsf@gmail.com> <47edd297-92ec-d8a1-5999-813f4b9644db@telenet.be> <87v8p7b2kt.fsf@gmail.com> In-Reply-To: <87v8p7b2kt.fsf@gmail.com> --------------RXSSOzE309XksWnSvw90W6C8 Content-Type: multipart/mixed; boundary="------------BmkWTnOHs6Z78LzH2OjEtjTw" --------------BmkWTnOHs6Z78LzH2OjEtjTw Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: base64 DQoNCk9uIDI4LTA5LTIwMjIgMjM6NDAsIHppbW91biB3cm90ZToNCj4gVXNpbmcgdGhlIGNo YW5nZSBJIGFtIHByb3Bvc2luZywganVzdCBrbm93aW5nIOKAmWplaWph4oCZIHJldHVybnMg YSBtYXRjaDoNCj4gDQo+IC0tODwtLS0tLS0tLS0tLS0tLS1jdXQgaGVyZS0tLS0tLS0tLS0t LS0tLXN0YXJ0LS0tLS0tLS0tLS0tLT44LS0tDQo+ICQgLi9wcmUtaW5zdC1lbnYgZ3VpeCBz ZWFyY2ggamVpamENCj4gbmFtZTogbWluZXRlc3QtbWVzZWNvbnMNCiA+IFsuLi5dDQoNClJp Z2h0LCBkaWRuJ3QgdGhpbmsgb2YgdGhhdC4NCg0KR3JlZXRpbmdzLA0KTWF4aW1lLg0K --------------BmkWTnOHs6Z78LzH2OjEtjTw Content-Type: application/pgp-keys; name="OpenPGP_0x49E3EE22191725EE.asc" Content-Disposition: attachment; filename="OpenPGP_0x49E3EE22191725EE.asc" Content-Description: OpenPGP public key Content-Transfer-Encoding: quoted-printable -----BEGIN PGP PUBLIC KEY BLOCK----- xjMEX4ch6BYJKwYBBAHaRw8BAQdANPb/d6MrGnGi5HyvODCkBUJPRjiFQcRU5V+m xvMaAa/NL01heGltZSBEZXZvcyA8bWF4aW1lLmRldm9zQHN0dWRlbnQua3VsZXV2 ZW4uYmU+wpAEExYIADgWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCX4ch6AIbAwUL CQgHAwUVCgkICwUWAgMBAAIeAQIXgAAKCRBJ4+4iGRcl7japAQC3opZ2KGWzWmRc /gIWSu0AAcfMwyinFEEPa/QhUt2CogD/e2RdF4CYAgaRHJJmZ9WU7piKbLZ7llB4 LzgezVDHggzNJU1heGltZSBEZXZvcyA8bWF4aW1lZGV2b3NAdGVsZW5ldC5iZT7C kAQTFggAOBYhBMHzPuIMUo/bfdcBH0nj7iIZFyXuBQJf56ycAhsDBQsJCAcDBRUK CQgLBRYCAwEAAh4BAheAAAoJEEnj7iIZFyXujpQBAKV1SwDDl4f24rXciDlB9L8W ycZt30CgbewMSRQk4mvbAP9dFMbVVixYBd6C8cfhR+NsOBGiOJnQABlUmgNuqGFJ Dc44BF+HIegSCisGAQQBl1UBBQEBB0BOlzIWiJzgobMF6/cqwLaLk7jIcFSZ++c0 k9cCNT6YXwMBCAfCeAQYFggAIBYhBMHzPuIMUo/bfdcBH0nj7iIZFyXuBQJfhyHo AhsMAAoJEEnj7iIZFyXuMr0BAJc8cl5PGvVmVuSQVKjleNl4DK1/XAaPAYPe34AE fZJPAP9IqLCQhH/FeJanHqBP8gNdGNI2qn8RnnLVfRJgUjZ1BA=3D=3D =3DOVqp -----END PGP PUBLIC KEY BLOCK----- --------------BmkWTnOHs6Z78LzH2OjEtjTw-- --------------RXSSOzE309XksWnSvw90W6C8-- --------------6goxKr2BsWNzD5hKx6c82YLb Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature" -----BEGIN PGP SIGNATURE----- wnsEABYIACMWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYzTAEQUDAAAAAAAKCRBJ4+4iGRcl7qGk AQD3uSy7u3zAJ9N9Z9jKVkH4ortcw0Vk2MIJZQiEWMYBPAEAxllvXhMZjx5yGxBcadLb0t9iA0Fm ZnPojYW2P6uT0ws= =eN9x -----END PGP SIGNATURE----- --------------6goxKr2BsWNzD5hKx6c82YLb-- From unknown Sun Aug 17 01:51:40 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#58136] [PATCH] ui: Improve sort order when searching package names. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 01 Oct 2022 21:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58136 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: zimoun Cc: 58136@debbugs.gnu.org, Lars-Dominik Braun Received: via spool by 58136-submit@debbugs.gnu.org id=B58136.166466058612026 (code B ref 58136); Sat, 01 Oct 2022 21:44:02 +0000 Received: (at 58136) by debbugs.gnu.org; 1 Oct 2022 21:43:06 +0000 Received: from localhost ([127.0.0.1]:45785 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oekGI-00037u-79 for submit@debbugs.gnu.org; Sat, 01 Oct 2022 17:43:06 -0400 Received: from eggs.gnu.org ([209.51.188.92]:59182) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oekGG-00037Q-I1 for 58136@debbugs.gnu.org; Sat, 01 Oct 2022 17:43:04 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:43310) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oekGA-0006fQ-29; Sat, 01 Oct 2022 17:42:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=NZPie+A1d6iTPeV+dpzLtwoGzl1JPNTevesa09OpInw=; b=cS2n5+iVAYzmUje2hZCo gvmixUm/lpgaxXnd8KGumpl4eiKpW72BEOVPz5yrAaSz2lhOL+Je+xXyqjER2Mf/lVp8sQjyiDQnX CXRerDKTVOGDpEbUOCo/6P5wv8/aGjokeId0bFYh7MXRDUUgbAHHNh34WY3O+1cK5QlgIqCedpcvh h+g+S8s6K22AwZD1SxVo/nlfjC369A2dqgWuvAZ8wkA6mbJLw+CRezKy4/3znz9hUVP0UWoJUNZFR 7BKF3IeMt7RoB9VurBsz1CzVnZTg/LL5T8fDRfpQOLKSzlv5hOjMn5mCz9fz8xPI4SFseDiJXib0i MTa08m+UoDcFnQ==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:60260 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oekG9-0002Z5-Es; Sat, 01 Oct 2022 17:42:57 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <86wn9na82p.fsf@gmail.com> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: =?UTF-8?Q?D=C3=A9cadi?= 10 =?UTF-8?Q?Vend=C3=A9miaire?= an 231 de la =?UTF-8?Q?R=C3=A9volution,?= jour de la Cuve X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Sat, 01 Oct 2022 23:42:54 +0200 In-Reply-To: <86wn9na82p.fsf@gmail.com> (zimoun's message of "Wed, 28 Sep 2022 16:26:38 +0200") Message-ID: <87v8p3b4pt.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, zimoun skribis: > Well, I propose something like see below (based on your patch): > > 1. keep the weight as 4 > 2. set the =E2=80=9Cnamespace=E2=80=9D weight to 1 (or 2 if you prefer) > > Otherwise, for example, generic name as CSV could artificially bump > the relevance and hide relevant packages. For instance, compare > > guix search csv > > 3. use upstream-name if provided Maybe something like: (define %package-metrics `((,package-name . 4) (,package-upstream-name* . 4) ;or a lower weight, dunno =E2=80=A6)) where: (define (package-upstream-name* package) (or (assoc-ref (package-properties package) 'upstream-name) (package-name-sans-namespace package))) ;strip "r-", "emacs-", etc. WDYT? (Perhaps =E2=80=98package-upstream-name=E2=80=99 could be taught about thes= e implicit name conversions done for R, Python, Emacs, etc.?) Ludo=E2=80=99. From unknown Sun Aug 17 01:51:40 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#58136] [PATCH] ui: Improve sort order when searching package names. Resent-From: zimoun Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 02 Oct 2022 09:05:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58136 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: Lars-Dominik Braun , 58136@debbugs.gnu.org Received: via spool by 58136-submit@debbugs.gnu.org id=B58136.166470147213686 (code B ref 58136); Sun, 02 Oct 2022 09:05:01 +0000 Received: (at 58136) by debbugs.gnu.org; 2 Oct 2022 09:04:32 +0000 Received: from localhost ([127.0.0.1]:46269 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oeutj-0003Yg-Vy for submit@debbugs.gnu.org; Sun, 02 Oct 2022 05:04:32 -0400 Received: from mail-wr1-f43.google.com ([209.85.221.43]:40893) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oeuti-0003YT-39 for 58136@debbugs.gnu.org; Sun, 02 Oct 2022 05:04:30 -0400 Received: by mail-wr1-f43.google.com with SMTP id w18so4060850wro.7 for <58136@debbugs.gnu.org>; Sun, 02 Oct 2022 02:04:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:from:to:cc:subject:date; bh=Nd+OB9e1+bveulQgSSYC4UeyobiYmW5QjT8Wqvdfssc=; b=f4skjdU15iLyhjckbCf+WsHaJ5SH0dNNCxjDRAXJGWLRNa4gzVuan0ASMEyRj4itid jKh8kHSpvXsI/6zl+rbpTof0eq+aNYMS4B5xzNhE4Fomy4VBp1iT58zp+EjvZtAU3bmY Xd5G2PmEKwo172iQFxagErBRlEEipavUUHhk9sNtrf0v7/NE7Y9iI02M6IOHU0i+ijZm /FbRxhBtGqtQu/G9iWkJ1UE1OupYacYDDeTZs2th7WNl7CYsrPgPtI1IMkgf4xRb9dDt 7siUmOus4JtUGomLz4jDl8D3hXSNbtLd/HZ/JyeIBkKVQIH9oxpV/oPNjD7FwZZce/eE K+Vg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=Nd+OB9e1+bveulQgSSYC4UeyobiYmW5QjT8Wqvdfssc=; b=zaPXViPXWZ9si+fbzXVYgC/F5Bds76cQ1itQrxNzBWo3qe0MKNWazZNjrgWRM7Mr8w qoMwBbDfhD3lookmF2DfBtoGHRygTKTjGso+tuHJ6dcW6LifKqc2elGDdHvb/uWlVVI8 c3pFua94D9xJqjIAnmcaz7nNm852F7mkw4tnpNWl3U8i8NWeMU0Y62gZMUbPZ/+c+fLc moZ47poDJ4RJ/le0WGizBE3QTJT4P0XgwvTaTWzWtxe6q9r5/A94xlRUF43QPawEYtrM TaFgdzvsWcy0hAwakWK2K7OCxkGAjMOwH9OJm1/x9AprZm7Balfp3IGSYyIO0g/Li/cv itaQ== X-Gm-Message-State: ACrzQf3vV1UCZ94tv2qnCVxln7HZCQcUP3kKvYAny342Cpx2KaulLhEd 0QwWk6+JBUrGKaFfzqJflLU= X-Google-Smtp-Source: AMsMyM5Or/IAy11k0EOHchpk/zt5y20UHzwy+A1f03P4VtLnIVl6W0rylxdUWtkxMZmFRRv6wg43Pg== X-Received: by 2002:adf:d0d0:0:b0:22d:f735:4730 with SMTP id z16-20020adfd0d0000000b0022df7354730mr6136288wrh.297.1664701464134; Sun, 02 Oct 2022 02:04:24 -0700 (PDT) Received: from lili ([2a01:e0a:59b:9120:65d2:2476:f637:db1e]) by smtp.gmail.com with ESMTPSA id bh14-20020a05600c3d0e00b003b47575d304sm10582562wmb.32.2022.10.02.02.04.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Oct 2022 02:04:23 -0700 (PDT) From: zimoun In-Reply-To: <87v8p3b4pt.fsf@gnu.org> References: <86wn9na82p.fsf@gmail.com> <87v8p3b4pt.fsf@gnu.org> Date: Sun, 02 Oct 2022 10:26:26 +0200 Message-ID: <868rly3a31.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi, On Sat, 01 Oct 2022 at 23:42, Ludovic Court=C3=A8s wrote: > (define (package-upstream-name* package) > (or (assoc-ref (package-properties package) 'upstream-name) > (package-name-sans-namespace package))) ;strip "r-", "emacs-", e= tc. I think it is better to rely on =E2=80=99package-upstream-name=E2=80=99 and= hides the plumbing. It helps when something needs to be =E2=80=9Crefactored=E2=80=9C= , IMHO. > (Perhaps =E2=80=98package-upstream-name=E2=80=99 could be taught about th= ese implicit > name conversions done for R, Python, Emacs, etc.?) Maybe, but it requires to scrutinize importer per importer since upstream name is mainly used by these, IIUC. Cheers, simon From unknown Sun Aug 17 01:51:40 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#58136] [PATCH] ui: Improve sort order when searching package names. Resent-From: Lars-Dominik Braun Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 12 Oct 2022 11:25:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58136 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: zimoun Cc: ludo@gnu.org, 58136@debbugs.gnu.org Received: via spool by 58136-submit@debbugs.gnu.org id=B58136.1665573858931 (code B ref 58136); Wed, 12 Oct 2022 11:25:01 +0000 Received: (at 58136) by debbugs.gnu.org; 12 Oct 2022 11:24:18 +0000 Received: from localhost ([127.0.0.1]:55899 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oiZqU-0000Ex-0U for submit@debbugs.gnu.org; Wed, 12 Oct 2022 07:24:18 -0400 Received: from mail-wr1-f51.google.com ([209.85.221.51]:34467) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oiZqS-0000El-2v for 58136@debbugs.gnu.org; Wed, 12 Oct 2022 07:24:16 -0400 Received: by mail-wr1-f51.google.com with SMTP id b4so25784466wrs.1 for <58136@debbugs.gnu.org>; Wed, 12 Oct 2022 04:24:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leibniz-psychology-org.20210112.gappssmtp.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=MrfnaiYkrXg/oz6p3rCZ467AMtTMt5CjEXJzoyzHU1M=; b=O2MTMSq+BPERh4/auVY34PTalkgEcPEzJpiGeT3xWzcJRMGbQSWDZOxUWGNRx0EPVT mYMJyFXvsMBZt6CXlErY7eM3Asz4ZwxIxnUxghv6nfiMv3XLriOegX2Ul2XjTUkL8ak0 Zvt4i1JMq4ihKubYgI+rW1198W/7pWOEGeIcBUjv+cL5g24TwKhKNe4ezB5y41l0TpN+ bE0DhmuSMLdR4D3kpX9X3vOQLn+BQAngWotdlf1x93sMImdkiJPWzD341kis/cjium5Q qNGrpGA0lCc5QLriBqwB3CmwRvwfwHPYlwfDbMRsWA/8cWHKScg/zXjuZSnDoM8zgKwm JW/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=MrfnaiYkrXg/oz6p3rCZ467AMtTMt5CjEXJzoyzHU1M=; b=6bVH05uMy9+is01b7JgjWviHRwCI+2Tcgw8IeHnLJ0C2mk4Mdr1BmELO97tsHb1pTP daj4wjky2/8mOy63PRFYpcp/wWPzBkwgaogx3GRhp40XyNMzr7e27QxCTZc6zfBepZ+O rtPrNBNXQXnTJsYSRQcdLLxKf9ZGqFjQoR0opzsZvAUPbGM7oB4Dt9P/yaKZUgK3DKAX Xf68HlOpEVMlXAyf0nyWP3sLk2Gn9ZUA2NL1Q0HLad93QM2cjIvMKzqe3epqJqogjb3Z oLBNLKPf3eOwFL19ayiiika26/nOph6TZoGi1p54/lY/2Cnccxc+RnOrmtOAtohca6Pf abmQ== X-Gm-Message-State: ACrzQf2s40Yf3BnJQTFZDkOc10yXThga9dG342P0yVNUxdSLB2Zfm31H EbCLab6FT5p0irevn38y7HEDJJxr3BIw3n+xa/T5kRuPhyyr3w6EAreJ3WLvS3O76l5rIbNoRvm dPLrW8bfxHBP2TU3b3lUsyS8Hwg2yf4irlnRkxMnUbISKY+YwGacXMG0rYokC3g3OeS70zFfDtH 7UbHE= X-Google-Smtp-Source: AMsMyM48etzAk6iiUFVBA50abfDNao+EMp5IfPQoQJfkVDkVsAKIV06BVALMRyk62GGJOUDb7N6K0w== X-Received: by 2002:a05:6000:788:b0:22e:412b:7959 with SMTP id bu8-20020a056000078800b0022e412b7959mr17943239wrb.491.1665573849958; Wed, 12 Oct 2022 04:24:09 -0700 (PDT) Received: from localhost (opensense.uni-trier.de. [136.199.1.50]) by smtp.gmail.com with ESMTPSA id g17-20020a05600c001100b003c6bbe910fdsm1877617wmc.9.2022.10.12.04.24.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Oct 2022 04:24:09 -0700 (PDT) Date: Wed, 12 Oct 2022 13:24:08 +0200 From: Lars-Dominik Braun Message-ID: References: <86wn9na82p.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="1WUFmoobFniE+iSj" Content-Disposition: inline In-Reply-To: <86wn9na82p.fsf@gmail.com> X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --1WUFmoobFniE+iSj Content-Type: multipart/mixed; boundary="6l9BvxkPFUTZKg+P" Content-Disposition: inline --6l9BvxkPFUTZKg+P Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi simon, > In addition to your proposal which LGTM, maybe we could also use the > =E2=80=99upstream-name=E2=80=99 properties. Most of the time, the Guix n= ame matches the > upstream name, but sometimes not. Although, it would not fix the issue > for ggplot2 since there is no upstream-name for this package. :-) I agree that using the upstream-name would be a good idea. > 2. set the =E2=80=9Cnamespace=E2=80=9D weight to 1 (or 2 if you prefer) >=20 > Otherwise, for example, generic name as CSV could artificially bump > the relevance and hide relevant packages. For instance, compare >=20 > guix search csv The issue here is we don=E2=80=99t know what the user is searching for. If = we add more weight to the package name then usually libraries (rust-csv, ghc-csv, =E2=80=A6) win. Imo a search for =E2=80=9Ccsv=E2=80=9D should retu= rn tools to manipulate CSV files like csvkit, csvdiff, xlsx2csv, =E2=80=A6 Just like =E2=80=9Cjson=E2=80=9D should yield tools like jq, json.sh and possibly oth= ers which I cannot find right now. But maybe I=E2=80=99m searching for a C library th= at parses CSV instead. And then what=E2=80=A6? As for ggplot2, the particular issue seems to be that scores are added for each match and the description for some of our packages contains =E2=80=9Cggplot2=E2=80=9D alot. So I tried using MAX instead of +, which wo= rks, but results in little variation of scores and thus weird sort order (descending by name). It does not feel like an improvement either. Cheers, Lars --=20 Lars-Dominik Braun Wissenschaftlicher Mitarbeiter/Research Associate www.leibniz-psychology.org ZPID - Leibniz-Institut f=C3=BCr Psychologie / ZPID - Leibniz Institute for Psychology Universit=C3=A4tsring 15 D-54296 Trier - Germany Tel.: +49=E2=80=93651=E2=80=93201-4964 --6l9BvxkPFUTZKg+P Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="v2.patch" Content-Transfer-Encoding: quoted-printable diff --git a/guix/packages.scm b/guix/packages.scm index 94e464cd01..9934501cdb 100644 --- a/guix/packages.scm +++ b/guix/packages.scm @@ -86,6 +86,7 @@ (define-module (guix packages) this-package package-name package-upstream-name + package-upstream-name* package-version package-full-name package-source @@ -657,6 +658,38 @@ (define (package-upstream-name package) (or (assq-ref (package-properties package) 'upstream-name) (package-name package))) =20 +(define (package-upstream-name* package) + "Return the upstream name of PACKAGE, which could be different from the = name +it has in Guix." + (let ((namespaces (list "cl-" + "ecl-" + "emacs-" + "ghc-" + "go-" + "guile-" + "java-" + "julia-" + "lua-" + "minetest-" + "node-" + "ocaml-" + "perl-" + "python-" + "r-" + "ruby-" + "rust-" + "sbcl-" + "texlive-")) + (name (package-name package))) + (or (assq-ref (package-properties package) 'upstream-name) + (let loop ((prefixes namespaces)) + (match prefixes + ('() name) + ((prefix rest ...) + (if (string-prefix? prefix name) + (substring name (string-length prefix)) + (loop (cdr prefixes))))))))) + (define (hidden-package p) "Return a \"hidden\" version of P--i.e., one that 'fold-packages' and th= us, user interfaces, ignores." diff --git a/guix/ui.scm b/guix/ui.scm index dad2b853ac..da16a50f9f 100644 --- a/guix/ui.scm +++ b/guix/ui.scm @@ -1623,10 +1623,23 @@ (define (relevance obj regexps metrics) (define (score regexp str) (fold-matches regexp str 0 (lambda (m score) - (+ score - (if (string=3D? (match:substring m) str) - 5 ;exact match - 1))))) + (let* ((start (- (match:start m) 1)) + (end (match:end m)) + (left (if (>=3D start 0) (string-ref str start)= #f)) + (right (if (< end (string-length str)) (string-= ref str end) #f)) + (delimiter-classes '(Cc Cf Pd Pe Pf Pi Po Ps Sk= Zs Zl Zp)) + (delim-left (or (member (and=3D> left char-gene= ral-category) delimiter-classes) (eq? left #f))) + (delim-right (or (member (and=3D> right char-ge= neral-category) delimiter-classes) (eq? right #f)))) + (max score + (cond + ;; regexp is a full match for str. + ((and (eq? left #f) (eq? right #f)) 4) + ;; regexp matches a single word in str. + ((and delim-left delim-right) 3) + ;; regexp matches the beginning or end of a word= in str. + ((or delim-left delim-right) 2) + ;; Everything else. + (#t 1))))))) =20 (define (regexp->score regexp) (let ((score-regexp (lambda (str) (score regexp str)))) @@ -1635,10 +1648,11 @@ (define (regexp->score regexp) ((field . weight) (match (field obj) (#f relevance) + ('() relevance) ((? string? str) - (+ relevance (* (score-regexp str) weight))) + (max relevance (* (score-regexp str) weight))) ((lst ...) - (+ relevance (* weight (apply + (map score-regexp lst)= )))))))) + (max relevance (* weight (apply max (map score-regexp = lst))))))))) 0 metrics))) =20 (let loop ((regexps regexps) @@ -1655,7 +1669,8 @@ (define (regexp->score regexp) (define %package-metrics ;; Metrics used to compute the "relevance score" of a package against a = set ;; of regexps. - `((,package-name . 4) + `((,package-name . 5) + (,package-upstream-name* . 1) =20 ;; Match against uncommon outputs. (,(lambda (package) --6l9BvxkPFUTZKg+P-- --1WUFmoobFniE+iSj Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCAAdFiEEyk+M9DfXR4/aBV/UQhN3ARo3hEYFAmNGo8wACgkQQhN3ARo3 hEba5gv+ILcz/1yKN1+6IUZ4SaSfwURreKttay/0O7uTVddFMAfOmkryx4SOfLoN 0fpmhpJ93nF7TYkaUBelvTSOmrb0bZa63OgxfOxLc4DoDRjAY+F7bY2Oa9HvRM1r dCuHh/Fob7JvVFy9Z8jA5iqmnICrUcNgJnh1TI8xNybY+g+1nvLhyKwWH5+ZjtDt J9r60nDeisxk8Dkoub3mxJbILBymjscviPWRoA0iwY0//KZv3JIRl4ICufqGMil0 S2TkL5vpzVYtCLfhyvv33rKNkXjj5bHGy6Cy94psVkVo3v0wIf5JS5mJGpYv3wEP wTp74j7dd1wnZgwhjlK3hUXBnm/vwBPOJxTYdH0VGUjxmqFcGJ7Hm6tYWv++3Zbz x5BK6l3dgXCNgcNf5yUShRncpVLHyeOnjQ/Lv6i64pKaPxRpVkCXO66uyTpc+lgq WDLbjmKjq8nTiokwfRtFMNspwjquhlju4C5NXsM21WQJ916TOotSRmVlONKQvdh4 whHkNPMm =Ji6J -----END PGP SIGNATURE----- --1WUFmoobFniE+iSj-- From unknown Sun Aug 17 01:51:40 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#58136] [PATCH] ui: Improve sort order when searching package names. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 17 Oct 2022 07:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58136 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Lars-Dominik Braun Cc: 58136@debbugs.gnu.org, zimoun Received: via spool by 58136-submit@debbugs.gnu.org id=B58136.166599280611159 (code B ref 58136); Mon, 17 Oct 2022 07:47:02 +0000 Received: (at 58136) by debbugs.gnu.org; 17 Oct 2022 07:46:46 +0000 Received: from localhost ([127.0.0.1]:47095 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1okKpi-0002tu-Ak for submit@debbugs.gnu.org; Mon, 17 Oct 2022 03:46:46 -0400 Received: from eggs.gnu.org ([209.51.188.92]:41758) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1okKpY-0002tU-Qv for 58136@debbugs.gnu.org; Mon, 17 Oct 2022 03:46:44 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:44680) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1okKpT-0004AV-Dx; Mon, 17 Oct 2022 03:46:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=pfGgB/5PdQvGBe2B8ocanGYNcy8t+NYFsPmYNLL4jeA=; b=EkQshrDvSmJzP5THnbTf yqZFTUsBzYhjOpwYTcOhJZhC0GgEO1qem+mTaMXHRf7Pgx3r/FMn69X/4cqpPgxYVftwAgoaio2lS muZ/Fph9hgSBy1EVPm1TUL+qHO228rwK+DVnzujY/2PvVdc0FDccDaD1sg0VO664mjV0ID614FlcW SZD7YqesceN6GQ8Z9axRcmaZnct+wYkq3riUncJOqCXgMyrsjdDocWhwmqjWeUKTs5P39xs5SHBvl CBsQBvNmlttce/nMFASx+oz5uoZpWHf1c5Jam9nJE7ay2nPDCKV3pHwtC4oYFkCRzzoneTbP1sKmc 92BIUf3VkgClCQ==; Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=52172 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1okKpS-0007dy-Oj; Mon, 17 Oct 2022 03:46:30 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <86wn9na82p.fsf@gmail.com> Date: Mon, 17 Oct 2022 09:46:28 +0200 In-Reply-To: (Lars-Dominik Braun's message of "Wed, 12 Oct 2022 13:24:08 +0200") Message-ID: <8735bmj3jf.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi! Lars-Dominik Braun skribis: > diff --git a/guix/packages.scm b/guix/packages.scm > index 94e464cd01..9934501cdb 100644 > --- a/guix/packages.scm > +++ b/guix/packages.scm > @@ -86,6 +86,7 @@ (define-module (guix packages) > this-package > package-name > package-upstream-name > + package-upstream-name* > package-version > package-full-name > package-source > @@ -657,6 +658,38 @@ (define (package-upstream-name package) > (or (assq-ref (package-properties package) 'upstream-name) > (package-name package))) >=20=20 > +(define (package-upstream-name* package) > + "Return the upstream name of PACKAGE, which could be different from th= e name > +it has in Guix." s/which could.*Guix/accounting for commonly-used package name prefixes in addition to the @code{upstream-name} property/ Preferably make this addition in a separate commit. > +++ b/guix/ui.scm > @@ -1623,10 +1623,23 @@ (define (relevance obj regexps metrics) > (define (score regexp str) > (fold-matches regexp str 0 > (lambda (m score) > - (+ score > - (if (string=3D? (match:substring m) str) > - 5 ;exact match > - 1))))) > + (let* ((start (- (match:start m) 1)) > + (end (match:end m)) > + (left (if (>=3D start 0) (string-ref str star= t) #f)) > + (right (if (< end (string-length str)) (strin= g-ref str end) #f)) > + (delimiter-classes '(Cc Cf Pd Pe Pf Pi Po Ps = Sk Zs Zl Zp)) > + (delim-left (or (member (and=3D> left char-ge= neral-category) delimiter-classes) (eq? left #f))) > + (delim-right (or (member (and=3D> right char-= general-category) delimiter-classes) (eq? right #f)))) > + (max score > + (cond > + ;; regexp is a full match for str. > + ((and (eq? left #f) (eq? right #f)) 4) > + ;; regexp matches a single word in str. > + ((and delim-left delim-right) 3) > + ;; regexp matches the beginning or end of a wo= rd in str. > + ((or delim-left delim-right) 2) > + ;; Everything else. > + (#t 1))))))) The intent is to have all regexps behave as if the user passed \, is that right? Would be nice to have a comment clarifying that above and perhaps making it a separate change? Stylistic notes: (if cond consequent #f) =3D> (and cond consequent) (eq? x #f) =3D> (not x) (cond =E2=80=A6 (#t x)) =3D> (cond =E2=80=A6 (else x)) > @@ -1635,10 +1648,11 @@ (define (regexp->score regexp) > ((field . weight) > (match (field obj) > (#f relevance) > + ('() relevance) > ((? string? str) > - (+ relevance (* (score-regexp str) weight))) > + (max relevance (* (score-regexp str) weight))) > ((lst ...) > - (+ relevance (* weight (apply + (map score-regexp ls= t))))))))) > + (max relevance (* weight (apply max (map score-regex= p lst))))))))) Intuitively I would expect scores to add up, otherwise we=E2=80=99re kinda losing information; so I would not make this change. WDYT? There=E2=80=99s a test for =E2=80=98package-relevance=E2=80=99 in tests/ui.= scm. Please make sure it still passes and ideally add relevant tests such as the CSV example you gave. Thanks! Ludo=E2=80=99. From unknown Sun Aug 17 01:51:40 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#58136] [PATCH] ui: Improve sort order when searching package names. Resent-From: zimoun Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 17 Oct 2022 09:31:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58136 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= , Lars-Dominik Braun Cc: 58136@debbugs.gnu.org Received: via spool by 58136-submit@debbugs.gnu.org id=B58136.166599906231514 (code B ref 58136); Mon, 17 Oct 2022 09:31:03 +0000 Received: (at 58136) by debbugs.gnu.org; 17 Oct 2022 09:31:02 +0000 Received: from localhost ([127.0.0.1]:47353 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1okMSb-0008C5-P5 for submit@debbugs.gnu.org; Mon, 17 Oct 2022 05:31:02 -0400 Received: from mail-wr1-f53.google.com ([209.85.221.53]:37669) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1okMSZ-0008BT-TH for 58136@debbugs.gnu.org; Mon, 17 Oct 2022 05:31:00 -0400 Received: by mail-wr1-f53.google.com with SMTP id bv10so17542516wrb.4 for <58136@debbugs.gnu.org>; Mon, 17 Oct 2022 02:30:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:from:to:cc:subject:date:message-id :reply-to; bh=VfVCgzLqrQhC1RNY/hKcagmFjrRM9+sW94Z0a3X+t8c=; b=iawhRgG+XA4JA1ATykC2j670ztAUV1khHpqbXKeMJkJd7EEcfKVWn9EbMKwZLBk5MG cHaGx+T1NEIWBfFE2mEy24NhOgQzNwjOkbM8BUTsVKG9b4mPu8OYIhWhSBqbEbuLXckH Vk9v8jb7GHMRweCb4lrHEeMPpIfbtcGLx7J0LR8JNVVX7MwPp/qc4bqT474P+zqvqvBS 3kCsaclLGrc/bgILL9kyuHVrHTnT6EzccLQ76bmrMNc2iW9LC9IA88/W8ZNx6rVB5yh5 rwt4Kve1XJ9HJEOTRMBPHi++AYIRf7xPOQn7kG8W5z2a+EKXchwlh08ShEtzdGrcYzA2 dvWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VfVCgzLqrQhC1RNY/hKcagmFjrRM9+sW94Z0a3X+t8c=; b=lBBS4hBUPo3HdUiQ/adHjOWj+UynAwA2DJ6kcBDK+8txXoox7zlE8GlRFS3DgqnuRw kvgLsWrDxhkTqeeuNS6OOZvgtkGcsvR11pIfVXDxIdsA3HQ0Jc8q2Pe48axyEwqcSrDe lbWhTad3gLARb5vIOpEA61ohuxY+uFIwDqKdDKvErq+MU8R54/AY8izF09zQ4lwi3tkO TokdLuui9ohTRCVOseGv8UwobfFCXnIk8cyyBJi0a1NSSmL3S9F6eyMCZ3NszNwNQ7cQ N6HzEox+tr4sGOMbYEQwAg3I+wvu6WFxHquy6ItpdJPA4gQ5fNHLI68MVIox2iKZJdxH eVDA== X-Gm-Message-State: ACrzQf0LqibEg8Owd2FIKx/7+NErLhS3tVACxrZ3FSSHkzcVc9sKMGuD AwaKVSNVy0LLH6ep9pjTjb2LreN3/5I= X-Google-Smtp-Source: AMsMyM6qLZm7IBZekR6zuzYQ61NJfFZ5mGjCrZBhoq7S1qxAKSpvjpDgYZRv8WicNOFgBD2SfTBdcg== X-Received: by 2002:adf:ec83:0:b0:22e:51e2:7fc7 with SMTP id z3-20020adfec83000000b0022e51e27fc7mr5449865wrn.229.1665999053790; Mon, 17 Oct 2022 02:30:53 -0700 (PDT) Received: from pfiuh07 ([193.48.40.241]) by smtp.gmail.com with ESMTPSA id y3-20020a7bcd83000000b003b492753826sm9461298wmj.43.2022.10.17.02.30.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Oct 2022 02:30:53 -0700 (PDT) From: zimoun In-Reply-To: <8735bmj3jf.fsf_-_@gnu.org> References: <86wn9na82p.fsf@gmail.com> <8735bmj3jf.fsf_-_@gnu.org> Date: Mon, 17 Oct 2022 10:19:48 +0200 Message-ID: <877d0yoo9n.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Lars, Ludo, In short, I miss why the initial patch with a minor tweak is not enough for covering the corner cases. :-) On lun., 17 oct. 2022 at 09:46, Ludovic Court=C3=A8s wrote: >> +++ b/guix/ui.scm >> @@ -1623,10 +1623,23 @@ (define (relevance obj regexps metrics) >> (define (score regexp str) >> (fold-matches regexp str 0 >> (lambda (m score) >> - (+ score >> - (if (string=3D? (match:substring m) str) >> - 5 ;exact match >> - 1))))) >> + (let* ((start (- (match:start m) 1)) >> + (end (match:end m)) >> + (left (if (>=3D start 0) (string-ref str sta= rt) #f)) >> + (right (if (< end (string-length str)) (stri= ng-ref str end) #f)) >> + (delimiter-classes '(Cc Cf Pd Pe Pf Pi Po Ps= Sk Zs Zl Zp)) >> + (delim-left (or (member (and=3D> left char-g= eneral-category) delimiter-classes) (eq? left #f))) >> + (delim-right (or (member (and=3D> right char= -general-category) delimiter-classes) (eq? right #f)))) >> + (max score >> + (cond >> + ;; regexp is a full match for str. >> + ((and (eq? left #f) (eq? right #f)) 4) >> + ;; regexp matches a single word in str. >> + ((and delim-left delim-right) 3) >> + ;; regexp matches the beginning or end of a w= ord in str. >> + ((or delim-left delim-right) 2) >> + ;; Everything else. >> + (#t 1))))))) > > The intent is to have all regexps behave as if the user passed \, > is that right? Would be nice to have a comment clarifying that above > and perhaps making it a separate change? All this appears to me overcomplicated. Personally, I have to read it many times to get the logic; while the initial patch was much clearer, IMHO. Other said, I am not convinced the complexity is worth the corner case. The initial patch with the minor tweak I am proposing (maybe using package-upstream-name*) appears to me enough for covering the corner cases initially reported (as ggplot2). >> @@ -1635,10 +1648,11 @@ (define (regexp->score regexp) >> ((field . weight) >> (match (field obj) >> (#f relevance) >> + ('() relevance) >> ((? string? str) >> - (+ relevance (* (score-regexp str) weight))) >> + (max relevance (* (score-regexp str) weight))) >> ((lst ...) >> - (+ relevance (* weight (apply + (map score-regexp l= st))))))))) >> + (max relevance (* weight (apply max (map score-rege= xp lst))))))))) > > Intuitively I would expect scores to add up, otherwise we=E2=80=99re kinda > losing information; so I would not make this change. WDYT? I agree with Ludo that =E2=80=99max=E2=80=99 is counterintuitive. Well, could we list some examples (keyword and expectation)? Because the initial patch with a minor tweak LGTM and covers ggplot2, csv, and some others. Cheers, simon From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 03 11:45:21 2022 Received: (at control) by debbugs.gnu.org; 3 Nov 2022 15:45:21 +0000 Received: from localhost ([127.0.0.1]:50030 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oqcPB-0004wj-FI for submit@debbugs.gnu.org; Thu, 03 Nov 2022 11:45:21 -0400 Received: from mira.cbaines.net ([212.71.252.8]:41660) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oqcPA-0004qp-0y for control@debbugs.gnu.org; Thu, 03 Nov 2022 11:45:20 -0400 Received: from localhost (93-63-133-243.ip27.fastwebnet.it [93.63.133.243]) by mira.cbaines.net (Postfix) with ESMTPSA id 39F9027BBE9 for ; Thu, 3 Nov 2022 15:45:19 +0000 (GMT) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id cfec7e0b for ; Thu, 3 Nov 2022 15:45:18 +0000 (UTC) From: Christopher Baines To: control@debbugs.gnu.org Subject: tag 58136 moreinfo Date: Thu, 03 Nov 2022 15:45:18 +0000 Message-ID: <87mt98xcs1.fsf@cbaines.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tags 58136 + moreinfo quit From unknown Sun Aug 17 01:51:40 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#58136] [PATCH] ui: Improve sort order when searching package names. Resent-From: Lars-Dominik Braun Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 09 Dec 2022 11:50:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58136 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: moreinfo patch To: 58136@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= , zimoun Received: via spool by 58136-submit@debbugs.gnu.org id=B58136.167058659325819 (code B ref 58136); Fri, 09 Dec 2022 11:50:01 +0000 Received: (at 58136) by debbugs.gnu.org; 9 Dec 2022 11:49:53 +0000 Received: from localhost ([127.0.0.1]:35531 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p3bt2-0006iN-OL for submit@debbugs.gnu.org; Fri, 09 Dec 2022 06:49:53 -0500 Received: from mout-p-201.mailbox.org ([80.241.56.171]:37616) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p3bsz-0006iF-Vz for 58136@debbugs.gnu.org; Fri, 09 Dec 2022 06:49:50 -0500 Received: from smtp1.mailbox.org (smtp1.mailbox.org [10.196.197.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-201.mailbox.org (Postfix) with ESMTPS id 4NT8Sz6mkmz9sWF; Fri, 9 Dec 2022 12:49:39 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6xq.net; s=MBO0001; t=1670586579; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=D3UqD+JlhP4kYcsh/KroWdDOdida/vpSp/YG+jYd5Tk=; b=BPkcP1GNuojqZ7AM8WtuAdLOCt85FLpqjXIZwBWwnJWW9/5g5UKK71palcSPV5wmVNHbqv vmlByC6R54iaTTF6P1YyfkEZOPj7+Xukuy4uJIKDuP0LOYB8z+63nfuGjv43ns5M4hS2KL 4bYWBziVvuUqfCpLHnu/B+R1pp7CAIZzJHkBr7sEwRR/euIY1RstaomlOjRZMEnovXNzg4 lGYuZYmyrepCQHg92GdBACPUyBW1yKu8uo9qyrmxof0GP6DPG5vj+WZbIebcAwBXr3vNhO 0fmMaiJlqm3FGAj5NtfIvml5AUTP/faCbs42hYmIt16hoqXBRJRwFmRzZ0QiNA== Date: Fri, 9 Dec 2022 12:49:32 +0100 From: Lars-Dominik Braun Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="wmmVohns9Qrs/GFS" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --wmmVohns9Qrs/GFS Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit Hi, attached is version 2 of my initial patch, which simply moves prefix detection into PACKAGE-UPSTREAM-NAME* (as suggested by Ludo) and reduces the score to 2 (as suggested by Simon). It’s therefore quite tailored to the “ggplot2 problem”, but does the job. Thanks, Lars --wmmVohns9Qrs/GFS Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="0001-packages-Add-package-upstream-name.patch" >From e0092d786b29f4f1cdc35217212a86804f36cdb4 Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Fri, 9 Dec 2022 11:46:37 +0100 Subject: [PATCH v2 1/2] packages: Add 'package-upstream-name*'. * guix/packages.scm (package-upstream-name*): New procedure. * tests/packages.scm ("package-upstream-name*"): New test. --- guix/packages.scm | 33 +++++++++++++++++++++++++++++++++ tests/packages.scm | 4 ++++ 2 files changed, 37 insertions(+) diff --git a/guix/packages.scm b/guix/packages.scm index 8f119d9fa7..5e8e3a4ff4 100644 --- a/guix/packages.scm +++ b/guix/packages.scm @@ -89,6 +89,7 @@ (define-module (guix packages) this-package package-name package-upstream-name + package-upstream-name* package-version package-full-name package-source @@ -691,6 +692,38 @@ (define (package-upstream-name package) (or (assq-ref (package-properties package) 'upstream-name) (package-name package))) +(define (package-upstream-name* package) + "Return the upstream name of PACKAGE, accounting for commonly-used +package name prefixes in addition to the @code{upstream-name} property." + (let ((namespaces (list "cl-" + "ecl-" + "emacs-" + "ghc-" + "go-" + "guile-" + "java-" + "julia-" + "lua-" + "minetest-" + "node-" + "ocaml-" + "perl-" + "python-" + "r-" + "ruby-" + "rust-" + "sbcl-" + "texlive-")) + (name (package-name package))) + (or (assq-ref (package-properties package) 'upstream-name) + (let loop ((prefixes namespaces)) + (match prefixes + ('() name) + ((prefix rest ...) + (if (string-prefix? prefix name) + (substring name (string-length prefix)) + (loop (cdr prefixes))))))))) + (define (hidden-package p) "Return a \"hidden\" version of P--i.e., one that 'fold-packages' and thus, user interfaces, ignores." diff --git a/tests/packages.scm b/tests/packages.scm index a5819d8de3..f58c47817b 100644 --- a/tests/packages.scm +++ b/tests/packages.scm @@ -626,6 +626,10 @@ (define read-at (build-derivations %store (list drv)) (call-with-input-file output get-string-all))) +(test-equal "package-upstream-name*" + (package-upstream-name* (specification->package "guile-gcrypt")) + "gcrypt") + ;;; ;;; Source derivation with snippets. -- 2.37.4 --wmmVohns9Qrs/GFS Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="0002-ui-Take-package-upstream-name-into-account-when-sear.patch" >From 5e0e8c0145a728d0ed49116596f06cc15e1e865d Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Fri, 9 Dec 2022 12:01:31 +0100 Subject: [PATCH v2 2/2] ui: Take package upstream name into account when searching. * guix/ui.scm (%package-metrics): Add PACKAGE-UPSTREAM-NAME*. --- guix/ui.scm | 1 + 1 file changed, 1 insertion(+) diff --git a/guix/ui.scm b/guix/ui.scm index 45eccb7335..3bca3b1e40 100644 --- a/guix/ui.scm +++ b/guix/ui.scm @@ -1668,6 +1668,7 @@ (define %package-metrics ;; Metrics used to compute the "relevance score" of a package against a set ;; of regexps. `((,package-name . 4) + (,package-upstream-name* . 2) ;; Match against uncommon outputs. (,(lambda (package) -- 2.37.4 --wmmVohns9Qrs/GFS-- From unknown Sun Aug 17 01:51:40 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Lars-Dominik Braun Subject: bug#58136: closed (Re: [PATCH] ui: Improve sort order when searching package names.) Message-ID: References: <87fsdjwhyd.fsf@gnu.org> X-Gnu-PR-Message: they-closed 58136 X-Gnu-PR-Package: guix-patches X-Gnu-PR-Keywords: moreinfo patch Reply-To: 58136@debbugs.gnu.org Date: Tue, 13 Dec 2022 13:30:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1670938202-5137-1" This is a multi-part message in MIME format... ------------=_1670938202-5137-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #58136: [PATCH] ui: Improve sort order when searching package names. which was filed against the guix-patches package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 58136@debbugs.gnu.org. --=20 58136: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D58136 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1670938202-5137-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 58136-done) by debbugs.gnu.org; 13 Dec 2022 13:29:12 +0000 Received: from localhost ([127.0.0.1]:60391 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p55LL-0001KH-Ha for submit@debbugs.gnu.org; Tue, 13 Dec 2022 08:29:11 -0500 Received: from eggs.gnu.org ([209.51.188.92]:46902) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p55LJ-0001KA-Le for 58136-done@debbugs.gnu.org; Tue, 13 Dec 2022 08:29:10 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p55LE-0007lv-0Y; Tue, 13 Dec 2022 08:29:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=0zEiJB5GWDAv+h5EX2sE+cVtuU75MQJwSu6JSf4Y7cM=; b=P/ds+KA1QKjbN2XNBlnk DTR9a9F6tVX3MvvvtzMj+2OLtdrz6EUXLKTuz1ExVYRbXI5wwA1piKHRIEUaht1BlB627nvU6iPDS /sgJUtZUONv3Bb6xS6SyVKjDF1nicQS22J38wRQYuSc2rnSEHIEZqnym0sKcl0Z4K4WXbHaRgDmXG H1KXQ40rlaqeZi7z9rlQlKI6EnMCRCppU2Sxz/tvPbjgEEUx5ienmUcea2KYse+m4FmDIspAW7zzR lzX6GKr+R1lqKfblWeeOt4jMimhlXfBCIZ1k9a27OVlBVH0YcgCXF674yKfjil4Fh0y0wN9WIHTGL DCxP6Bp9UkdtIg==; Received: from eduroam-111172.grenet.fr ([130.190.111.172] helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p55LD-0006Z8-EE; Tue, 13 Dec 2022 08:29:03 -0500 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Lars-Dominik Braun Subject: Re: [PATCH] ui: Improve sort order when searching package names. References: X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: Tridi 23 Frimaire an 231 de la =?utf-8?Q?R=C3=A9volu?= =?utf-8?Q?tion=2C?= jour du Roseau X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Tue, 13 Dec 2022 14:28:58 +0100 In-Reply-To: (Lars-Dominik Braun's message of "Fri, 9 Dec 2022 12:49:32 +0100") Message-ID: <87fsdjwhyd.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58136-done Cc: 58136-done@debbugs.gnu.org, zimoun X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi, Lars-Dominik Braun skribis: > From e0092d786b29f4f1cdc35217212a86804f36cdb4 Mon Sep 17 00:00:00 2001 > From: Lars-Dominik Braun > Date: Fri, 9 Dec 2022 11:46:37 +0100 > Subject: [PATCH v2 1/2] packages: Add 'package-upstream-name*'. > > * guix/packages.scm (package-upstream-name*): New procedure. > * tests/packages.scm ("package-upstream-name*"): New test. [...] > From 5e0e8c0145a728d0ed49116596f06cc15e1e865d Mon Sep 17 00:00:00 2001 > From: Lars-Dominik Braun > Date: Fri, 9 Dec 2022 12:01:31 +0100 > Subject: [PATCH v2 2/2] ui: Take package upstream name into account when > searching. > > * guix/ui.scm (%package-metrics): Add PACKAGE-UPSTREAM-NAME*. Applied with the minor changes below, thank you! Ludo=E2=80=99. --=-=-= Content-Type: text/x-patch Content-Disposition: inline diff --git a/guix/packages.scm b/guix/packages.scm index 5e8e3a4ff4..6e61e16aa4 100644 --- a/guix/packages.scm +++ b/guix/packages.scm @@ -718,11 +718,11 @@ (define (package-upstream-name* package) (or (assq-ref (package-properties package) 'upstream-name) (let loop ((prefixes namespaces)) (match prefixes - ('() name) + (() name) ((prefix rest ...) (if (string-prefix? prefix name) (substring name (string-length prefix)) - (loop (cdr prefixes))))))))) + (loop rest)))))))) (define (hidden-package p) "Return a \"hidden\" version of P--i.e., one that 'fold-packages' and thus, --=-=-= Content-Type: text/plain and: --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable diff --git a/tests/ui.scm b/tests/ui.scm index 6a25a204ca..438acae525 100644 --- a/tests/ui.scm +++ b/tests/ui.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright =C2=A9 2013, 2014, 2015, 2016, 2017, 2019, 2020 Ludovic Cour= t=C3=A8s +;;; Copyright =C2=A9 2013-2017, 2019-2020, 2022 Ludovic Court=C3=A8s ;;; Copyright =C2=A9 2022 Taiju HIGASHI ;;; ;;; This file is part of GNU Guix. @@ -294,6 +294,15 @@ (define guile-2.0.9 (>0 (package-relevance libb2 (map rx '("crypto" "library"))))))) =20 +(test-assert "package-relevance and upstream name" + ;; https://issues.guix.gnu.org/58136 + (let ((ggplot2 (specification->package "r-ggplot2")) + (ggstance (specification->package "r-ggstance")) + (rx (make-regexp "ggplot2" regexp/icase))) + (> (package-relevance ggplot2 (list rx)) + (package-relevance ggstance (list rx)) + 0))) + (define (make-empty-file directory file) ;; Create FILE in DIRECTORY. (close-port (open-output-file (in-vicinity directory file)))) --=-=-=-- ------------=_1670938202-5137-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 28 Sep 2022 09:27:56 +0000 Received: from localhost ([127.0.0.1]:60140 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1odTMA-0005Cj-PX for submit@debbugs.gnu.org; Wed, 28 Sep 2022 05:27:55 -0400 Received: from lists.gnu.org ([209.51.188.17]:45830) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1odTM6-0005CV-VI for submit@debbugs.gnu.org; Wed, 28 Sep 2022 05:27:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59710) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odTM6-0000xv-1s for guix-patches@gnu.org; Wed, 28 Sep 2022 05:27:50 -0400 Received: from mout-p-101.mailbox.org ([80.241.56.151]:58070) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256) (Exim 4.90_1) (envelope-from ) id 1odTM1-0001qc-TH for guix-patches@gnu.org; Wed, 28 Sep 2022 05:27:49 -0400 Received: from smtp102.mailbox.org (smtp102.mailbox.org [IPv6:2001:67c:2050:b231:465::102]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-101.mailbox.org (Postfix) with ESMTPS id 4McrkM1kYDz9sm7 for ; Wed, 28 Sep 2022 11:27:39 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6xq.net; s=MBO0001; t=1664357259; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tMDOUhTonqWUQcCDPMYxDx63BpgJ3CHa5CelZbcPYDg=; b=sCR+nBduy+cBdvsiRtWB4HyQnW/VA13h2ekgU2fDPxjwgLvslCLUWp+xb0URrTmBbG7tUI /Czyu5dcK0YgYN3X2vPJL3fVGltW1gXFPC22modthOgVK2LDYxCBwCPEOQEafOVT+Q3fwi wzTrGE3cLKtxsi8PxDwpVxd+/xYWsaMMyooS8LM4K+uEsJHzSfJyjKQHnQrltJNSE6zCcS qmMlPXWZ3QdhKNm8+MnRlyCog1ZxUkaxUPELbyWXM6Dz5nWVZd8xaoM0eh4SUc9k/nVqo1 J1eMkEw5zokOL2yspE9WcZYUPXmk+AEjZp3xNS30ZqEoqkHGkSPUAysWWQqVjg== Date: Wed, 28 Sep 2022 11:27:37 +0200 From: Lars-Dominik Braun To: guix-patches@gnu.org Subject: [PATCH] ui: Improve sort order when searching package names. Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit X-Debbugs-Cc: mail@cbaines.net X-Debbugs-Cc: rekado@elephly.net X-Debbugs-Cc: othacehe@gnu.org X-Debbugs-Cc: ludo@gnu.org X-Rspamd-Queue-Id: 4McrkM1kYDz9sm7 Received-SPF: pass client-ip=80.241.56.151; envelope-from=lars@6xq.net; helo=mout-p-101.mailbox.org X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.6 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.6 (--) Hi, we provide a `guix serach`-based package search to our users and noticed that searching for “ggplot2” yields the package r-ggplot2 on position 11 only – when it should be the first. Looking at other potential search terms (haven, shiny, ape, renv, here, ini, setuptools) reveals similar issues. I propose we also score the unprefixed package name, so SCORE can award bonus points for a full string match. I don’t like that we have to maintain a list of common prefixes for this and that package names are scored twice now, but I can’t think of a better solution right now. Cheers, Lars * guix/ui.scm (%package-metrics): Increase score for PACKAGE-NAME and add score for unprefixed package name. --- guix/ui.scm | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/guix/ui.scm b/guix/ui.scm index dad2b853ac..55b596ed35 100644 --- a/guix/ui.scm +++ b/guix/ui.scm @@ -1655,7 +1655,38 @@ (define (regexp->score regexp) (define %package-metrics ;; Metrics used to compute the "relevance score" of a package against a set ;; of regexps. - `((,package-name . 4) + `((,package-name . 8) + + ;; For packages with a language prefix (namespaces), also compare the + ;; unprefixed name, so searching for “ggplot2” yields + ;; r-ggplot2 as first result instead of other, higher-ranked packages, + ;; which contain “ggplot2” in their description alot. + (,(lambda (package) + (let ((namespaces (list "cl-" + "ecl-" + "emacs-" + "ghc-" + "go-" + "guile-" + "java-" + "julia-" + "node-" + "ocaml-" + "perl-" + "python-" + "r-" + "ruby-" + "rust-" + "sbcl-" + "texlive-")) + (name (package-name package))) + (fold (lambda (prefix accum) + (if (string-prefix? prefix name) + (cons (substring name (string-length prefix)) accum) + accum)) + '() + namespaces))) + . 4) ;; Match against uncommon outputs. (,(lambda (package) -- 2.35.1 ------------=_1670938202-5137-1-- From unknown Sun Aug 17 01:51:40 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#58136] [PATCH] ui: Improve sort order when searching package names. Resent-From: Lars-Dominik Braun Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 13 Dec 2022 14:55:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58136 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: moreinfo patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 58136@debbugs.gnu.org Received: via spool by 58136-submit@debbugs.gnu.org id=B58136.167094324318584 (code B ref 58136); Tue, 13 Dec 2022 14:55:01 +0000 Received: (at 58136) by debbugs.gnu.org; 13 Dec 2022 14:54:03 +0000 Received: from localhost ([127.0.0.1]:60909 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p56fT-0004pg-3J for submit@debbugs.gnu.org; Tue, 13 Dec 2022 09:54:03 -0500 Received: from mout-p-202.mailbox.org ([80.241.56.172]:58222) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p56fP-0004pE-Ku for 58136@debbugs.gnu.org; Tue, 13 Dec 2022 09:54:01 -0500 Received: from smtp102.mailbox.org (smtp102.mailbox.org [IPv6:2001:67c:2050:b231:465::102]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-202.mailbox.org (Postfix) with ESMTPS id 4NWhMc5Fzzz9sSD; Tue, 13 Dec 2022 15:53:48 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6xq.net; s=MBO0001; t=1670943228; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=6sV+NCdngVxiTB0PjklXZWkzTxVqhL55q6kwqeP46x8=; b=aaoYRXw/MLFVz+aw4XVAAUVqt6CZaBqgLm7tUzieIpmWf7DRT7I6O7Fk6YuwT/LIR8Qqps qqhszhjlBVnMQ5nyW4wJCegUIR36JDKZNcSk7bMuSTwLXeU2uQBYSXgHgZHYpzxPb5MEl+ U9wz8+EQn6/XfSNe+bxR84WkhA1h8CU6I0Cov0Iw6rbIJeBzD4XZJxEEfnjIxabrPxpkq0 E4YX5kn2oGIkJSfHGY75PHyuGJL0/umrmerp+4PBrgzl14QT50BQekBbsBcy6axVPuyoF/ jmbq/IRI2vA0GaHAkdEjGYWaxosxEpUyewB8LZ8Dq/NdGoqM+2MH/3uMao4Fyw== Date: Tue, 13 Dec 2022 15:53:41 +0100 From: Lars-Dominik Braun Message-ID: References: <87fsdjwhyd.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87fsdjwhyd.fsf@gnu.org> X-Rspamd-Queue-Id: 4NWhMc5Fzzz9sSD X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Hi Ludo, > Applied with the minor changes below, thank you! thank you! > +(test-assert "package-relevance and upstream name" > + ;; https://issues.guix.gnu.org/58136 > + (let ((ggplot2 (specification->package "r-ggplot2")) > + (ggstance (specification->package "r-ggstance")) > + (rx (make-regexp "ggplot2" regexp/icase))) > + (> (package-relevance ggplot2 (list rx)) > + (package-relevance ggstance (list rx)) > + 0))) I was hesitant to add a system test, which depends on real package descriptions (not synthetic ones), because at some point it *will* break. Cheers, Lars From unknown Sun Aug 17 01:51:40 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#58136] [PATCH] ui: Improve sort order when searching package names. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 13 Dec 2022 16:41:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58136 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: moreinfo patch To: Lars-Dominik Braun Cc: 58136@debbugs.gnu.org Received: via spool by 58136-submit@debbugs.gnu.org id=B58136.167094965223707 (code B ref 58136); Tue, 13 Dec 2022 16:41:01 +0000 Received: (at 58136) by debbugs.gnu.org; 13 Dec 2022 16:40:52 +0000 Received: from localhost ([127.0.0.1]:33270 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p58Kq-0006AJ-Ck for submit@debbugs.gnu.org; Tue, 13 Dec 2022 11:40:52 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48660) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p58Kn-0006AA-8T for 58136@debbugs.gnu.org; Tue, 13 Dec 2022 11:40:51 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p58Kg-0006nU-Et; Tue, 13 Dec 2022 11:40:42 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=Kho8Mu9yAo+6OpyU6synf2XX7pPmvBu0QPL1AKnbVd8=; b=T3aa8L3sRJd9PYzuZ94p yUc/KhsJ2nfD0coThB7l+6b5jK8GHVEdCRLm5hBTnjSaFYCoxgLhi794CJywp3709tjJXYF6PeRX9 dAnTJg8hbvJd0PurxSQPKyCYZahHanzJJ57V/rDQkf0tjkHmIimgQtlsREDhb7Mw2pvmrA/o9rfua nZm0aivXYlAmCdAF5MM/ip/QQWszgpCgvdKsVAt8MAbPOEGJwn55SJd87Ho6bUHqtS3ympRf24xMq 2uK1XDDgtB1Ph3Ca+CIOhCeRgoQHVCcLMeh17dXf+WBNY7RFJbm6hEsz6ZIrVvfTmmH3i9ISo2q3y oh7PkrD8nTohWQ==; Received: from eduroam-111172.grenet.fr ([130.190.111.172] helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p58Kf-0008FS-S1; Tue, 13 Dec 2022 11:40:42 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <87fsdjwhyd.fsf@gnu.org> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: Tridi 23 Frimaire an 231 de la =?UTF-8?Q?R=C3=A9volution,?= jour du Roseau X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Tue, 13 Dec 2022 17:40:36 +0100 In-Reply-To: (Lars-Dominik Braun's message of "Tue, 13 Dec 2022 15:53:41 +0100") Message-ID: <87wn6vuuij.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, Lars-Dominik Braun skribis: >> Applied with the minor changes below, thank you! > thank you! > >> +(test-assert "package-relevance and upstream name" >> + ;; https://issues.guix.gnu.org/58136 >> + (let ((ggplot2 (specification->package "r-ggplot2")) >> + (ggstance (specification->package "r-ggstance")) >> + (rx (make-regexp "ggplot2" regexp/icase))) >> + (> (package-relevance ggplot2 (list rx)) >> + (package-relevance ggstance (list rx)) >> + 0))) > I was hesitant to add a system test, which depends on real package > descriptions (not synthetic ones), because at some point it *will* break. Yes, that=E2=80=99s a tradeoff. For now, I would think the test is a plus = as it will allow us to see if future tweaks break this use case but yeah, on the day it breaks, we=E2=80=99ll have to rewrite it or to drop it. Ludo=E2=80=99.