all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Danny Milosavljevic <dannym@scratchpost.org>
To: 27180@debbugs.gnu.org
Subject: bug#27180: [PATCH core-updates] utils: Add helper method to invoke programs.
Date: Thu,  1 Jun 2017 09:22:07 +0200	[thread overview]
Message-ID: <20170601072207.27718-1-dannym@scratchpost.org> (raw)

* guix/build/utils.scm (invoke): New variable.
---
 guix/build/utils.scm | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/guix/build/utils.scm b/guix/build/utils.scm
index 6d3c29d00..b2307d9d6 100644
--- a/guix/build/utils.scm
+++ b/guix/build/utils.scm
@@ -84,6 +84,7 @@
             fold-port-matches
             remove-store-references
             wrap-program
+            invoke
 
             locale-category->string))
 
@@ -1058,6 +1059,13 @@ with definitions for VARS."
         (chmod prog-tmp #o755)
         (rename-file prog-tmp prog))))
 
+(define invoke
+  "Invokes the program (array-ref ARGS 0) and gives it ARGS.
+   If the exit code is non-zero, raises an error."
+  (lambda args
+    (if (not (zero? (system* args)))
+      (error (format #f "Failed to invoke ~a" args)))))
+
 \f
 ;;;
 ;;; Locales.

             reply	other threads:[~2017-06-01  7:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-01  7:22 Danny Milosavljevic [this message]
2017-06-01 12:13 ` bug#27180: [PATCH core-updates] utils: Add helper method to invoke programs Ludovic Courtès
2017-06-01 17:09   ` Danny Milosavljevic

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=20170601072207.27718-1-dannym@scratchpost.org \
    --to=dannym@scratchpost.org \
    --cc=27180@debbugs.gnu.org \
    /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.