From patchwork Mon Jun 1 00:00:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arun Isaac X-Patchwork-Id: 22487 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 3333C27BBE3; Mon, 1 Jun 2020 01:01:23 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,T_DKIM_INVALID, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 983A627BBE1 for ; Mon, 1 Jun 2020 01:01:21 +0100 (BST) Received: from localhost ([::1]:37434 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jfXtI-0002tW-WE for patchwork@mira.cbaines.net; Sun, 31 May 2020 20:01:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38228) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jfXt0-0002jw-Sc for guix-patches@gnu.org; Sun, 31 May 2020 20:01:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:50796) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jfXt0-0005zu-IL for guix-patches@gnu.org; Sun, 31 May 2020 20:01:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jfXt0-0003aY-HH for guix-patches@gnu.org; Sun, 31 May 2020 20:01:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#39258] [PATCH 1/4] ui: Cut off search early if any regexp does not match. Resent-From: Arun Isaac Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 01 Jun 2020 00:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39258 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: 39258@debbugs.gnu.org Cc: Arun Isaac Received: via spool by 39258-submit@debbugs.gnu.org id=B39258.159096964013732 (code B ref 39258); Mon, 01 Jun 2020 00:01:02 +0000 Received: (at 39258) by debbugs.gnu.org; 1 Jun 2020 00:00:40 +0000 Received: from localhost ([127.0.0.1]:34102 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jfXse-0003ZK-Fg for submit@debbugs.gnu.org; Sun, 31 May 2020 20:00:40 -0400 Received: from mugam.systemreboot.net ([139.59.75.54]:37184) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jfXsa-0003Yh-Hb for 39258@debbugs.gnu.org; Sun, 31 May 2020 20:00:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=systemreboot.net; s=default; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=dT1VBs9ZDJ00QXb7pSgilowGUSaU3mCd3cia1N2k7HA=; b=XrsJtCMK3hw2aaL/QkeMxSnEXo L6rq1sKILtGc90Rcs6m8gQQ6627iM+Gdkoq1U57cdaNI6bOy+uQA3elRQ5OOWRh4m4u9bVwktkbDc Z+acADudoG+a6gH6EAPd3B3irJWlwRj5res+ybvWQAyHGhPanMTebS5TBsMYmcWCO+i8=; Received: from [192.168.2.1] (helo=steel.lan) by systemreboot.net with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1jfXsW-000Zk2-MW; Mon, 01 Jun 2020 05:30:33 +0530 From: Arun Isaac Date: Mon, 1 Jun 2020 05:30:27 +0530 Message-Id: <20200601000030.7443-2-arunisaac@systemreboot.net> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200601000030.7443-1-arunisaac@systemreboot.net> References: <20200601000030.7443-1-arunisaac@systemreboot.net> MIME-Version: 1.0 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+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * guix/ui.scm (relevance): When one of the regexps does not match, cut off early and return 0. Do not try to match the remaining regexps. --- guix/ui.scm | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/guix/ui.scm b/guix/ui.scm index ea5f460865..4a22358963 100644 --- a/guix/ui.scm +++ b/guix/ui.scm @@ -1519,11 +1519,16 @@ score, the more relevant OBJ is to REGEXPS." (+ relevance (* weight (apply + (map score-regexp lst))))))))) 0 metrics))) - (let ((scores (map regexp->score regexps))) - ;; Return zero if one of REGEXPS doesn't match. - (if (any zero? scores) - 0 - (reduce + 0 scores)))) + (let loop ((regexps regexps) + (total-score 0)) + (match regexps + ((head . tail) + (let ((score (regexp->score head))) + ;; Return zero if one of PATTERNS doesn't match. + (cond + ((zero? score) 0) + (else (loop tail (+ total-score score)))))) + (() total-score)))) (define %package-metrics ;; Metrics used to compute the "relevance score" of a package against a set From patchwork Mon Jun 1 00:00:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arun Isaac X-Patchwork-Id: 22486 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 6E0BD27BBE3; Mon, 1 Jun 2020 01:01:21 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,T_DKIM_INVALID, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 6066A27BBE1 for ; Mon, 1 Jun 2020 01:01:19 +0100 (BST) Received: from localhost ([::1]:37254 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jfXtG-0002oB-MC for patchwork@mira.cbaines.net; Sun, 31 May 2020 20:01:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38240) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jfXt2-0002l2-1o for guix-patches@gnu.org; Sun, 31 May 2020 20:01:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:50799) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jfXt1-00060r-NO for guix-patches@gnu.org; Sun, 31 May 2020 20:01:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jfXt1-0003au-Mf for guix-patches@gnu.org; Sun, 31 May 2020 20:01:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#39258] [PATCH 2/4] ui: Use string matching with literal search strings. Resent-From: Arun Isaac Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 01 Jun 2020 00:01:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39258 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: 39258@debbugs.gnu.org Cc: Arun Isaac Received: via spool by 39258-submit@debbugs.gnu.org id=B39258.159096964113753 (code B ref 39258); Mon, 01 Jun 2020 00:01:03 +0000 Received: (at 39258) by debbugs.gnu.org; 1 Jun 2020 00:00:41 +0000 Received: from localhost ([127.0.0.1]:34108 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jfXsf-0003Zf-85 for submit@debbugs.gnu.org; Sun, 31 May 2020 20:00:41 -0400 Received: from mugam.systemreboot.net ([139.59.75.54]:37186) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jfXsa-0003Yg-GY for 39258@debbugs.gnu.org; Sun, 31 May 2020 20:00:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=systemreboot.net; s=default; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=qZBdE0ZfKP/ze9QPewx5RIbs99IBZQjftJB+yWVWKGg=; b=C0W7eZewjmVG5gFSq8utnD0Zt1 5YPNbzIrscLxkKSLkqx1jRj4IMPBio7Cobpp+059lffHTWocwOJWytadxjU71IJ7xxZ1RMMAZ9w8S a0gRyX5EQ89skwtgm8MR5oXIyHxNDiT5Uppq2CV/ECvu1K/yEXa+hGK68oqM/1089otY=; Received: from [192.168.2.1] (helo=steel.lan) by systemreboot.net with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1jfXsX-000Zk2-5b; Mon, 01 Jun 2020 05:30:33 +0530 From: Arun Isaac Date: Mon, 1 Jun 2020 05:30:28 +0530 Message-Id: <20200601000030.7443-3-arunisaac@systemreboot.net> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200601000030.7443-1-arunisaac@systemreboot.net> References: <20200601000030.7443-1-arunisaac@systemreboot.net> MIME-Version: 1.0 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+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * guix/scripts/package.scm (process-query): Make search query a regexp only if it is not a literal search string. * guix/ui.scm (relevance): Use string matching with literal search strings and regexp matching with regexp search strings. --- guix/scripts/package.scm | 12 +++++++--- guix/ui.scm | 50 +++++++++++++++++++++++++--------------- 2 files changed, 40 insertions(+), 22 deletions(-) diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm index 1246147798..1b637f7802 100644 --- a/guix/scripts/package.scm +++ b/guix/scripts/package.scm @@ -675,6 +675,11 @@ doesn't need it." (define (process-query opts) "Process any query specified by OPTS. Return #t when a query was actually processed, #f otherwise." + (define (regexp-pattern? str) + (string-any + (char-set #\. #\[ #\{ #\} #\( #\) #\\ #\* #\+ #\? #\| #\^ #\$) + str)) + (let* ((profiles (delete-duplicates (match (filter-map (match-lambda (('profile . p) p) @@ -781,11 +786,12 @@ processed, #f otherwise." (('search _) (let* ((patterns (filter-map (match-lambda - (('query 'search rx) rx) + (('query 'search (? regexp-pattern? rx)) + (make-regexp* rx regexp/icase)) + (('query 'search pattern) pattern) (_ #f)) opts)) - (regexps (map (cut make-regexp* <> regexp/icase) patterns)) - (matches (find-packages-by-description regexps))) + (matches (find-packages-by-description patterns))) (leave-on-EPIPE (display-search-results matches (current-output-port))) #t)) diff --git a/guix/ui.scm b/guix/ui.scm index 4a22358963..56754dba83 100644 --- a/guix/ui.scm +++ b/guix/ui.scm @@ -1489,41 +1489,53 @@ HYPERLINKS? is true, emit hyperlink escape sequences when appropriate." ;;; Searching. ;;; -(define (relevance obj regexps metrics) +(define (relevance obj patterns metrics) "Compute a \"relevance score\" for OBJ as a function of its number of -matches of REGEXPS and accordingly to METRICS. METRICS is list of +matches of PATTERNS and accordingly to METRICS. METRICS is list of field/weight pairs, where FIELD is a procedure that returns a string or list of strings describing OBJ, and WEIGHT is a positive integer denoting the weight of this field in the final score. -A score of zero means that OBJ does not match any of REGEXPS. The higher the -score, the more relevant OBJ is to REGEXPS." - (define (score regexp str) - (fold-matches regexp str 0 - (lambda (m score) - (+ score - (if (string=? (match:substring m) str) - 5 ;exact match - 1))))) - - (define (regexp->score regexp) - (let ((score-regexp (lambda (str) (score regexp str)))) +A score of zero means that OBJ does not match any of PATTERNS. The higher the +score, the more relevant OBJ is to PATTERNS." + (define (score pattern str) + (match pattern + ((? string? pattern) + (cond + ((string=? str pattern) 5) + (else + (let loop ((score 0) (start 0)) + (cond + ((string-contains-ci str pattern start) + => (lambda (index) + (loop (+ score 1) (+ index (string-length pattern))))) + (else score)))))) + ((? regexp? regexp) + (fold-matches regexp str 0 + (lambda (m score) + (+ score + (if (string=? (match:substring m) str) + 5 ;exact match + 1))))))) + + (define (pattern->score pattern) + (let ((score-pattern (lambda (str) (score pattern str)))) (fold (lambda (metric relevance) (match metric ((field . weight) (match (field obj) (#f relevance) ((? string? str) - (+ relevance (* (score-regexp str) weight))) + (+ relevance (* (score-pattern str) weight))) ((lst ...) - (+ relevance (* weight (apply + (map score-regexp lst))))))))) + (+ relevance (* weight (apply + (map score-pattern lst))))))))) 0 metrics))) - (let loop ((regexps regexps) + (let loop ((patterns patterns) (total-score 0)) - (match regexps + (match patterns ((head . tail) - (let ((score (regexp->score head))) + (let ((score (pattern->score head))) ;; Return zero if one of PATTERNS doesn't match. (cond ((zero? score) 0) From patchwork Mon Jun 1 00:00:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arun Isaac X-Patchwork-Id: 22485 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 1394E27BBE6; Mon, 1 Jun 2020 01:01:20 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,T_DKIM_INVALID, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 6CE5327BBE3 for ; Mon, 1 Jun 2020 01:01:19 +0100 (BST) Received: from localhost ([::1]:37268 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jfXtG-0002oV-Mz for patchwork@mira.cbaines.net; Sun, 31 May 2020 20:01:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38234) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jfXt1-0002km-Nv for guix-patches@gnu.org; Sun, 31 May 2020 20:01:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:50798) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jfXt1-00060K-Ax for guix-patches@gnu.org; Sun, 31 May 2020 20:01:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jfXt1-0003an-9x for guix-patches@gnu.org; Sun, 31 May 2020 20:01:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#39258] [PATCH 3/4] ui: Do not translate package synopsis a second time. Resent-From: Arun Isaac Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 01 Jun 2020 00:01:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39258 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: 39258@debbugs.gnu.org Cc: Arun Isaac Received: via spool by 39258-submit@debbugs.gnu.org id=B39258.159096964113746 (code B ref 39258); Mon, 01 Jun 2020 00:01:03 +0000 Received: (at 39258) by debbugs.gnu.org; 1 Jun 2020 00:00:41 +0000 Received: from localhost ([127.0.0.1]:34106 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jfXsf-0003ZY-05 for submit@debbugs.gnu.org; Sun, 31 May 2020 20:00:41 -0400 Received: from mugam.systemreboot.net ([139.59.75.54]:37188) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jfXsa-0003Yi-Gi for 39258@debbugs.gnu.org; Sun, 31 May 2020 20:00:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=systemreboot.net; s=default; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=koRPHMk+1jW4Poi+61aDL6+TguQVOsEzO6WPFTcu4P8=; b=EbHbbb293KW4oVed2AEp4tTkR2 qyDC9IqAffBoWvsG7ux/6rWhNFZ/9r1PSlJk32j8miVFH2UX/WzC+Qtw0j2PFUS1nnEPIWBJHJlG+ AJDU7BYqaf6vF9AswhHFxzRn1dTpXii9cNWxBFWvMbyRdUieVLnCSp2yptyFzH9ItMyg=; Received: from [192.168.2.1] (helo=steel.lan) by systemreboot.net with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1jfXsX-000Zk2-Af; Mon, 01 Jun 2020 05:30:33 +0530 From: Arun Isaac Date: Mon, 1 Jun 2020 05:30:29 +0530 Message-Id: <20200601000030.7443-4-arunisaac@systemreboot.net> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200601000030.7443-1-arunisaac@systemreboot.net> References: <20200601000030.7443-1-arunisaac@systemreboot.net> MIME-Version: 1.0 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+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * guix/ui.scm (package->recutils): package-synopsis-string already returns a translated string. Do not attempt to translate it again. --- guix/ui.scm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/guix/ui.scm b/guix/ui.scm index 56754dba83..744758d1f3 100644 --- a/guix/ui.scm +++ b/guix/ui.scm @@ -1463,8 +1463,7 @@ HYPERLINKS? is true, emit hyperlink escape sequences when appropriate." (string-map (match-lambda (#\newline #\space) (chr chr)) - (or (and=> (package-synopsis-string p) P_) - ""))) + (or (package-synopsis-string p) ""))) (format port "~a~%" (string->recutils (string-trim-right From patchwork Mon Jun 1 00:00:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arun Isaac X-Patchwork-Id: 22488 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id F1C6F27BBE3; Mon, 1 Jun 2020 01:01:24 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,T_DKIM_INVALID, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 9369927BBE1 for ; Mon, 1 Jun 2020 01:01:24 +0100 (BST) Received: from localhost ([::1]:37812 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jfXtM-000334-5i for patchwork@mira.cbaines.net; Sun, 31 May 2020 20:01:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38230) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jfXt1-0002kR-BM for guix-patches@gnu.org; Sun, 31 May 2020 20:01:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:50797) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jfXt1-0005zy-0K for guix-patches@gnu.org; Sun, 31 May 2020 20:01:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jfXt0-0003ag-Tr for guix-patches@gnu.org; Sun, 31 May 2020 20:01:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#39258] [PATCH 4/4] ui: Use package-description-string. Resent-From: Arun Isaac Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 01 Jun 2020 00:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39258 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: 39258@debbugs.gnu.org Cc: Arun Isaac Received: via spool by 39258-submit@debbugs.gnu.org id=B39258.159096964113739 (code B ref 39258); Mon, 01 Jun 2020 00:01:02 +0000 Received: (at 39258) by debbugs.gnu.org; 1 Jun 2020 00:00:41 +0000 Received: from localhost ([127.0.0.1]:34104 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jfXse-0003ZR-O4 for submit@debbugs.gnu.org; Sun, 31 May 2020 20:00:40 -0400 Received: from mugam.systemreboot.net ([139.59.75.54]:37190) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jfXsa-0003Yj-HC for 39258@debbugs.gnu.org; Sun, 31 May 2020 20:00:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=systemreboot.net; s=default; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=NTHVfTd+ffFR2Zw8V8SaT5CvLkoPUwm2ZBFts1vBTuk=; b=l/yaCqC1EcyvTiCsQi1MRpgYlw wVj+BVNQwc83y8u8Iuo7e499BvKE/y48zU00MIxAlHgeVulO33+kKrM8YCfHqirACS9ygDHSNdgzY hogQ4XnJtfAOaBLh77YKwtMPc8dUQmeRCKQid1xi7nUfLCMyX859VvCQmZtvKC3RNPt0=; Received: from [192.168.2.1] (helo=steel.lan) by systemreboot.net with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1jfXsX-000Zk2-Fl; Mon, 01 Jun 2020 05:30:33 +0530 From: Arun Isaac Date: Mon, 1 Jun 2020 05:30:30 +0530 Message-Id: <20200601000030.7443-5-arunisaac@systemreboot.net> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200601000030.7443-1-arunisaac@systemreboot.net> References: <20200601000030.7443-1-arunisaac@systemreboot.net> MIME-Version: 1.0 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+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * guix/ui.scm (package->recutils): Use package-description-string instead of package-description and P_. --- guix/ui.scm | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/guix/ui.scm b/guix/ui.scm index 744758d1f3..caa506a645 100644 --- a/guix/ui.scm +++ b/guix/ui.scm @@ -1468,10 +1468,8 @@ HYPERLINKS? is true, emit hyperlink escape sequences when appropriate." (string->recutils (string-trim-right (parameterize ((%text-width width*)) - (texi->plain-text - (string-append "description: " - (or (and=> (package-description p) P_) - "")))) + (string-append "description: " + (or (package-description-string p) ""))) #\newline))) (for-each (match-lambda ((field . value)