all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Mark H Weaver <mhw@netris.org>
To: Kei Kebreau <kkebreau@posteo.net>
Cc: guix-devel@gnu.org
Subject: Simplifications enabled by switching to 'invoke'
Date: Wed, 24 Jan 2018 07:06:02 -0500	[thread overview]
Message-ID: <874lnbzck5.fsf_-_@netris.org> (raw)
In-Reply-To: <20180124010803.590AF2068F@vcs0.savannah.gnu.org> (Kei Kebreau's message of "Tue, 23 Jan 2018 20:08:03 -0500 (EST)")

Hello Kei, and other fellow Guix,

kkebreau@posteo.net (Kei Kebreau) writes:
> commit 0af6ffdd8d81f86a232902a54f99d4cfcd369490
> Author: Kei Kebreau <kkebreau@posteo.net>
> 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 <mhw@netris.org>
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

       reply	other threads:[~2018-01-24 12:08 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20180124010802.18874.3012@vcs0.savannah.gnu.org>
     [not found] ` <20180124010803.590AF2068F@vcs0.savannah.gnu.org>
2018-01-24 12:06   ` Mark H Weaver [this message]
2018-01-24 12:14     ` question regarding substitute* and #t (was: Simplifications enabled by switching to 'invoke') Andy Wingo
2018-01-24 13:28       ` question regarding substitute* and #t Mark H Weaver
2018-01-24 15:20         ` Andy Wingo
2018-01-24 21:09           ` Kei Kebreau
2018-01-25  5:31           ` Maxim Cournoyer
2018-01-25  7:51             ` Andy Wingo
2018-01-26  3:53               ` Maxim Cournoyer
2018-01-25  8:31         ` Arun Isaac
2018-01-25 20:02           ` Mark H Weaver
2018-01-24 14:45       ` Hartmut Goebel
2018-01-24 15:27         ` Andy Wingo
2018-01-24 22:10           ` Ricardo Wurmus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874lnbzck5.fsf_-_@netris.org \
    --to=mhw@netris.org \
    --cc=guix-devel@gnu.org \
    --cc=kkebreau@posteo.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.