From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark H Weaver Subject: Simplifications enabled by switching to 'invoke' Date: Wed, 24 Jan 2018 07:06:02 -0500 Message-ID: <874lnbzck5.fsf_-_@netris.org> References: <20180124010802.18874.3012@vcs0.savannah.gnu.org> <20180124010803.590AF2068F@vcs0.savannah.gnu.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:60571) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eeJrE-0002Wb-NA for guix-devel@gnu.org; Wed, 24 Jan 2018 07:08:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eeJr9-0005aX-IY for guix-devel@gnu.org; Wed, 24 Jan 2018 07:08:48 -0500 Received: from world.peace.net ([50.252.239.5]:40632) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eeJr9-00046T-8O for guix-devel@gnu.org; Wed, 24 Jan 2018 07:08:43 -0500 In-Reply-To: <20180124010803.590AF2068F@vcs0.savannah.gnu.org> (Kei Kebreau's message of "Tue, 23 Jan 2018 20:08:03 -0500 (EST)") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Kei Kebreau Cc: guix-devel@gnu.org Hello Kei, and other fellow Guix, kkebreau@posteo.net (Kei Kebreau) writes: > commit 0af6ffdd8d81f86a232902a54f99d4cfcd369490 > Author: Kei Kebreau > Date: Tue Jan 23 17:44:53 2018 -0500 > > gnu: qscintilla: Update to 2.10.2. > > * gnu/packages/qt.scm (qscintilla, python-qscintilla, python-pyqt+qscintilla): > Update to 2.10.2. [...] > @@ -1715,8 +1715,8 @@ indicators, code completion and call tips.") > (replace 'configure > (lambda* (#:key outputs configure-flags #:allow-other-keys) > (chdir "Python") > - (and (zero? (apply system* "python3" "configure.py" > - configure-flags)) > + (and (apply invoke "python3" "configure.py" > + configure-flags) > ;; Install to the right directory > (begin > (substitute* '("Makefile" Kei, I appreciate that you took this opportunity to switch from 'system*' to 'invoke' here while doing this update. I think it makes sense to do this whenever we update a package. However, it's worth noting that you missed an important further simplification that the switch to 'invoke' enables. Since 'invoke' never returns #false, the surrounding code that arranges for plumbing of its result code can be removed entirely. Step by step: * Since 'invoke' never returns #false, it can be moved above the 'and'. * This leaves the 'and' with only one remaining argument. An 'and' with only one argument is equivalent to that argument, so the 'and' can be removed, replaced by its argument. * Since the 'begin' is now within a body (whereas previously it was an operand), the 'begin' can now be removed, replaced by its contents. This is what I did in commit 76c7fc436a151236f5e1ff966fd99172d85ee422 on master, which I've attached below. Thanks, Mark >From 76c7fc436a151236f5e1ff966fd99172d85ee422 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Wed, 24 Jan 2018 06:35:29 -0500 Subject: [PATCH] gnu: python-qscintilla: Remove result code plumbing. * gnu/packages/qt.scm (python-qscintilla)[arguments]: In the 'configure' phase, remove result code plumbing that is no longer needed, since 'invoke' never returns #false. --- gnu/packages/qt.scm | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm index 596006080..34938b9c0 100644 --- a/gnu/packages/qt.scm +++ b/gnu/packages/qt.scm @@ -1715,15 +1715,14 @@ indicators, code completion and call tips.") (replace 'configure (lambda* (#:key outputs configure-flags #:allow-other-keys) (chdir "Python") - (and (apply invoke "python3" "configure.py" - configure-flags) - ;; Install to the right directory - (begin - (substitute* '("Makefile" - "Qsci/Makefile") - (("\\$\\(INSTALL_ROOT\\)/gnu/store/[^/]+") - (assoc-ref outputs "out"))) - #t))))))) + (apply invoke "python3" "configure.py" + configure-flags) + ;; Install to the right directory + (substitute* '("Makefile" + "Qsci/Makefile") + (("\\$\\(INSTALL_ROOT\\)/gnu/store/[^/]+") + (assoc-ref outputs "out"))) + #t))))) (inputs `(("qscintilla" ,qscintilla) ("python" ,python) -- 2.16.1