From unknown Thu Jul 31 07:49:06 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#30147] Simplify =?UTF-8?Q?=E2=80=9Cscripts/guix=E2=80=9D?= Resent-From: Mathieu Lirzin Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 17 Jan 2018 19:26:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 30147 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: 30147@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.15162171449875 (code B ref -1); Wed, 17 Jan 2018 19:26:01 +0000 Received: (at submit) by debbugs.gnu.org; 17 Jan 2018 19:25:44 +0000 Received: from localhost ([127.0.0.1]:60515 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ebtL5-0002Z2-7H for submit@debbugs.gnu.org; Wed, 17 Jan 2018 14:25:44 -0500 Received: from eggs.gnu.org ([208.118.235.92]:60306) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ebtL0-0002Ym-1Z for submit@debbugs.gnu.org; Wed, 17 Jan 2018 14:25:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ebtKt-0004yb-4i for submit@debbugs.gnu.org; Wed, 17 Jan 2018 14:25:24 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_40,T_RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:48188) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ebtKs-0004yM-VH for submit@debbugs.gnu.org; Wed, 17 Jan 2018 14:25:23 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51269) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebtKq-0002aZ-Sr for guix-patches@gnu.org; Wed, 17 Jan 2018 14:25:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ebtKp-0004vA-42 for guix-patches@gnu.org; Wed, 17 Jan 2018 14:25:20 -0500 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:41125) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebtKo-0004uy-Vm for guix-patches@gnu.org; Wed, 17 Jan 2018 14:25:19 -0500 Received: from [2a01:e35:2ec2:e580:7d5f:f616:fc6f:3970] (port=57768 helo=godel) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ebtKn-0003Vc-Sv for guix-patches@gnu.org; Wed, 17 Jan 2018 14:25:18 -0500 From: Mathieu Lirzin Date: Wed, 17 Jan 2018 20:25:14 +0100 Message-ID: <87inc0i8yt.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi, Here are some improvements for =E2=80=9Cscripts/guix=E2=80=9D. --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: attachment; filename=0001-build-Expand-scripts-guix-at-Make-time.patch Content-Transfer-Encoding: quoted-printable >From 342444897673d5f9d9a475986e76ca2e912f6674 Mon Sep 17 00:00:00 2001 From: Mathieu Lirzin Date: Wed, 17 Jan 2018 17:14:24 +0100 Subject: [PATCH 1/2] =3D?UTF-8?q?build:=3D20Expand=3D20=3DE2=3D80=3D98scrip= ts/guix?=3D =3D?UTF-8?q?=3DE2=3D80=3D99=3D20at=3D20Make=3D20time.?=3D MIME-Version: 1.0 Content-Type: text/plain; charset=3DUTF-8 Content-Transfer-Encoding: 8bit This moves the complexity of Autotools variable expansion outside of the application code. * scripts/guix.in (config-lookup): Delete. (maybe-augment-load-paths!, run-guix-main): Use fully expanded variables instead of calling =E2=80=98config-lookup=E2=80=99. * configure.ac: Don't use AC_CONFIG_FILES for =E2=80=98scripts/guix=E2=80= =99. * Makefile.am (scripts/guix): New rule. (do_subst): New variable. (CLEANFILES, EXTRA_DIST): Adapt. --- Makefile.am | 20 +++++++++++++++++--- configure.ac | 1 - scripts/guix.in | 31 ++++++------------------------- 3 files changed, 23 insertions(+), 29 deletions(-) diff --git a/Makefile.am b/Makefile.am index aebd3b1eb..5e36dbf44 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2,7 +2,7 @@ # Copyright =C2=A9 2012, 2013, 2014, 2015, 2016, 2017 Ludovic Court=C3=A8s= # Copyright =C2=A9 2013 Andreas Enge # Copyright =C2=A9 2015, 2017 Alex Kost -# Copyright =C2=A9 2016 Mathieu Lirzin +# Copyright =C2=A9 2016, 2018 Mathieu Lirzin # Copyright =C2=A9 2016, 2017 Mark H Weaver # Copyright =C2=A9 2017 Mathieu Othacehe # Copyright =C2=A9 2017 Leo Famulari @@ -26,8 +26,20 @@ # You should have received a copy of the GNU General Public License # along with GNU Guix. If not, see . =20 -bin_SCRIPTS =3D \ - scripts/guix +bin_SCRIPTS =3D scripts/guix + +# Handle substitution of fully-expanded Autoconf variables. +do_subst =3D sed \ + -e 's,[@]GUILE[@],$(GUILE),g' \ + -e 's,[@]guilemoduledir[@],$(guilemoduledir),g' \ + -e 's,[@]guileobjectdir[@],$(guileobjectdir),g' \ + -e 's,[@]localedir[@],$(localedir),g' + +scripts/guix: scripts/guix.in Makefile + $(AM_V_GEN)rm -f $@ $@-t \ + && $(MKDIR_P) $(@D) \ + && $(do_subst) <$(srcdir)/$@.in >$@-t \ + && chmod a+x,a-w $@-t && mv -f $@-t $@ =20 nodist_noinst_SCRIPTS =3D \ pre-inst-env \ @@ -437,6 +449,7 @@ EXTRA_DIST =3D \ TODO \ CODE-OF-CONDUCT \ .dir-locals.el \ + bin/guix.in \ build-aux/build-self.scm \ build-aux/compile-all.scm \ build-aux/hydra/evaluate.scm \ @@ -473,6 +486,7 @@ endif !BUILD_DAEMON_OFFLOAD =20 =20 CLEANFILES =3D \ + $(bin_SCRIPTS) \ $(GOBJECTS) \ $(SCM_TESTS:tests/%.scm=3D%.log) =20 diff --git a/configure.ac b/configure.ac index 1e3912248..c50dcaf2e 100644 --- a/configure.ac +++ b/configure.ac @@ -272,7 +272,6 @@ AC_CONFIG_FILES([Makefile po/packages/Makefile.in guix/config.scm]) =20 -AC_CONFIG_FILES([scripts/guix], [chmod +x scripts/guix]) AC_CONFIG_FILES([test-env:build-aux/test-env.in], [chmod +x test-env]) AC_CONFIG_FILES([pre-inst-env:build-aux/pre-inst-env.in], [chmod +x pre-inst-env]) diff --git a/scripts/guix.in b/scripts/guix.in index e20c27424..af50a782b 100644 --- a/scripts/guix.in +++ b/scripts/guix.in @@ -3,6 +3,7 @@ !# ;;; GNU Guix --- Functional package management for GNU ;;; Copyright =C2=A9 2013 Mark H Weaver +;;; Copyright =C2=A9 2018 Mathieu Lirzin ;;; ;;; This file is part of GNU Guix. ;;; @@ -22,35 +23,15 @@ ;; IMPORTANT: We must avoid loading any modules from Guix here, ;; because we need to adjust the guile load paths first. ;; It's okay to import modules from core Guile though. -(use-modules (ice-9 regex) - (srfi srfi-26)) +(use-modules (srfi srfi-26)) =20 (let () (define-syntax-rule (push! elt v) (set! v (cons elt v))) =20 - (define config-lookup - (let ((config '(("prefix" . "@prefix@") - ("exec_prefix" . "@exec_prefix@") - ("datarootdir" . "@datarootdir@") - ("guilemoduledir" . "@guilemoduledir@") - ("guileobjectdir" . "@guileobjectdir@") - ("localedir" . "@localedir@"))) - (var-ref-regexp (make-regexp "\\$\\{([a-z_]+)\\}"))) - (define (expand-var-ref match) - (lookup (match:substring match 1))) - (define (expand str) - (regexp-substitute/global #f var-ref-regexp str - 'pre expand-var-ref 'post)) - (define (lookup name) - (expand (assoc-ref config name))) - lookup)) - (define (maybe-augment-load-paths!) (unless (getenv "GUIX_UNINSTALLED") - (let ((module-dir (config-lookup "guilemoduledir")) - (object-dir (config-lookup "guileobjectdir"))) - (push! module-dir %load-path) - (push! object-dir %load-compiled-path)) + (push! "@guilemoduledir@" %load-path) + (push! "@guileobjectdir@" %load-compiled-path) (let ((updates-dir (and=3D> (or (getenv "XDG_CONFIG_HOME") (and=3D> (getenv "HOME") (cut string-append <> "/.config= "))) @@ -64,8 +45,8 @@ (define (run-guix-main) (let ((guix-main (module-ref (resolve-interface '(guix ui)) 'guix-main))) - (bindtextdomain "guix" (config-lookup "localedir")) - (bindtextdomain "guix-packages" (config-lookup "localedir")) + (bindtextdomain "guix" "@localedir@") + (bindtextdomain "guix-packages" "@localedir@") (apply guix-main (command-line)))) =20 (maybe-augment-load-paths!) --=20 2.15.1 --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: attachment; filename=0002-guix-Refactor-script.patch Content-Transfer-Encoding: quoted-printable >From b6f8331455da1ffc4896b06cd2ee98e09b05be43 Mon Sep 17 00:00:00 2001 From: Mathieu Lirzin Date: Wed, 17 Jan 2018 19:55:49 +0100 Subject: [PATCH 2/2] guix: Refactor script. MIME-Version: 1.0 Content-Type: text/plain; charset=3DUTF-8 Content-Transfer-Encoding: 8bit * scripts/guix.in: Use =E2=80=98and-let*=E2=80=99 and remove empty surround= ing =E2=80=98let=E2=80=99. (run-guix-main, maybe-augment-load-paths!): Inline them. --- scripts/guix.in | 45 +++++++++++++++++++++------------------------ 1 file changed, 21 insertions(+), 24 deletions(-) diff --git a/scripts/guix.in b/scripts/guix.in index af50a782b..f971398e8 100644 --- a/scripts/guix.in +++ b/scripts/guix.in @@ -23,36 +23,33 @@ ;; IMPORTANT: We must avoid loading any modules from Guix here, ;; because we need to adjust the guile load paths first. ;; It's okay to import modules from core Guile though. -(use-modules (srfi srfi-26)) =20 -(let () - (define-syntax-rule (push! elt v) (set! v (cons elt v))) +(use-modules (srfi srfi-2) + (srfi srfi-26)) =20 - (define (maybe-augment-load-paths!) - (unless (getenv "GUIX_UNINSTALLED") - (push! "@guilemoduledir@" %load-path) - (push! "@guileobjectdir@" %load-compiled-path) - (let ((updates-dir (and=3D> (or (getenv "XDG_CONFIG_HOME") - (and=3D> (getenv "HOME") - (cut string-append <> "/.config= "))) - (cut string-append <> "/guix/latest")))) - (when (and updates-dir (file-exists? updates-dir)) - ;; XXX: Currently 'guix pull' puts both .scm and .go files in - ;; UPDATES-DIR. - (push! updates-dir %load-path) - (push! updates-dir %load-compiled-path))))) +(define-syntax-rule (push! elt v) (set! v (cons elt v))) =20 - (define (run-guix-main) - (let ((guix-main (module-ref (resolve-interface '(guix ui)) - 'guix-main))) - (bindtextdomain "guix" "@localedir@") - (bindtextdomain "guix-packages" "@localedir@") - (apply guix-main (command-line)))) +(unless (getenv "GUIX_UNINSTALLED") + ;; Add installed modules to load-path. + (push! "@guilemoduledir@" %load-path) + (push! "@guileobjectdir@" %load-compiled-path) =20 - (maybe-augment-load-paths!) + ;; Add modules fetched by 'guix pull' to load-path. + (and-let* ((conf-dir (or (getenv "XDG_CONFIG_HOME") + (and=3D> (getenv "HOME") + (cut string-append <> "/.config")))) + (updates-dir (string-append conf-dir "/guix/latest")) + ((file-exists? updates-dir))) + ;; XXX: Currently 'guix pull' puts both .scm and .go files in UPDATES-= DIR. + (push! updates-dir %load-path) + (push! updates-dir %load-compiled-path))) =20 +;; Run Guix. +(let ((guix-main (module-ref (resolve-interface '(guix ui)) 'guix-main))) + (bindtextdomain "guix" "@localedir@") + (bindtextdomain "guix-packages" "@localedir@") ;; XXX: It would be more convenient to change it to: ;; (exit (run-guix-main)) ;; but since the 'guix' command is not updated by 'guix pull', we cannot ;; really do it now. - (run-guix-main)) + (apply guix-main (command-line))) --=20 2.15.1 --=-=-= Content-Type: text/plain Thanks. -- Mathieu Lirzin GPG: F2A3 8D7E EB2B 6640 5761 070D 0ADE E100 9460 4D37 --=-=-=-- From unknown Thu Jul 31 07:49:06 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#30147] Simplify =?UTF-8?Q?=E2=80=9Cscripts/guix=E2=80=9D?= Resent-From: Eric Bavier Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 22 Jan 2018 23:20:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30147 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: Mathieu Lirzin Cc: 30147@debbugs.gnu.org Received: via spool by 30147-submit@debbugs.gnu.org id=B30147.151666318710601 (code B ref 30147); Mon, 22 Jan 2018 23:20:01 +0000 Received: (at 30147) by debbugs.gnu.org; 22 Jan 2018 23:19:47 +0000 Received: from localhost ([127.0.0.1]:38721 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1edlNT-0002ku-4Y for submit@debbugs.gnu.org; Mon, 22 Jan 2018 18:19:47 -0500 Received: from mail.onyx.syn-alias.com ([206.152.134.66]:31764 helo=smtp.centurylink.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1edlNR-0002kf-Tw for 30147@debbugs.gnu.org; Mon, 22 Jan 2018 18:19:46 -0500 DKIM-Signature: v=1; a=rsa-sha1; d=centurylink.net; s=ctl201402; c=relaxed/simple; q=dns/txt; i=@centurylink.net; t=1516663180; h=From:Subject:Date:To:MIME-Version:Content-Type; bh=m4FZ9PatkMVISgc78gBR3AFYqe8=; b=raSyDnHusNae5Y7bZE6ovZXmEwuw/dCtQKzVZc6kTFKl5eDULcnC+DcKe1wDhyow zQC2VoEBaMet6RbWu/7NgCZzYyRqIb513Qx1+d7hAEq+Ybv8RI4JynWgsfzZrd32 NejRUPbwNWatv0twc5JBlx3rlL37fU8j8ZntN+sv5w+k6fbDa82mffP/5sBOH3mQ C+OpXUq3I2MGvg4+0ZCl9CIF5WImQt39w1DA7d6eMpEK3SFmj2LCII9HIyxxY5Bh n1yYKnnr0S3OhuLKaD6Y2vQNEzgsofwy1/ewfwQ+oZFtRWArnsJrLHxORkXRFuxY TywNTh7E73qQT5TxXihDdA==; X_CMAE_Category: , , X-CNFS-Analysis: v=2.2 cv=YeH/3EZf c=1 sm=1 tr=0 a=W5lKcltPwKQpx9E81i/wdA==:117 a=W5lKcltPwKQpx9E81i/wdA==:17 a=KGjhK52YXX0A:10 a=RgaUWeydRksA:10 a=zSv6zi-ZgakA:10 a=mDV3o1hIAAAA:8 a=CcLUTRNvAAAA:8 a=4U_EkXnbbTa8FMVv_LMA:9 a=QEXdDO2ut3YA:10 a=GcEb0yij7bliX7oDuSkA:9 a=_FVE-zBwftR9WsbkzFJk:22 a=obhdfE27RNN5ZnF-s2K5:22 X-CM-Score: 0 X-Scanned-by: Cloudmark Authority Engine X-Authed-Username: ZXJpY2JhdmllckBjZW50dXJ5bGluay5uZXQ= Authentication-Results: smtp03.onyx.dfw.sync.lan smtp.user=ericbavier@centurylink.net; auth=pass (LOGIN) Received: from [97.116.104.8] ([97.116.104.8:59466] helo=localhost) by smtp.centurylink.net (envelope-from ) (ecelerity 3.6.25.56547 r(Core:3.6.25.0)) with ESMTPSA (cipher=AES256-GCM-SHA384) id F6/19-31762-B81766A5; Mon, 22 Jan 2018 18:19:40 -0500 Date: Mon, 22 Jan 2018 12:19:58 -0600 From: Eric Bavier Message-ID: <20180122121958.2eb9d1b4@centurylink.net> In-Reply-To: <87inc0i8yt.fsf@gnu.org> References: <87inc0i8yt.fsf@gnu.org> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.31; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/XcsPGi2tTS13wWB.od_qb9p"; protocol="application/pgp-signature" X-Spam-Score: 1.1 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: On Wed, 17 Jan 2018 20:25:14 +0100 Mathieu Lirzin wrote: > This moves the complexity of Autotools variable expansion outside of the > application code. > > * scripts/guix.in (config-lookup): Delete. > (maybe-augment-load-paths!, run-guix-main): Use fully expanded variables > instead of calling =?UTF-8?Q?=E2=80=98config-lookup=E2=80=99.?= > * configure.ac: Don't use AC_CONFIG_FILES for =?UTF-8?Q?=E2=80=98scripts/guix=E2=80=99.?= > * Makefile.am (scripts/guix): New rule. > (do_subst): New variable. > (CLEANFILES, EXTRA_DIST): Adapt. [...] Content analysis details: (1.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 1.1 DATE_IN_PAST_03_06 Date: is 3 to 6 hours before Received: date 0.0 T_DKIM_INVALID DKIM-Signature header exists but is not valid X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.1 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: On Wed, 17 Jan 2018 20:25:14 +0100 Mathieu Lirzin wrote: > This moves the complexity of Autotools variable expansion outside of the > application code. > > * scripts/guix.in (config-lookup): Delete. > (maybe-augment-load-paths!, run-guix-main): Use fully expanded variables > instead of calling =?UTF-8?Q?=E2=80=98config-lookup=E2=80=99.?= > * configure.ac: Don't use AC_CONFIG_FILES for =?UTF-8?Q?=E2=80=98scripts/guix=E2=80=99.?= > * Makefile.am (scripts/guix): New rule. > (do_subst): New variable. > (CLEANFILES, EXTRA_DIST): Adapt. [...] Content analysis details: (1.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 1.1 DATE_IN_PAST_03_06 Date: is 3 to 6 hours before Received: date 0.0 T_DKIM_INVALID DKIM-Signature header exists but is not valid --Sig_/XcsPGi2tTS13wWB.od_qb9p Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Wed, 17 Jan 2018 20:25:14 +0100 Mathieu Lirzin wrote: > This moves the complexity of Autotools variable expansion outside of the > application code. >=20 > * scripts/guix.in (config-lookup): Delete. > (maybe-augment-load-paths!, run-guix-main): Use fully expanded variables > instead of calling =E2=80=98config-lookup=E2=80=99. > * configure.ac: Don't use AC_CONFIG_FILES for =E2=80=98scripts/guix=E2=80= =99. > * Makefile.am (scripts/guix): New rule. > (do_subst): New variable. > (CLEANFILES, EXTRA_DIST): Adapt. FWIW this is what my Joy compiler does for its entry script. It works well. https://notabug.org/bavier/joy-in-the-morning.git > +scripts/guix: scripts/guix.in Makefile > + $(AM_V_GEN)rm -f $@ $@-t \ > + && $(MKDIR_P) $(@D) \ > + && $(do_subst) <$(srcdir)/$@.in >$@-t \ > + && chmod a+x,a-w $@-t && mv -f $@-t $@ I think. since there's no state variables that needs to carry accross commands, that this would read better without the line continuations and appropriate use of $(AM_V_at). While we're looking at it: I'm not certain, but I think Guix currently work if one overrides the "prefix" variable when invoking 'make install', which is a use-case suggested by the GNU Coding Standards (Section 7.2.5). I bring it up because adding '$(prefix)/bin/guix' to the above rule might be a start. > +;; Run Guix. > +(let ((guix-main (module-ref (resolve-interface '(guix ui)) 'guix-main))) > + (bindtextdomain "guix" "@localedir@") > + (bindtextdomain "guix-packages" "@localedir@") > ;; XXX: It would be more convenient to change it to: > ;; (exit (run-guix-main)) > ;; but since the 'guix' command is not updated by 'guix pull', we cann= ot > ;; really do it now. > - (run-guix-main)) > + (apply guix-main (command-line))) If we're going to be patching scripts/guix.in, would now be the time to add the '(exit ...)'? Otherwise LGTM! `~Eric --Sig_/XcsPGi2tTS13wWB.od_qb9p Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEoMXjUi7471xkzbfw/XPKxxnTJWYFAlpmK04ACgkQ/XPKxxnT JWZsBBAAl42XaOQ2DzwWfveboU1lVl+90J8sosuhsRiaGmT/CyWIDiREvukLEyRi kKdl1oUjZZu1AjBn0PXmco6WAhE8TmnmlZBAq0QKf0ziAMBOihe+QAxJyxWXlngy 2lpmJMFkcCVBWQ97yqtH9Poygt/kZ0ezCgDaNfCdvTvMQXpkrpSTCfR0GEpHajSi SdXU2nv3sYVLZB48NZ2f8CtyuPqoNI88GdUdgrnjApJUVJqvTunky46Sz5x8y7Bl V05WPkh+Bshuq8lXg/TME9sg+MFPQLMw5Fynh+PmU1vPy7OSzgauKaG5s8/qFc+S FQow8M418vy3V7nKHSMiG7Bg02bvfNeQFkA4gXCP5ScK4HqN7nJeaYq8ZXFaATVQ avvdjWEb++W0De7OgbFsxKWeMThGSUfGUaZ02UhxI2VQuHkKAn6zKeWQNkvD898e epQDTfKcJ/Jd2KqCtc24pOIRMOGXcUFt933sTDRdl09JNv1pz1sGCpdxiIL0VmJa rtgkk6CJfS7Ki2gja7woHPcyzPLAsePbQj3E0op7dpbflzgXS7PX817pehaLMy1E 4kLpMHIiLOoW4aSEb5No339yIrXSuxwEGfW8jDk5tpFcsIhmR/ssfoT/VsGe4+BL q38GfhnFJPDVVvi8WjXycPpRtkk2DgGeFVSS8EDaQQLG2213bBU= =+c8u -----END PGP SIGNATURE----- --Sig_/XcsPGi2tTS13wWB.od_qb9p-- From unknown Thu Jul 31 07:49:06 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Mathieu Lirzin Subject: bug#30147: closed (Re: [bug#30147] Simplify =?UTF-8?Q?=E2=80=9Cscripts/guix=E2=80=9D?=) Message-ID: References: <87fu6x7x9m.fsf@gnu.org> <87inc0i8yt.fsf@gnu.org> X-Gnu-PR-Message: they-closed 30147 X-Gnu-PR-Package: guix-patches Reply-To: 30147@debbugs.gnu.org Date: Tue, 23 Jan 2018 09:15:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1516698902-20145-1" This is a multi-part message in MIME format... ------------=_1516698902-20145-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #30147: Simplify =E2=80=9Cscripts/guix=E2=80=9D which was filed against the guix-patches package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 30147@debbugs.gnu.org. --=20 30147: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D30147 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1516698902-20145-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 30147-done) by debbugs.gnu.org; 23 Jan 2018 09:14:06 +0000 Received: from localhost ([127.0.0.1]:38991 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eduec-0005Da-Dn for submit@debbugs.gnu.org; Tue, 23 Jan 2018 04:14:06 -0500 Received: from hera.aquilenet.fr ([185.233.100.1]:41568) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1edueX-0005Cy-4n for 30147-done@debbugs.gnu.org; Tue, 23 Jan 2018 04:14:04 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 98D35CA22; Tue, 23 Jan 2018 10:14:00 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id zwCDCOmkrU1o; Tue, 23 Jan 2018 10:13:58 +0100 (CET) Received: from ribbon (unknown [193.50.110.135]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 3813E9D30; Tue, 23 Jan 2018 10:13:58 +0100 (CET) From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: Mathieu Lirzin Subject: Re: [bug#30147] Simplify =?utf-8?Q?=E2=80=9Cscripts=2Fguix?= =?utf-8?Q?=E2=80=9D?= References: <87inc0i8yt.fsf@gnu.org> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 4 =?utf-8?Q?Pluvi=C3=B4se?= an 226 de la =?utf-8?Q?R?= =?utf-8?Q?=C3=A9volution?= 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, 23 Jan 2018 10:13:57 +0100 In-Reply-To: <87inc0i8yt.fsf@gnu.org> (Mathieu Lirzin's message of "Wed, 17 Jan 2018 20:25:14 +0100") Message-ID: <87fu6x7x9m.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 30147-done Cc: 30147-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello, Mathieu Lirzin skribis: > From 342444897673d5f9d9a475986e76ca2e912f6674 Mon Sep 17 00:00:00 2001 > From: Mathieu Lirzin > Date: Wed, 17 Jan 2018 17:14:24 +0100 > Subject: [PATCH 1/2] =3D?UTF-8?q?build:=3D20Expand=3D20=3DE2=3D80=3D98scr= ipts/guix?=3D > =3D?UTF-8?q?=3DE2=3D80=3D99=3D20at=3D20Make=3D20time.?=3D > MIME-Version: 1.0 > Content-Type: text/plain; charset=3DUTF-8 > Content-Transfer-Encoding: 8bit > > This moves the complexity of Autotools variable expansion outside of the > application code. > > * scripts/guix.in (config-lookup): Delete. > (maybe-augment-load-paths!, run-guix-main): Use fully expanded variables > instead of calling =E2=80=98config-lookup=E2=80=99. > * configure.ac: Don't use AC_CONFIG_FILES for =E2=80=98scripts/guix=E2=80= =99. > * Makefile.am (scripts/guix): New rule. > (do_subst): New variable. > (CLEANFILES, EXTRA_DIST): Adapt. That=E2=80=99s a good idea. I applied it with the changes below, mostly to account for Eric=E2=80=99s suggestions. --=-=-= Content-Type: text/x-patch Content-Disposition: inline diff --git a/Makefile.am b/Makefile.am index 5e36dbf44..9bafdab49 100644 --- a/Makefile.am +++ b/Makefile.am @@ -29,17 +29,17 @@ bin_SCRIPTS = scripts/guix # Handle substitution of fully-expanded Autoconf variables. -do_subst = sed \ - -e 's,[@]GUILE[@],$(GUILE),g' \ - -e 's,[@]guilemoduledir[@],$(guilemoduledir),g' \ - -e 's,[@]guileobjectdir[@],$(guileobjectdir),g' \ +do_subst = $(SED) \ + -e 's,[@]GUILE[@],$(GUILE),g' \ + -e 's,[@]guilemoduledir[@],$(guilemoduledir),g' \ + -e 's,[@]guileobjectdir[@],$(guileobjectdir),g' \ -e 's,[@]localedir[@],$(localedir),g' scripts/guix: scripts/guix.in Makefile - $(AM_V_GEN)rm -f $@ $@-t \ - && $(MKDIR_P) $(@D) \ - && $(do_subst) <$(srcdir)/$@.in >$@-t \ - && chmod a+x,a-w $@-t && mv -f $@-t $@ + $(AM_V_at)rm -f $@ $@-t + $(AM_V_at)$(MKDIR_P) "$(@D)" + $(AM_V_GEN)$(do_subst) < "$(srcdir)/$@.in" > "$@-t" + $(AM_V_at)chmod a+x,a-w "$@-t" && mv -f "$@-t" "$@" nodist_noinst_SCRIPTS = \ pre-inst-env \ diff --git a/configure.ac b/configure.ac index c50dcaf2e..f69f79648 100644 --- a/configure.ac +++ b/configure.ac @@ -124,6 +124,8 @@ dnl Make sure we don't suffer from the bug in 'equal?' wrt. syntax objects dnl found in 2.2.1. See . GUIX_ASSERT_SYNTAX_OBJECT_EQUAL +AC_PROG_SED + dnl Decompressors, for use by the substituter and other modules. AC_PATH_PROG([GZIP], [gzip]) AC_PATH_PROG([BZIP2], [bzip2]) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable > From b6f8331455da1ffc4896b06cd2ee98e09b05be43 Mon Sep 17 00:00:00 2001 > From: Mathieu Lirzin > Date: Wed, 17 Jan 2018 19:55:49 +0100 > Subject: [PATCH 2/2] guix: Refactor script. > MIME-Version: 1.0 > Content-Type: text/plain; charset=3DUTF-8 > Content-Transfer-Encoding: 8bit > > * scripts/guix.in: Use =E2=80=98and-let*=E2=80=99 and remove empty surrou= nding =E2=80=98let=E2=80=99. > (run-guix-main, maybe-augment-load-paths!): Inline them. This is entirely subjective but I prefer the current style (in fact I never use SRFI-2), so I=E2=80=99d rather skip this patch. WDYT? :-) Thank you! Ludo=E2=80=99. --=-=-=-- ------------=_1516698902-20145-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 17 Jan 2018 19:25:44 +0000 Received: from localhost ([127.0.0.1]:60515 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ebtL5-0002Z2-7H for submit@debbugs.gnu.org; Wed, 17 Jan 2018 14:25:44 -0500 Received: from eggs.gnu.org ([208.118.235.92]:60306) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ebtL0-0002Ym-1Z for submit@debbugs.gnu.org; Wed, 17 Jan 2018 14:25:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ebtKt-0004yb-4i for submit@debbugs.gnu.org; Wed, 17 Jan 2018 14:25:24 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_40,T_RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:48188) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ebtKs-0004yM-VH for submit@debbugs.gnu.org; Wed, 17 Jan 2018 14:25:23 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51269) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebtKq-0002aZ-Sr for guix-patches@gnu.org; Wed, 17 Jan 2018 14:25:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ebtKp-0004vA-42 for guix-patches@gnu.org; Wed, 17 Jan 2018 14:25:20 -0500 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:41125) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebtKo-0004uy-Vm for guix-patches@gnu.org; Wed, 17 Jan 2018 14:25:19 -0500 Received: from [2a01:e35:2ec2:e580:7d5f:f616:fc6f:3970] (port=57768 helo=godel) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ebtKn-0003Vc-Sv for guix-patches@gnu.org; Wed, 17 Jan 2018 14:25:18 -0500 From: Mathieu Lirzin To: guix-patches@gnu.org Subject: Simplify =?utf-8?Q?=E2=80=9Cscripts=2Fguix=E2=80=9D?= Date: Wed, 17 Jan 2018 20:25:14 +0100 Message-ID: <87inc0i8yt.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi, Here are some improvements for =E2=80=9Cscripts/guix=E2=80=9D. --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: attachment; filename=0001-build-Expand-scripts-guix-at-Make-time.patch Content-Transfer-Encoding: quoted-printable >From 342444897673d5f9d9a475986e76ca2e912f6674 Mon Sep 17 00:00:00 2001 From: Mathieu Lirzin Date: Wed, 17 Jan 2018 17:14:24 +0100 Subject: [PATCH 1/2] =3D?UTF-8?q?build:=3D20Expand=3D20=3DE2=3D80=3D98scrip= ts/guix?=3D =3D?UTF-8?q?=3DE2=3D80=3D99=3D20at=3D20Make=3D20time.?=3D MIME-Version: 1.0 Content-Type: text/plain; charset=3DUTF-8 Content-Transfer-Encoding: 8bit This moves the complexity of Autotools variable expansion outside of the application code. * scripts/guix.in (config-lookup): Delete. (maybe-augment-load-paths!, run-guix-main): Use fully expanded variables instead of calling =E2=80=98config-lookup=E2=80=99. * configure.ac: Don't use AC_CONFIG_FILES for =E2=80=98scripts/guix=E2=80= =99. * Makefile.am (scripts/guix): New rule. (do_subst): New variable. (CLEANFILES, EXTRA_DIST): Adapt. --- Makefile.am | 20 +++++++++++++++++--- configure.ac | 1 - scripts/guix.in | 31 ++++++------------------------- 3 files changed, 23 insertions(+), 29 deletions(-) diff --git a/Makefile.am b/Makefile.am index aebd3b1eb..5e36dbf44 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2,7 +2,7 @@ # Copyright =C2=A9 2012, 2013, 2014, 2015, 2016, 2017 Ludovic Court=C3=A8s= # Copyright =C2=A9 2013 Andreas Enge # Copyright =C2=A9 2015, 2017 Alex Kost -# Copyright =C2=A9 2016 Mathieu Lirzin +# Copyright =C2=A9 2016, 2018 Mathieu Lirzin # Copyright =C2=A9 2016, 2017 Mark H Weaver # Copyright =C2=A9 2017 Mathieu Othacehe # Copyright =C2=A9 2017 Leo Famulari @@ -26,8 +26,20 @@ # You should have received a copy of the GNU General Public License # along with GNU Guix. If not, see . =20 -bin_SCRIPTS =3D \ - scripts/guix +bin_SCRIPTS =3D scripts/guix + +# Handle substitution of fully-expanded Autoconf variables. +do_subst =3D sed \ + -e 's,[@]GUILE[@],$(GUILE),g' \ + -e 's,[@]guilemoduledir[@],$(guilemoduledir),g' \ + -e 's,[@]guileobjectdir[@],$(guileobjectdir),g' \ + -e 's,[@]localedir[@],$(localedir),g' + +scripts/guix: scripts/guix.in Makefile + $(AM_V_GEN)rm -f $@ $@-t \ + && $(MKDIR_P) $(@D) \ + && $(do_subst) <$(srcdir)/$@.in >$@-t \ + && chmod a+x,a-w $@-t && mv -f $@-t $@ =20 nodist_noinst_SCRIPTS =3D \ pre-inst-env \ @@ -437,6 +449,7 @@ EXTRA_DIST =3D \ TODO \ CODE-OF-CONDUCT \ .dir-locals.el \ + bin/guix.in \ build-aux/build-self.scm \ build-aux/compile-all.scm \ build-aux/hydra/evaluate.scm \ @@ -473,6 +486,7 @@ endif !BUILD_DAEMON_OFFLOAD =20 =20 CLEANFILES =3D \ + $(bin_SCRIPTS) \ $(GOBJECTS) \ $(SCM_TESTS:tests/%.scm=3D%.log) =20 diff --git a/configure.ac b/configure.ac index 1e3912248..c50dcaf2e 100644 --- a/configure.ac +++ b/configure.ac @@ -272,7 +272,6 @@ AC_CONFIG_FILES([Makefile po/packages/Makefile.in guix/config.scm]) =20 -AC_CONFIG_FILES([scripts/guix], [chmod +x scripts/guix]) AC_CONFIG_FILES([test-env:build-aux/test-env.in], [chmod +x test-env]) AC_CONFIG_FILES([pre-inst-env:build-aux/pre-inst-env.in], [chmod +x pre-inst-env]) diff --git a/scripts/guix.in b/scripts/guix.in index e20c27424..af50a782b 100644 --- a/scripts/guix.in +++ b/scripts/guix.in @@ -3,6 +3,7 @@ !# ;;; GNU Guix --- Functional package management for GNU ;;; Copyright =C2=A9 2013 Mark H Weaver +;;; Copyright =C2=A9 2018 Mathieu Lirzin ;;; ;;; This file is part of GNU Guix. ;;; @@ -22,35 +23,15 @@ ;; IMPORTANT: We must avoid loading any modules from Guix here, ;; because we need to adjust the guile load paths first. ;; It's okay to import modules from core Guile though. -(use-modules (ice-9 regex) - (srfi srfi-26)) +(use-modules (srfi srfi-26)) =20 (let () (define-syntax-rule (push! elt v) (set! v (cons elt v))) =20 - (define config-lookup - (let ((config '(("prefix" . "@prefix@") - ("exec_prefix" . "@exec_prefix@") - ("datarootdir" . "@datarootdir@") - ("guilemoduledir" . "@guilemoduledir@") - ("guileobjectdir" . "@guileobjectdir@") - ("localedir" . "@localedir@"))) - (var-ref-regexp (make-regexp "\\$\\{([a-z_]+)\\}"))) - (define (expand-var-ref match) - (lookup (match:substring match 1))) - (define (expand str) - (regexp-substitute/global #f var-ref-regexp str - 'pre expand-var-ref 'post)) - (define (lookup name) - (expand (assoc-ref config name))) - lookup)) - (define (maybe-augment-load-paths!) (unless (getenv "GUIX_UNINSTALLED") - (let ((module-dir (config-lookup "guilemoduledir")) - (object-dir (config-lookup "guileobjectdir"))) - (push! module-dir %load-path) - (push! object-dir %load-compiled-path)) + (push! "@guilemoduledir@" %load-path) + (push! "@guileobjectdir@" %load-compiled-path) (let ((updates-dir (and=3D> (or (getenv "XDG_CONFIG_HOME") (and=3D> (getenv "HOME") (cut string-append <> "/.config= "))) @@ -64,8 +45,8 @@ (define (run-guix-main) (let ((guix-main (module-ref (resolve-interface '(guix ui)) 'guix-main))) - (bindtextdomain "guix" (config-lookup "localedir")) - (bindtextdomain "guix-packages" (config-lookup "localedir")) + (bindtextdomain "guix" "@localedir@") + (bindtextdomain "guix-packages" "@localedir@") (apply guix-main (command-line)))) =20 (maybe-augment-load-paths!) --=20 2.15.1 --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: attachment; filename=0002-guix-Refactor-script.patch Content-Transfer-Encoding: quoted-printable >From b6f8331455da1ffc4896b06cd2ee98e09b05be43 Mon Sep 17 00:00:00 2001 From: Mathieu Lirzin Date: Wed, 17 Jan 2018 19:55:49 +0100 Subject: [PATCH 2/2] guix: Refactor script. MIME-Version: 1.0 Content-Type: text/plain; charset=3DUTF-8 Content-Transfer-Encoding: 8bit * scripts/guix.in: Use =E2=80=98and-let*=E2=80=99 and remove empty surround= ing =E2=80=98let=E2=80=99. (run-guix-main, maybe-augment-load-paths!): Inline them. --- scripts/guix.in | 45 +++++++++++++++++++++------------------------ 1 file changed, 21 insertions(+), 24 deletions(-) diff --git a/scripts/guix.in b/scripts/guix.in index af50a782b..f971398e8 100644 --- a/scripts/guix.in +++ b/scripts/guix.in @@ -23,36 +23,33 @@ ;; IMPORTANT: We must avoid loading any modules from Guix here, ;; because we need to adjust the guile load paths first. ;; It's okay to import modules from core Guile though. -(use-modules (srfi srfi-26)) =20 -(let () - (define-syntax-rule (push! elt v) (set! v (cons elt v))) +(use-modules (srfi srfi-2) + (srfi srfi-26)) =20 - (define (maybe-augment-load-paths!) - (unless (getenv "GUIX_UNINSTALLED") - (push! "@guilemoduledir@" %load-path) - (push! "@guileobjectdir@" %load-compiled-path) - (let ((updates-dir (and=3D> (or (getenv "XDG_CONFIG_HOME") - (and=3D> (getenv "HOME") - (cut string-append <> "/.config= "))) - (cut string-append <> "/guix/latest")))) - (when (and updates-dir (file-exists? updates-dir)) - ;; XXX: Currently 'guix pull' puts both .scm and .go files in - ;; UPDATES-DIR. - (push! updates-dir %load-path) - (push! updates-dir %load-compiled-path))))) +(define-syntax-rule (push! elt v) (set! v (cons elt v))) =20 - (define (run-guix-main) - (let ((guix-main (module-ref (resolve-interface '(guix ui)) - 'guix-main))) - (bindtextdomain "guix" "@localedir@") - (bindtextdomain "guix-packages" "@localedir@") - (apply guix-main (command-line)))) +(unless (getenv "GUIX_UNINSTALLED") + ;; Add installed modules to load-path. + (push! "@guilemoduledir@" %load-path) + (push! "@guileobjectdir@" %load-compiled-path) =20 - (maybe-augment-load-paths!) + ;; Add modules fetched by 'guix pull' to load-path. + (and-let* ((conf-dir (or (getenv "XDG_CONFIG_HOME") + (and=3D> (getenv "HOME") + (cut string-append <> "/.config")))) + (updates-dir (string-append conf-dir "/guix/latest")) + ((file-exists? updates-dir))) + ;; XXX: Currently 'guix pull' puts both .scm and .go files in UPDATES-= DIR. + (push! updates-dir %load-path) + (push! updates-dir %load-compiled-path))) =20 +;; Run Guix. +(let ((guix-main (module-ref (resolve-interface '(guix ui)) 'guix-main))) + (bindtextdomain "guix" "@localedir@") + (bindtextdomain "guix-packages" "@localedir@") ;; XXX: It would be more convenient to change it to: ;; (exit (run-guix-main)) ;; but since the 'guix' command is not updated by 'guix pull', we cannot ;; really do it now. - (run-guix-main)) + (apply guix-main (command-line))) --=20 2.15.1 --=-=-= Content-Type: text/plain Thanks. -- Mathieu Lirzin GPG: F2A3 8D7E EB2B 6640 5761 070D 0ADE E100 9460 4D37 --=-=-=-- ------------=_1516698902-20145-1-- From unknown Thu Jul 31 07:49:06 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#30147] Simplify =?UTF-8?Q?=E2=80=9Cscripts/guix=E2=80=9D?= Resent-From: Mathieu Lirzin Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 23 Jan 2018 11:08:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30147 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: Eric Bavier Cc: 30147@debbugs.gnu.org Received: via spool by 30147-submit@debbugs.gnu.org id=B30147.151670562130982 (code B ref 30147); Tue, 23 Jan 2018 11:08:02 +0000 Received: (at 30147) by debbugs.gnu.org; 23 Jan 2018 11:07:01 +0000 Received: from localhost ([127.0.0.1]:39079 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1edwPp-00083W-Ro for submit@debbugs.gnu.org; Tue, 23 Jan 2018 06:07:01 -0500 Received: from eggs.gnu.org ([208.118.235.92]:54068) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1edwPo-00083J-VP for 30147@debbugs.gnu.org; Tue, 23 Jan 2018 06:06:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1edwPf-0000Up-Tp for 30147@debbugs.gnu.org; Tue, 23 Jan 2018 06:06:51 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:53286) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edwPf-0000Uh-QD; Tue, 23 Jan 2018 06:06:47 -0500 Received: from mek33-4-82-236-46-88.fbx.proxad.net ([82.236.46.88]:51780 helo=godel) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1edwPf-0005sT-AM; Tue, 23 Jan 2018 06:06:47 -0500 From: Mathieu Lirzin References: <87inc0i8yt.fsf@gnu.org> <20180122121958.2eb9d1b4@centurylink.net> Date: Tue, 23 Jan 2018 12:06:40 +0100 In-Reply-To: <20180122121958.2eb9d1b4@centurylink.net> (Eric Bavier's message of "Mon, 22 Jan 2018 12:19:58 -0600") Message-ID: <87mv1496m7.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) Eric Bavier writes: > On Wed, 17 Jan 2018 20:25:14 +0100 > Mathieu Lirzin wrote: > >> This moves the complexity of Autotools variable expansion outside of the >> application code. >>=20 >> * scripts/guix.in (config-lookup): Delete. >> (maybe-augment-load-paths!, run-guix-main): Use fully expanded variables >> instead of calling =E2=80=98config-lookup=E2=80=99. >> * configure.ac: Don't use AC_CONFIG_FILES for =E2=80=98scripts/guix=E2= =80=99. >> * Makefile.am (scripts/guix): New rule. >> (do_subst): New variable. >> (CLEANFILES, EXTRA_DIST): Adapt. > > FWIW this is what my Joy compiler does for its entry script. It works > well. > > https://notabug.org/bavier/joy-in-the-morning.git Thanks for sharing your Joy. :-) >> +scripts/guix: scripts/guix.in Makefile >> + $(AM_V_GEN)rm -f $@ $@-t \ >> + && $(MKDIR_P) $(@D) \ >> + && $(do_subst) <$(srcdir)/$@.in >$@-t \ >> + && chmod a+x,a-w $@-t && mv -f $@-t $@ > > I think. since there's no state variables that needs to carry accross > commands, that this would read better without the line continuations and > appropriate use of $(AM_V_at). > > While we're looking at it: I'm not certain, but I think Guix currently > work if one overrides the "prefix" variable when invoking 'make > install', which is a use-case suggested by the GNU Coding Standards > (Section 7.2.5). I had this in mind too, but I am not sure how to achieve that. Generating scripts that depend on $(prefix) at make time is indeed a first start in conforming to that GCS requirement. However in practice I don't know any GNU package that conform to it. > I bring it up because adding '$(prefix)/bin/guix' to the above rule > might be a start. If you mean: --8<---------------cut here---------------start------------->8--- $(prefix)/bin/guix scripts/guix: scripts/guix.in Makefile ... --8<---------------cut here---------------end--------------->8--- I don't think it would work. Installed files are not part of the dependency graph, so I don't think this rule would be triggered when doing =E2=80=98make install=E2=80=99. --=20 Mathieu Lirzin GPG: F2A3 8D7E EB2B 6640 5761 070D 0ADE E100 9460 4D37 From unknown Thu Jul 31 07:49:06 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#30147] Simplify =?UTF-8?Q?=E2=80=9Cscripts/guix=E2=80=9D?= Resent-From: Mathieu Lirzin Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 23 Jan 2018 12:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30147 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Cc: 30147@debbugs.gnu.org Received: via spool by 30147-submit@debbugs.gnu.org id=B30147.15167105726725 (code B ref 30147); Tue, 23 Jan 2018 12:30:02 +0000 Received: (at 30147) by debbugs.gnu.org; 23 Jan 2018 12:29:32 +0000 Received: from localhost ([127.0.0.1]:39137 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1edxhk-0001kP-3a for submit@debbugs.gnu.org; Tue, 23 Jan 2018 07:29:32 -0500 Received: from eggs.gnu.org ([208.118.235.92]:43512) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1edxhi-0001kB-QS for 30147@debbugs.gnu.org; Tue, 23 Jan 2018 07:29:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1edxhc-0007g2-2i for 30147@debbugs.gnu.org; Tue, 23 Jan 2018 07:29:25 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:54041) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edxhX-0007dP-Tb; Tue, 23 Jan 2018 07:29:20 -0500 Received: from [2a01:e35:2ec2:e580:7d5f:f616:fc6f:3970] (port=36038 helo=godel) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1edxhX-0007Oh-54; Tue, 23 Jan 2018 07:29:19 -0500 From: Mathieu Lirzin References: <87inc0i8yt.fsf@gnu.org> <87fu6x7x9m.fsf@gnu.org> Date: Tue, 23 Jan 2018 13:29:17 +0100 In-Reply-To: <87fu6x7x9m.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Tue, 23 Jan 2018 10:13:57 +0100") Message-ID: <87efmg92si.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello, ludo@gnu.org (Ludovic Court=C3=A8s) writes: > Mathieu Lirzin skribis: > >> From 342444897673d5f9d9a475986e76ca2e912f6674 Mon Sep 17 00:00:00 2001 >> From: Mathieu Lirzin >> Date: Wed, 17 Jan 2018 17:14:24 +0100 >> Subject: [PATCH 1/2] =3D?UTF-8?q?build:=3D20Expand=3D20=3DE2=3D80=3D98sc= ripts/guix?=3D >> =3D?UTF-8?q?=3DE2=3D80=3D99=3D20at=3D20Make=3D20time.?=3D >> MIME-Version: 1.0 >> Content-Type: text/plain; charset=3DUTF-8 >> Content-Transfer-Encoding: 8bit >> >> This moves the complexity of Autotools variable expansion outside of the >> application code. >> >> * scripts/guix.in (config-lookup): Delete. >> (maybe-augment-load-paths!, run-guix-main): Use fully expanded variables >> instead of calling =E2=80=98config-lookup=E2=80=99. >> * configure.ac: Don't use AC_CONFIG_FILES for =E2=80=98scripts/guix=E2= =80=99. >> * Makefile.am (scripts/guix): New rule. >> (do_subst): New variable. >> (CLEANFILES, EXTRA_DIST): Adapt. > > That=E2=80=99s a good idea. I applied it with the changes below, mostly = to > account for Eric=E2=80=99s suggestions. Thanks. >> From b6f8331455da1ffc4896b06cd2ee98e09b05be43 Mon Sep 17 00:00:00 2001 >> From: Mathieu Lirzin >> Date: Wed, 17 Jan 2018 19:55:49 +0100 >> Subject: [PATCH 2/2] guix: Refactor script. >> MIME-Version: 1.0 >> Content-Type: text/plain; charset=3DUTF-8 >> Content-Transfer-Encoding: 8bit >> >> * scripts/guix.in: Use =E2=80=98and-let*=E2=80=99 and remove empty surro= unding =E2=80=98let=E2=80=99. >> (run-guix-main, maybe-augment-load-paths!): Inline them. > > This is entirely subjective but I prefer the current style (in fact I > never use SRFI-2), so I=E2=80=99d rather skip this patch. WDYT? :-) I tried to avoid it, but the pipelining of checks for #f makes it very tempting to use it. But indeed this is a matter of style, so let's not use it. Here is an alternative patch that beside the pedantic issue of replacing (and updates-dir (file-exists? updates-dir)) with (and=3D> updates-dir file-exists?) removes the surrounding empty 'let' that doesn't make sense to me. Additionaly the compilation of the script is now possible which is convenient for basic syntax checks. This is done by using the =E2=80=98-e = main -s=E2=80=99 command-line switches. --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: inline; filename=0001-guix-Refactor-script.patch Content-Transfer-Encoding: quoted-printable >From 77379bbf2642762927c01cc7f10eb5761626f172 Mon Sep 17 00:00:00 2001 From: Mathieu Lirzin Date: Tue, 23 Jan 2018 12:52:33 +0100 Subject: [PATCH] guix: Refactor script. MIME-Version: 1.0 Content-Type: text/plain; charset=3DUTF-8 Content-Transfer-Encoding: 8bit * scripts/guix.in: Remove empty surrounding =E2=80=98let=E2=80=99. Define = 'main' as the procedure called when running the script. (maybe-augment-load-paths!): Rename to ... (augment-load-paths!): ... this. Use 'and=3D>' for 'file-exists?'. (run-guix-main): Rename to ... (main): ... this. Call 'augment-load-paths!'. --- scripts/guix.in | 57 +++++++++++++++++++++++++++++------------------------= ---- 1 file changed, 29 insertions(+), 28 deletions(-) diff --git a/scripts/guix.in b/scripts/guix.in index af50a782b..e0f0ae7e0 100644 --- a/scripts/guix.in +++ b/scripts/guix.in @@ -1,4 +1,5 @@ -#!@GUILE@ --no-auto-compile +#!@GUILE@ \ +--no-auto-compile -e main -s -*- scheme -*- !# ;;; GNU Guix --- Functional package management for GNU @@ -25,34 +26,34 @@ ;; It's okay to import modules from core Guile though. (use-modules (srfi srfi-26)) =20 -(let () - (define-syntax-rule (push! elt v) (set! v (cons elt v))) +(define-syntax-rule (push! elt v) (set! v (cons elt v))) =20 - (define (maybe-augment-load-paths!) - (unless (getenv "GUIX_UNINSTALLED") - (push! "@guilemoduledir@" %load-path) - (push! "@guileobjectdir@" %load-compiled-path) - (let ((updates-dir (and=3D> (or (getenv "XDG_CONFIG_HOME") - (and=3D> (getenv "HOME") - (cut string-append <> "/.config= "))) - (cut string-append <> "/guix/latest")))) - (when (and updates-dir (file-exists? updates-dir)) - ;; XXX: Currently 'guix pull' puts both .scm and .go files in - ;; UPDATES-DIR. - (push! updates-dir %load-path) - (push! updates-dir %load-compiled-path))))) +(define (augment-load-paths!) + ;; Add installed modules to load-path. + (push! "@guilemoduledir@" %load-path) + (push! "@guileobjectdir@" %load-compiled-path) =20 - (define (run-guix-main) - (let ((guix-main (module-ref (resolve-interface '(guix ui)) - 'guix-main))) - (bindtextdomain "guix" "@localedir@") - (bindtextdomain "guix-packages" "@localedir@") - (apply guix-main (command-line)))) + ;; Add modules fetched by 'guix pull' to load-path. + (let ((updates-dir (and=3D> (or (getenv "XDG_CONFIG_HOME") + (and=3D> (getenv "HOME") + (cut string-append <> "/.config"))) + (cut string-append <> "/guix/latest")))) + (when (and=3D> updates-dir file-exists?) + ;; XXX: Currently 'guix pull' puts both .scm and .go files in + ;; UPDATES-DIR. + (push! updates-dir %load-path) + (push! updates-dir %load-compiled-path)))) =20 - (maybe-augment-load-paths!) +(define* (main #:optional (args (command-line))) + (unless (getenv "GUIX_UNINSTALLED") + (augment-load-paths!)) =20 - ;; XXX: It would be more convenient to change it to: - ;; (exit (run-guix-main)) - ;; but since the 'guix' command is not updated by 'guix pull', we cannot - ;; really do it now. - (run-guix-main)) + (let ((guix-main (module-ref (resolve-interface '(guix ui)) + 'guix-main))) + (bindtextdomain "guix" "@localedir@") + (bindtextdomain "guix-packages" "@localedir@") + ;; XXX: It would be more convenient to change it to: + ;; (exit (apply guix-main (command-line))) + ;; but since the 'guix' command is not updated by 'guix pull', we cann= ot + ;; really do it now. + (apply guix-main args))) --=20 2.16.0 --=-=-= Content-Type: text/plain -- Mathieu Lirzin GPG: F2A3 8D7E EB2B 6640 5761 070D 0ADE E100 9460 4D37 --=-=-=-- From unknown Thu Jul 31 07:49:06 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#30147] Simplify =?UTF-8?Q?=E2=80=9Cscripts/guix=E2=80=9D?= Resent-From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 23 Jan 2018 14:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30147 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: Mathieu Lirzin Cc: 30147-done@debbugs.gnu.org Received: via spool by 30147-done@debbugs.gnu.org id=D30147.151671611822839 (code D ref 30147); Tue, 23 Jan 2018 14:02:02 +0000 Received: (at 30147-done) by debbugs.gnu.org; 23 Jan 2018 14:01:58 +0000 Received: from localhost ([127.0.0.1]:39198 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1edz9C-0005wI-5a for submit@debbugs.gnu.org; Tue, 23 Jan 2018 09:01:58 -0500 Received: from hera.aquilenet.fr ([185.233.100.1]:43064) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1edz9A-0005w9-0B for 30147-done@debbugs.gnu.org; Tue, 23 Jan 2018 09:01:56 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id D4D4110671; Tue, 23 Jan 2018 15:01:54 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id BKBWa5mojHYU; Tue, 23 Jan 2018 15:01:54 +0100 (CET) Received: from ribbon (unknown [193.50.110.135]) by hera.aquilenet.fr (Postfix) with ESMTPSA id DC51410610; Tue, 23 Jan 2018 15:01:53 +0100 (CET) From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) References: <87inc0i8yt.fsf@gnu.org> <87fu6x7x9m.fsf@gnu.org> <87efmg92si.fsf@gnu.org> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 4 =?UTF-8?Q?Pluvi=C3=B4se?= an 226 de la =?UTF-8?Q?R=C3=A9volution?= 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, 23 Jan 2018 15:01:53 +0100 In-Reply-To: <87efmg92si.fsf@gnu.org> (Mathieu Lirzin's message of "Tue, 23 Jan 2018 13:29:17 +0100") Message-ID: <87bmhk7jxq.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 1.0 (+) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) Mathieu Lirzin skribis: >>> From b6f8331455da1ffc4896b06cd2ee98e09b05be43 Mon Sep 17 00:00:00 2001 >>> From: Mathieu Lirzin >>> Date: Wed, 17 Jan 2018 19:55:49 +0100 >>> Subject: [PATCH 2/2] guix: Refactor script. >>> MIME-Version: 1.0 >>> Content-Type: text/plain; charset=3DUTF-8 >>> Content-Transfer-Encoding: 8bit >>> >>> * scripts/guix.in: Use =E2=80=98and-let*=E2=80=99 and remove empty surr= ounding =E2=80=98let=E2=80=99. >>> (run-guix-main, maybe-augment-load-paths!): Inline them. >> >> This is entirely subjective but I prefer the current style (in fact I >> never use SRFI-2), so I=E2=80=99d rather skip this patch. WDYT? :-) > > I tried to avoid it, but the pipelining of checks for #f makes it very > tempting to use it. But indeed this is a matter of style, so let's not > use it. > > Here is an alternative patch that beside the pedantic issue of replacing > > (and updates-dir (file-exists? updates-dir)) > > with > > (and=3D> updates-dir file-exists?) > > removes the surrounding empty 'let' that doesn't make sense to me. > Additionaly the compilation of the script is now possible which is > convenient for basic syntax checks. This is done by using the =E2=80=98-= e main > -s=E2=80=99 command-line switches. > > From 77379bbf2642762927c01cc7f10eb5761626f172 Mon Sep 17 00:00:00 2001 > From: Mathieu Lirzin > Date: Tue, 23 Jan 2018 12:52:33 +0100 > Subject: [PATCH] guix: Refactor script. > MIME-Version: 1.0 > Content-Type: text/plain; charset=3DUTF-8 > Content-Transfer-Encoding: 8bit > > * scripts/guix.in: Remove empty surrounding =E2=80=98let=E2=80=99. Defin= e 'main' as the > procedure called when running the script. > (maybe-augment-load-paths!): Rename to ... > (augment-load-paths!): ... this. Use 'and=3D>' for 'file-exists?'. > (run-guix-main): Rename to ... > (main): ... this. Call 'augment-load-paths!'. Works for me. Applied and pushed, thanks! Ludo=E2=80=99. From unknown Thu Jul 31 07:49:06 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#30147] Simplify =?UTF-8?Q?=E2=80=9Cscripts/guix=E2=80=9D?= Resent-From: Mathieu Lirzin Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 24 Jan 2018 11:46:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30147 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Cc: 30147-done@debbugs.gnu.org Received: via spool by 30147-done@debbugs.gnu.org id=D30147.151679433024618 (code D ref 30147); Wed, 24 Jan 2018 11:46:01 +0000 Received: (at 30147-done) by debbugs.gnu.org; 24 Jan 2018 11:45:30 +0000 Received: from localhost ([127.0.0.1]:40398 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eeJUg-0006P0-5K for submit@debbugs.gnu.org; Wed, 24 Jan 2018 06:45:30 -0500 Received: from eggs.gnu.org ([208.118.235.92]:59871) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eeJUd-0006Ok-RQ for 30147-done@debbugs.gnu.org; Wed, 24 Jan 2018 06:45:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eeJUX-0007ZL-DG for 30147-done@debbugs.gnu.org; Wed, 24 Jan 2018 06:45:22 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:46029) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eeJUU-0007XM-VH; Wed, 24 Jan 2018 06:45:19 -0500 Received: from [2a01:e35:2ec2:e580:7d5f:f616:fc6f:3970] (port=45150 helo=godel) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1eeJUU-0004Mu-AL; Wed, 24 Jan 2018 06:45:18 -0500 From: Mathieu Lirzin References: <87inc0i8yt.fsf@gnu.org> <87fu6x7x9m.fsf@gnu.org> <87efmg92si.fsf@gnu.org> <87bmhk7jxq.fsf@gnu.org> Date: Wed, 24 Jan 2018 12:45:16 +0100 In-Reply-To: <87bmhk7jxq.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Tue, 23 Jan 2018 15:01:53 +0100") Message-ID: <87efmf32gj.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello again, ludo@gnu.org (Ludovic Court=C3=A8s) writes: > Mathieu Lirzin skribis: > >> From 77379bbf2642762927c01cc7f10eb5761626f172 Mon Sep 17 00:00:00 2001 >> From: Mathieu Lirzin >> Date: Tue, 23 Jan 2018 12:52:33 +0100 >> Subject: [PATCH] guix: Refactor script. >> MIME-Version: 1.0 >> Content-Type: text/plain; charset=3DUTF-8 >> Content-Transfer-Encoding: 8bit >> >> * scripts/guix.in: Remove empty surrounding =E2=80=98let=E2=80=99. Defi= ne 'main' as the >> procedure called when running the script. >> (maybe-augment-load-paths!): Rename to ... >> (augment-load-paths!): ... this. Use 'and=3D>' for 'file-exists?'. >> (run-guix-main): Rename to ... >> (main): ... this. Call 'augment-load-paths!'. > > Works for me. Applied and pushed, thanks! Thanks for applying this. I didn't notice that Emacs stopped setting =E2=80=98scheme-mode=E2=80=99 au= tomatically due to the extra line implied by the use of the Guile meta switch. Here is a fix to please Emacs. --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: inline; filename=0001-guix-Let-Emacs-detect-scripts-guix.in-appropriate-mo.patch Content-Transfer-Encoding: quoted-printable >From a798d6b7fa3b71faf85b4d415de99abccbfe7aab Mon Sep 17 00:00:00 2001 From: Mathieu Lirzin Date: Wed, 24 Jan 2018 12:29:17 +0100 Subject: [PATCH] =3D?UTF-8?q?guix:=3D20Let=3D20Emacs=3D20detect=3D20=3DE2= =3D80=3D9Cscripts?=3D =3D?UTF-8?q?/guix.in=3DE2=3D80=3D9D=3D20appropriate=3D20mode.?=3D MIME-Version: 1.0 Content-Type: text/plain; charset=3DUTF-8 Content-Transfer-Encoding: 8bit Since commit 6f774d481839f87178c5895ac2d661e141f879b8 which introduces the = use of Guile's meta switch in =E2=80=9Cscripts/guix.in=E2=80=9D, Emacs was not = using =E2=80=98scheme-mode=E2=80=99 for this file. * scripts/guix.in: Replace "-*- scheme -*-" with a local variable. --- scripts/guix.in | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/guix.in b/scripts/guix.in index e0f0ae7e0..d1c12eae5 100644 --- a/scripts/guix.in +++ b/scripts/guix.in @@ -1,6 +1,5 @@ #!@GUILE@ \ --no-auto-compile -e main -s --*- scheme -*- !# ;;; GNU Guix --- Functional package management for GNU ;;; Copyright =C2=A9 2013 Mark H Weaver @@ -57,3 +56,7 @@ ;; but since the 'guix' command is not updated by 'guix pull', we cann= ot ;; really do it now. (apply guix-main args))) + +;;; Local Variables: +;;; mode: scheme +;;; End: --=20 2.16.0 --=-=-= Content-Type: text/plain Sorry for the mess. -- Mathieu Lirzin GPG: F2A3 8D7E EB2B 6640 5761 070D 0ADE E100 9460 4D37 --=-=-=-- From unknown Thu Jul 31 07:49:06 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#30147] Simplify =?UTF-8?Q?=E2=80=9Cscripts/guix=E2=80=9D?= Resent-From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 24 Jan 2018 13:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30147 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: Mathieu Lirzin Cc: 30147-done@debbugs.gnu.org Received: via spool by 30147-done@debbugs.gnu.org id=D30147.151680160620266 (code D ref 30147); Wed, 24 Jan 2018 13:47:02 +0000 Received: (at 30147-done) by debbugs.gnu.org; 24 Jan 2018 13:46:46 +0000 Received: from localhost ([127.0.0.1]:40465 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eeLO2-0005Go-Lg for submit@debbugs.gnu.org; Wed, 24 Jan 2018 08:46:46 -0500 Received: from hera.aquilenet.fr ([185.233.100.1]:48982) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eeLO0-0005Ge-OQ for 30147-done@debbugs.gnu.org; Wed, 24 Jan 2018 08:46:45 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id ABDEF1087F; Wed, 24 Jan 2018 14:46:43 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id w1TCNQ_olo00; Wed, 24 Jan 2018 14:46:42 +0100 (CET) Received: from ribbon (unknown [IPv6:2a01:e0a:1d:7270:af76:b9b:ca24:c465]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 9A5AB10767; Wed, 24 Jan 2018 14:46:42 +0100 (CET) From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) References: <87inc0i8yt.fsf@gnu.org> <87fu6x7x9m.fsf@gnu.org> <87efmg92si.fsf@gnu.org> <87bmhk7jxq.fsf@gnu.org> <87efmf32gj.fsf@gnu.org> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 5 =?UTF-8?Q?Pluvi=C3=B4se?= an 226 de la =?UTF-8?Q?R=C3=A9volution?= 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: Wed, 24 Jan 2018 14:46:41 +0100 In-Reply-To: <87efmf32gj.fsf@gnu.org> (Mathieu Lirzin's message of "Wed, 24 Jan 2018 12:45:16 +0100") Message-ID: <87po5z2wu6.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 1.0 (+) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) Mathieu Lirzin skribis: > I didn't notice that Emacs stopped setting =E2=80=98scheme-mode=E2=80=99 = automatically > due to the extra line implied by the use of the Guile meta switch. > > Here is a fix to please Emacs. Perfect, thanks! Ludo'.