all messages for Guix-related lists mirrored at yhetil.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 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.