From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 0D4vCHJ+mGO8HQAAbAwnHQ (envelope-from ) for ; Tue, 13 Dec 2022 14:30:26 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id 6LVfB3J+mGMC9AAAG6o9tA (envelope-from ) for ; Tue, 13 Dec 2022 14:30:26 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id BD2BD1C121 for ; Tue, 13 Dec 2022 14:30:25 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p55ME-00086o-An; Tue, 13 Dec 2022 08:30:06 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p55MA-00086V-SZ for guix-patches@gnu.org; Tue, 13 Dec 2022 08:30:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p55MA-0001W3-JQ for guix-patches@gnu.org; Tue, 13 Dec 2022 08:30:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p55MA-0001L3-D5 for guix-patches@gnu.org; Tue, 13 Dec 2022 08:30:02 -0500 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-To: guix-patches@gnu.org Resent-Date: Tue, 13 Dec 2022 13:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 58136 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: moreinfo patch To: Lars-Dominik Braun Cc: 58136-done@debbugs.gnu.org, zimoun Mail-Followup-To: 58136@debbugs.gnu.org, ludo@gnu.org, lars@6xq.net Received: via spool by 58136-done@debbugs.gnu.org id=D58136.16709381525105 (code D ref 58136); Tue, 13 Dec 2022 13:30:02 +0000 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: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: 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 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1670938225; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:resent-to:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=0zEiJB5GWDAv+h5EX2sE+cVtuU75MQJwSu6JSf4Y7cM=; b=n+3Re+Oltjyk0Je3q9N4tkV929a4VezHKz/4P7IRHHUDeFoYCIby6sU1s31wOYjeypm5ZP uQXS0UDaxfhHXu1tmlxl2Df9kMaHsy5PHr0w2JVuVU/hbYuQF51BCy+c1Wk0G/YGdMcDIT WUgmEWebVwXMfG0vHnakEEjwjaoxQCYMCW/1pKO9XYoIyZ4jllF2oMf+XBnkoRwNuYGhqL PJwSj0zeOQUu8aURts73i73iAvWHqxINDhkKfBBEASbe4sZXThQ9MSw/wyop7D+nky5CJE ZvwDaaqfF60rKIbjnOupUeaFY7HCQ0XxXM0/hmnymad0xW60anEWH7CxoMKceQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b="P/ds+KA1"; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Seal: i=1; s=key1; d=yhetil.org; t=1670938225; a=rsa-sha256; cv=none; b=VbNAyv75Xa62c/H0m3irDyEVGLNAMReuIKNTQShgqNZ0LVJl1i5GEowZg9tDKZe5PNs19v s2lj3lR0G9zzQCapAAE6+ESMjJgZrE9Zmxjq440R4rWl+4kG1a/TyzjnaqWCjPy7ZKGFFd ifW4DtQ84mX1Tda+78kNb4WzbcMmubJNiAasn40LyOBl4mHu6qLLiX3aEWQMMf84+HQOMn mMkNtKOOmWDqC9RizIXHeToVlGX5EXWEyYjNqzjvAGRBttnvekQ3cLB0euyXhe/Y6ZEr1J jlb6k58Ep9vBBEnlvKI5bK37ZQ8FNS6ESgNjQodqMhanDNRS2zpvLto4wNfu3w== X-Migadu-Spam-Score: -2.37 X-Spam-Score: -2.37 X-Migadu-Queue-Id: BD2BD1C121 X-Migadu-Scanner: scn1.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b="P/ds+KA1"; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org X-TUID: OOLD11I758SW --=-=-= 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)))) --=-=-=--