all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#27180: [PATCH core-updates] utils: Add helper method to invoke programs.
@ 2017-06-01  7:22 Danny Milosavljevic
  2017-06-01 12:13 ` Ludovic Courtès
  0 siblings, 1 reply; 3+ messages in thread
From: Danny Milosavljevic @ 2017-06-01  7:22 UTC (permalink / raw)
  To: 27180

* 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.

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-06-01 17:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-01  7:22 bug#27180: [PATCH core-updates] utils: Add helper method to invoke programs Danny Milosavljevic
2017-06-01 12:13 ` Ludovic Courtès
2017-06-01 17:09   ` Danny Milosavljevic

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.