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 6CNjO8jd7mP57QAAbAwnHQ (envelope-from ) for ; Fri, 17 Feb 2023 02:52:09 +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 iFdjOsjd7mN7ywAAG6o9tA (envelope-from ) for ; Fri, 17 Feb 2023 02:52:08 +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 9FC881C561 for ; Fri, 17 Feb 2023 02:52:08 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pSpu1-0007fb-AN; Thu, 16 Feb 2023 20:51:09 -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 1pSptv-0007dw-3D for guix-patches@gnu.org; Thu, 16 Feb 2023 20:51: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 1pSptu-0004NE-RJ for guix-patches@gnu.org; Thu, 16 Feb 2023 20:51:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pSptu-0007VH-MV for guix-patches@gnu.org; Thu, 16 Feb 2023 20:51:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#61255] [PATCH v2 2/8] pack: Use let-keywords instead of keyword-ref. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 17 Feb 2023 01:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61255 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 61255@debbugs.gnu.org Cc: Josselin Poiret , Tobias Geerinckx-Rice , Maxim Cournoyer , Simon Tournier , Mathieu Othacehe , ludo@gnu.org, Christopher Baines , Ricardo Wurmus Received: via spool by 61255-submit@debbugs.gnu.org id=B61255.167659861628699 (code B ref 61255); Fri, 17 Feb 2023 01:51:02 +0000 Received: (at 61255) by debbugs.gnu.org; 17 Feb 2023 01:50:16 +0000 Received: from localhost ([127.0.0.1]:38071 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pSptA-0007Sj-1u for submit@debbugs.gnu.org; Thu, 16 Feb 2023 20:50:16 -0500 Received: from mail-qv1-f50.google.com ([209.85.219.50]:33506) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pSpt8-0007SE-Ay for 61255@debbugs.gnu.org; Thu, 16 Feb 2023 20:50:14 -0500 Received: by mail-qv1-f50.google.com with SMTP id j9so3014345qvt.0 for <61255@debbugs.gnu.org>; Thu, 16 Feb 2023 17:50:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=0qHTKOtyMhSw+KuYJe51SCUVMgqGcETF+XOOn/CziL8=; b=VPX5OcW6SKfx006wrAK0ijMb2VLPzFxZEK5iDwBLuHV34XKKrv66Pevkt8de0ttOxJ Ty+zVScfgQDb5wUMVw+Xd3l48XgKCaAJn4jwPmbqjotD10cXJwIV/oX/N4yv24gXITIc Qd4rDL4wjDtMYY1o+qX8vtmvDwdEWK0HEVtg7bAdtAjwPIMQ+vGgZWkZrBdjXd8YQv0Z lR4FSdnjv/UYQkyYrvoHa+GIv8XkLKQoycYW3LCGQQv/2j56jNtyNZk3ip8hZH4MBTqS 7RqUJvY4OnsW2uArCoLTeE/3oKS/aVkEJ4Zw/VuHana1StOtu0Cb3Bm9LQmLQ/SxWbjx SnkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0qHTKOtyMhSw+KuYJe51SCUVMgqGcETF+XOOn/CziL8=; b=MNjIee8k7cjNg12T12mAclKVK2dvv4q+peQa9ttwCqGcINFQmb01qywNBS8u7aUVf9 Gl+dMk8YMotKtRV6FmUPgYqssu+jIeV6fzOWBreyffzFX0Y6Uz4GsSPmwGq+KuhAnPf3 2IWPiuUBWzK1wTUqZBRAi0+bSC3NHxfLMC+yNaoG3/X2ciG0Sk5vXziL0utRuIfMF6EP iro4BlIsiyoJAULBqEq0XBXanZBFuJESV0NZob/aaxpCxwXwdqTKs27bnml2T6I5UHp0 ljagUDNHctqFi1nCTQqsnYNi2I1lhAYnOAcgd1ynj/ucgZ97FvuGCbt5pVnExfFQ74Z3 MygA== X-Gm-Message-State: AO0yUKUmq3NdhC7f+y4+EHm0m0R+8VTlk80Q/y46LZ1Tyyd2IjrM8C/R NhhlFlGnZ1dWGsW+r9/Jnup6wX2FM1TdzZ2b X-Google-Smtp-Source: AK7set+a/bbs5EJg/5YM+jHV5aJGRZ1dOpjIJKJ+f9ERr696Uc1K553IBHnq9g+R27dvnAotJKDmoA== X-Received: by 2002:a05:6214:5296:b0:56e:b5a1:b52d with SMTP id kj22-20020a056214529600b0056eb5a1b52dmr13554460qvb.28.1676598608768; Thu, 16 Feb 2023 17:50:08 -0800 (PST) Received: from localhost.localdomain (dsl-152-188.b2b2c.ca. [66.158.152.188]) by smtp.gmail.com with ESMTPSA id g66-20020a37b645000000b0073b425f6e33sm2316242qkf.100.2023.02.16.17.50.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Feb 2023 17:50:08 -0800 (PST) From: Maxim Cournoyer Date: Fri, 17 Feb 2023 02:49:31 +0100 Message-Id: <20230217014938.20919-3-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230217014938.20919-1-maxim.cournoyer@gmail.com> References: <20230217014938.20919-1-maxim.cournoyer@gmail.com> 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: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1676598728; h=from:from:sender:sender: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=0qHTKOtyMhSw+KuYJe51SCUVMgqGcETF+XOOn/CziL8=; b=TF00SSh8cQAhB/PnyFEvSGNmEts2sIpwHr28imEITtffmeefbJA4oFdUzP8/dbZKI0Q1kr tJ+tInZkWz84+69JyETLhMAA2++EYU7t8CI8I43Cxbz0F42k4i/hKYb/mZI7lFR2OyaaRE AcUHQDvtxPnnDxfuvyOapF5mJQudtMcec/ubhnJ7M4D46dhmoxw5HTjzLJvBWzQwx/U2qy jUJRiCJU+PWLQe0VY5vjFMnxizVGzSJHAeLEjNs7Qz0mM94C9uVi2uTh16YS5fsSOTHD/X aJ8eJUc4t+yrZvRZI3w2/0TEV7sZ/wHNdvLIPLM96D2E5h1Tm9z5Tnz916/lnw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=VPX5OcW6; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); 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" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1676598728; a=rsa-sha256; cv=none; b=XcpvKQEzpJrrU/EKp5Ezid9l3YPuAnOfN2VLvjkff9OMXowhtK4epmQFcDct1hIFaAOK7n VbCKo/vwRzeRv1+tWO+bfPcF960b+zZw5jYyUPan60KTI5wxe8aLylytIwbmFc/BWcxDLL CiEhUxN/8EOtDrCUNMEoe82aB1s7Yhcc8Gy6eJFA3kaahj3gXz1cEp26nndRQ0NgiDd/OO oIdMCN8DaWkUu47JhAXKfz2o0SBqCWsdJMmZtf3PRPNp97I1Lbx/zznbdb8yFiLSFJvDp5 jQcR03/1sO82b2lrHYwQIVf4WGuhvtLKdRPQQIyU7DY92S6fI53XFKDNbXO7Fw== X-Migadu-Spam-Score: -0.02 X-Spam-Score: -0.02 X-Migadu-Queue-Id: 9FC881C561 X-Migadu-Scanner: scn1.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=VPX5OcW6; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); 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" X-TUID: JMS7BXMwU9jP * guix/scripts/pack.scm: (debian-archive): Bind extra-options keyword arguments via let-keywords. --- Changes in v2: - Use let-keywords instead of custom keyword-ref guix/scripts/pack.scm | 97 ++++++++++++++++++++----------------------- 1 file changed, 44 insertions(+), 53 deletions(-) diff --git a/guix/scripts/pack.scm b/guix/scripts/pack.scm index f65642fb85..e552cb108a 100644 --- a/guix/scripts/pack.scm +++ b/guix/scripts/pack.scm @@ -678,16 +678,15 @@ (define %valid-compressors '("gzip" "xz" "none")) (define data-tarball (computed-file (string-append "data.tar" (compressor-extension compressor)) - (self-contained-tarball/builder - profile - #:profile-name profile-name - #:compressor compressor - #:localstatedir? localstatedir? - #:symlinks symlinks - #:archiver archiver) - #:local-build? #f ;allow offloading - #:options (list #:references-graphs `(("profile" ,profile)) - #:target target))) + (self-contained-tarball/builder profile + #:profile-name profile-name + #:compressor compressor + #:localstatedir? localstatedir? + #:symlinks symlinks + #:archiver archiver) + #:local-build? #f ;allow offloading + #:options (list #:references-graphs `(("profile" ,profile)) + #:target target))) (define build (with-extensions (list guile-gcrypt) @@ -702,6 +701,7 @@ (define build (guix build utils) (guix profiles) (ice-9 match) + (ice-9 optargs) (srfi srfi-1)) (define machine-type @@ -762,32 +762,23 @@ (define data-tarball-file-name (strip-store-file-name (copy-file #+data-tarball data-tarball-file-name) - (define (keyword-ref lst keyword) - (match (memq keyword lst) - ((_ value . _) value) - (#f #f))) - ;; Generate the control archive. - (define control-file - (keyword-ref '#$extra-options #:control-file)) - - (define postinst-file - (keyword-ref '#$extra-options #:postinst-file)) - - (define triggers-file - (keyword-ref '#$extra-options #:triggers-file)) - - (define control-tarball-file-name - (string-append "control.tar" - #$(compressor-extension compressor))) - - ;; Write the compressed control tarball. Only the control file is - ;; mandatory (see: 'man deb' and 'man deb-control'). - (if control-file - (copy-file control-file "control") - (call-with-output-file "control" - (lambda (port) - (format port "\ + (let-keywords '#$extra-options #f + ((control-file #f) + (postinst-file #f) + (triggers-file #f)) + + (define control-tarball-file-name + (string-append "control.tar" + #$(compressor-extension compressor))) + + ;; Write the compressed control tarball. Only the control file is + ;; mandatory (see: 'man deb' and 'man deb-control'). + (if control-file + (copy-file control-file "control") + (call-with-output-file "control" + (lambda (port) + (format port "\ Package: ~a Version: ~a Description: Debian archive generated by GNU Guix. @@ -797,28 +788,28 @@ (define control-tarball-file-name Section: misc ~%" package-name package-version architecture)))) - (when postinst-file - (copy-file postinst-file "postinst") - (chmod "postinst" #o755)) + (when postinst-file + (copy-file postinst-file "postinst") + (chmod "postinst" #o755)) - (when triggers-file - (copy-file triggers-file "triggers")) + (when triggers-file + (copy-file triggers-file "triggers")) - (define tar (string-append #+archiver "/bin/tar")) + (define tar (string-append #+archiver "/bin/tar")) - (apply invoke tar - `(,@(tar-base-options - #:tar tar - #:compressor #+(and=> compressor compressor-command)) - "-cvf" ,control-tarball-file-name - "control" - ,@(if postinst-file '("postinst") '()) - ,@(if triggers-file '("triggers") '()))) + (apply invoke tar + `(,@(tar-base-options + #:tar tar + #:compressor #+(and=> compressor compressor-command)) + "-cvf" ,control-tarball-file-name + "control" + ,@(if postinst-file '("postinst") '()) + ,@(if triggers-file '("triggers") '()))) - ;; Create the .deb archive using GNU ar. - (invoke (string-append #+binutils "/bin/ar") "-rv" #$output - "debian-binary" - control-tarball-file-name data-tarball-file-name))))) + ;; Create the .deb archive using GNU ar. + (invoke (string-append #+binutils "/bin/ar") "-rv" #$output + "debian-binary" + control-tarball-file-name data-tarball-file-name)))))) (gexp->derivation (string-append name ".deb") build -- 2.39.1