unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* A capture-stdout wrapper procedure in (guix build utils)?
@ 2024-04-20 22:26 Fabio Natali
  2024-04-21 15:35 ` Felix Lechner via Development of GNU Guix and the GNU System distribution.
  0 siblings, 1 reply; 3+ messages in thread
From: Fabio Natali @ 2024-04-20 22:26 UTC (permalink / raw)
  To: guix-devel

Hallo,

I noticed this capture-stdout wrapper procedure while reviewing Tomas'
patch 68289⁰:

,----
| (define (capture-stdout . prog+args)
|   (let* ((port (apply open-pipe* OPEN_READ prog+args))
|          (data (get-string-all port)))
|     (if (= 0 (status:exit-val (close-pipe port)))
|         (string-trim-right data #\newline)
|         (error "command failed"))))
`----

Since this seems to be a somewhat general and useful pattern, do you
think it might be worth to add it (or a variation thereof) to '(guix
build utils)'?

Thanks, best wishes, Fabio.


⁰ https://issues.guix.gnu.org/issue/68289/#0-lineno93


-- 
Fabio Natali
https://fabionatali.com


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

end of thread, other threads:[~2024-04-23 15:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-20 22:26 A capture-stdout wrapper procedure in (guix build utils)? Fabio Natali
2024-04-21 15:35 ` Felix Lechner via Development of GNU Guix and the GNU System distribution.
2024-04-23 15:38   ` Fabio Natali

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).