From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [PATCH] gnu-maintenance: Improve 'official-gnu-packages'; add related procedures. Date: Thu, 28 Mar 2013 17:48:44 +0100 Message-ID: <87ppyjlbbn.fsf@gnu.org> References: <87obfchq38.fsf@karetnikov.org> <87sj4ok6sc.fsf@gnu.org> <87sj48gxzp.fsf_-_@karetnikov.org> <87lia09khe.fsf@gnu.org> <874ngbcfbl.fsf_-_@karetnikov.org> <87vc8rq6ol.fsf@gnu.org> <87hajxsx74.fsf@karetnikov.org> <87ppylvprd.fsf@gnu.org> <87li989szd.fsf_-_@karetnikov.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([208.118.235.92]:48507) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ULG0Y-0000CC-7g for bug-guix@gnu.org; Thu, 28 Mar 2013 12:48:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ULG0W-0004rK-0L for bug-guix@gnu.org; Thu, 28 Mar 2013 12:48:58 -0400 Received: from [2a01:e0b:1:123:ca0a:a9ff:fe03:271e] (port=42926 helo=xanadu.aquilenet.fr) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ULG0V-0004oQ-M0 for bug-guix@gnu.org; Thu, 28 Mar 2013 12:48:55 -0400 In-Reply-To: <87li989szd.fsf_-_@karetnikov.org> (Nikita Karetnikov's message of "Thu, 28 Mar 2013 06:08:06 +0400") List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org To: Nikita Karetnikov Cc: bug-guix@gnu.org Nikita Karetnikov skribis: >> What about calling that field =E2=80=98doc-urls=E2=80=99 (plural) and ha= ving it hold a >> list of URLs? > > Done. > > By the way, some fields return "none." Should it be converted to #f? Hmm, dunno. Let=E2=80=99s leave it for later. ;-) > +(define (find-packages regexp) > + "Find GNU packages which satisfy REGEXP." > + (let ((name-rx (make-regexp regexp))) > + (filter (lambda (package) > + (and=3D> (false-if-exception > + (regexp-exec name-rx (gnu-package-name package))) > + (const package))) > + (official-gnu-packages)))) This would give the same result: (filter (lambda (p) (false-if-exception (regexp-exec name-rx (gnu-package-name package)))) (official-gnu-packages)) > (define gnu-package? > (memoize > @@ -97,10 +200,10 @@ > network to check in GNU's database." > ;; TODO: Find a way to determine that a package is non-GNU without = going > ;; through the network. > - (let ((url (and=3D> (package-source package) origin-uri))) > + (let ((url (and=3D> (package-source package) origin-uri)) > + (name (package-name package))) > (or (and (string? url) (string-prefix? "mirror://gnu" url)) > - (and (member (package-name package) (official-gnu-packages)) > - #t)))))) > + (not (null-list? (find-packages (format #f "^~a$" name)))))))= )) This can be simplified: (or (and (string? url) ...) (and (member name (map gnu-package-name (official-gnu-packages))) #t)) Thus I think you can remove =E2=80=98find-packages=E2=80=99, which is a spe= cial case anyway. WDYT? If you agree with the changes, you can then push the final version. Thanks! Ludo=E2=80=99.