GNU bug report logs -
#27180
[PATCH core-updates] utils: Add helper method to invoke programs.
Previous Next
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 27180 in the body.
You can then email your comments to 27180 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
guix-patches <at> gnu.org
:
bug#27180
; Package
guix-patches
.
(Thu, 01 Jun 2017 07:23:01 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Danny Milosavljevic <dannym <at> scratchpost.org>
:
New bug report received and forwarded. Copy sent to
guix-patches <at> gnu.org
.
(Thu, 01 Jun 2017 07:23:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
* 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)))))
+
;;;
;;; Locales.
Information forwarded
to
guix-patches <at> gnu.org
:
bug#27180
; Package
guix-patches
.
(Thu, 01 Jun 2017 12:14:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 27180 <at> debbugs.gnu.org (full text, mbox):
Danny Milosavljevic <dannym <at> scratchpost.org> skribis:
> * 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)))))
Good idea. I would suggest writing it this way though:
(define (invoke program . args)
"Invoke PROGRAM with the given ARGS. Raise an error if the exit
code is non-zero; otherwise return #t."
(let ((status (apply system* program args)))
(unless (zero? status)
(error (format #f "program ~s exited with non-zero code" program)
status))
#t))
If that’s fine with you, please push to ‘core-updates’. (Just in time!)
Thanks,
Ludo’.
Reply sent
to
Danny Milosavljevic <dannym <at> scratchpost.org>
:
You have taken responsibility.
(Thu, 01 Jun 2017 17:10:02 GMT)
Full text and
rfc822 format available.
Notification sent
to
Danny Milosavljevic <dannym <at> scratchpost.org>
:
bug acknowledged by developer.
(Thu, 01 Jun 2017 17:10:02 GMT)
Full text and
rfc822 format available.
Message #13 received at 27180-done <at> debbugs.gnu.org (full text, mbox):
Good idea to end it with #t :)
Pushed your variant as 3f65c190d23296e7e718c3deff413e8beb61d8ba to core-updates.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Fri, 30 Jun 2017 11:24:05 GMT)
Full text and
rfc822 format available.
This bug report was last modified 8 years and 69 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.