From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id AClIIEB1ZGd/JwAAqHPOHw:P1 (envelope-from ) for ; Thu, 19 Dec 2024 19:34:24 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id AClIIEB1ZGd/JwAAqHPOHw (envelope-from ) for ; Thu, 19 Dec 2024 20:34:24 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=UxevOOPm; dkim=fail ("headers rsa verify failed") header.d=rimm.ee header.s=herman header.b=AwwSjHOG; 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-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1734636863; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: 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=Du8aSGeMCsII1pKsTy4Y9Us6eHcnJWvll/aQj9v79VU=; b=jfJq6QmsRD5fG4fqQyG6l12KMUog9HmccaYavHw71Z+NoBXQqaL5a3BYwXzpeGDYmHasSA M/e7dFQR/p1thLw/kTgMYAcNKP8GWLEPaJupY+pd2XmtyX+Ex4ezDZckoKc1I6WIdjoYIB 6K04PavG/NPCem35lkghaIxzg4MOtkAq1wCefq9IgDjVhjpeHZf1yzvQwo/w842swg5H7d YLJEv49E6wc2E/8BqaIPqVQVYQTdc3A18/1Tmjau5/52KVaOoVoagUxddaR23FRAnebVy1 QU2ojTUqq/5LzyT9UiiReE3g7m5v9Mp8cENQLnLXUQvUjB8nHr7Knss+vvavjg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=UxevOOPm; dkim=fail ("headers rsa verify failed") header.d=rimm.ee header.s=herman header.b=AwwSjHOG; 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=1734636863; a=rsa-sha256; cv=none; b=XWC1iesOOliw9Pcn0LX4oONR3IMGj4lL525Rftn8JT0T9ccsGiQq+n2FofUrHPEwbocsQs RA0Q0tFyKGuKe87K+2uqXfKLaRI5laK+belQtpzYA21QCIaL/+s/oUDao/nSURAaYttdHf BT4ekw91Ay78DDJ17Zk57jdkws6ircc1AeBHm7UeKtRQ17ayKmmWWOkCzeRHSDB0dfaXNa nQCCh9/QQlWIZt5zHQpkTC7mrFTvdfMjzEovYA+ejzh7qWVHhXgRYFm/mfvNhvjEiscCul ImlPzDUjWYbeAdf+JSgl6mjstLhpsBUlwoL9ZX56dJfW3CtsWT+nba6GAayZ5A== 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 970007AA07 for ; Thu, 19 Dec 2024 20:34:23 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tOMHd-0002ab-OJ; Thu, 19 Dec 2024 14:34:05 -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 1tOMHc-0002ZV-Sa for guix-patches@gnu.org; Thu, 19 Dec 2024 14:34:04 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tOMHc-0002mq-EF; Thu, 19 Dec 2024 14:34:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=Du8aSGeMCsII1pKsTy4Y9Us6eHcnJWvll/aQj9v79VU=; b=UxevOOPm+/TXB0xvYiwhpxcVsSkIKy9O56a7Atn783UHnCxwN6lKiNbRGwLu1zdugtPSWStv+enHARktdDUZxojL3ocekNXorXAtSgXlXdRsrtwm8HDZYkpHVAwnziQ6dJxibJj5R/FJnItMXH+es020tFiPi8blWRjy1BA0bWjpxIPI7yX+y+fucrA3nBK9ipDzVTO3aeLSUrflOlh5xarsLnQOUaH7KP/upgj8odRaS/F2fOE4BSWQ8C49/BedpHgq7G38drIon0wmI7BwEOeMQxHOSbfA8tD0g4zR7jJE3B2VVTrlqF3lD8g8JBCcOXHfm1ZPumC2b2/11jr6Jw==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tOMHa-0000TE-6b; Thu, 19 Dec 2024 14:34:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#74979] [PATCH 2/4] scripts: style: Sort more kinds of package definitions. Resent-From: Herman Rimm Original-Sender: "Debbugs-submit" Resent-CC: guix@cbaines.net, dev@jpoiret.xyz, ludo@gnu.org, othacehe@gnu.org, zimon.toutoune@gmail.com, me@tobias.gr, guix-patches@gnu.org Resent-Date: Thu, 19 Dec 2024 19:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74979 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 74979@debbugs.gnu.org Cc: Christopher Baines , Josselin Poiret , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Mathieu Othacehe , Simon Tournier , Tobias Geerinckx-Rice X-Debbugs-Original-Xcc: Christopher Baines , Josselin Poiret , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Mathieu Othacehe , Simon Tournier , Tobias Geerinckx-Rice Received: via spool by 74979-submit@debbugs.gnu.org id=B74979.17346368401788 (code B ref 74979); Thu, 19 Dec 2024 19:34:02 +0000 Received: (at 74979) by debbugs.gnu.org; 19 Dec 2024 19:34:00 +0000 Received: from localhost ([127.0.0.1]:40145 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tOMHX-0000Si-OH for submit@debbugs.gnu.org; Thu, 19 Dec 2024 14:34:00 -0500 Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:34221 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tOMHW-0000SA-6M for 74979@debbugs.gnu.org; Thu, 19 Dec 2024 14:33:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman; t=1734636828; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Du8aSGeMCsII1pKsTy4Y9Us6eHcnJWvll/aQj9v79VU=; b=AwwSjHOGbACUPxuYEo9UPy0XQwb41p+Fy5q+qegm5y/SRBahMlJYgVqApBLA2e8LXWwNo2 /FONpBoiRSxsONieSVkMvqKIJE0BK3e+K/+dbrnI37uwvGLHP8gkHXeL2vEbhYbtdJRkMs KYfof+8QVpp1jsIzU/Fzm72SyKMaOAUFaTjx3WcIiIgr4bVWfACMeKuvSfHZsZsIrN7trj D8SKwMcP4ZPE3Kp4THinXmPu4EGGwCOT1nyJvn6KbJyOEXTsfWallC2CCmJPQhYLZqhzwU JTodvN+JulATzax6XBBh6KxT4VZX1Y7exnOAo1k5bgvq6ZZ3HC+IehK2wGPqyQ== Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id 40a7efa6 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO) for <74979@debbugs.gnu.org>; Thu, 19 Dec 2024 19:33:48 +0000 (UTC) Date: Thu, 19 Dec 2024 20:33:05 +0100 Message-ID: X-Mailer: git-send-email 2.45.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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: , Reply-to: Herman Rimm X-ACL-Warn: , Herman Rimm via Guix-patches From: Herman Rimm via Guix-patches via 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 X-Migadu-Scanner: mx13.migadu.com X-Migadu-Spam-Score: 2.27 X-Spam-Score: 2.27 X-Migadu-Queue-Id: 970007AA07 X-TUID: oUlzZT3ZoFMN * guix/scripts/style.scm (order-packages): Match comments before package S-exp. and its fields. Match in let. Match package/inherit. Change-Id: I48a5976930501c20415b5413966b5294958bc23b --- guix/scripts/style.scm | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/guix/scripts/style.scm b/guix/scripts/style.scm index 4b704ddfb7..6f07f6c3b9 100644 --- a/guix/scripts/style.scm +++ b/guix/scripts/style.scm @@ -503,13 +503,14 @@ (define (order-packages lst) share a name are placed with versions in descending order." (define (package-fields pkg) (match pkg - ((('define-public _ expr) _ ...) + ((('define-public pkg _ ... (or ('let _ expr) expr)) _ ...) (match expr - ((or ('package _ ('name name) ('version version) _ ...) - ('package ('name name) ('version version) _ ...)) - (values name version)) - (_ (values #f #f)))) - (_ (values #f #f)))) + (((or 'package 'package/inherit) fields ...) + (let ((name (and=> (assoc-ref fields 'name) first)) + (version (and=> (assoc-ref fields 'version) first))) + (values name version))) + (_ (and (values #f #f))))) + (_ (and (values #f #f))))) (define (package>? lst1 lst2) (let-values (((name1 version1) (package-fields lst1)) -- 2.45.2