From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47659) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edufb-0002af-18 for guix-patches@gnu.org; Tue, 23 Jan 2018 04:15:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1edufW-0003xS-7K for guix-patches@gnu.org; Tue, 23 Jan 2018 04:15:07 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:59328) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1edufW-0003xF-2g for guix-patches@gnu.org; Tue, 23 Jan 2018 04:15:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1edufV-0005FB-Tv for guix-patches@gnu.org; Tue, 23 Jan 2018 04:15:01 -0500 Subject: bug#30147: Simplify =?UTF-8?Q?=E2=80=9Cscripts/guix=E2=80=9D?= Resent-To: guix-patches@gnu.org Resent-Message-ID: From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) References: <87inc0i8yt.fsf@gnu.org> 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> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Mathieu Lirzin Cc: 30147-done@debbugs.gnu.org --=-=-= 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. --=-=-=--