all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#51791] [PATCH 0/2]: Update guile-bash
@ 2021-11-12 13:56 david larsson
  2021-11-12 14:00 ` [bug#51791] [PATCH 1/2]: " david larsson
                   ` (6 more replies)
  0 siblings, 7 replies; 9+ messages in thread
From: david larsson @ 2021-11-12 13:56 UTC (permalink / raw)
  To: 51791

Hi,

The following 2 patches update the guile-bash source url and home-page, 
and adds a patch for it that does 2 things:
   - fixes a bug, see below
   - enables reading newline- or null-separated arguments via stdin to 
guile-bash-defined bash functions.

The bug is that guile-bash can't read string args with whitespaces in 
it. Example:
------------------------
~$ enable -f ~/.guix-profile/lib/bash/libguile-bash.so scm
~$ scm /tmp/printargs
~$ printargs "apa bepa" cepa
In procedure printargs: scm-function called from Bash with args (apa 
bepa cepa) failed to match signature (file1 file2)
~$ cat /tmp/printargs
(use-modules
  (gnu bash))
(define-bash-function (printargs file1 file2)
     (display file1)
     (display "\n")
     (display file2)
     (display "\n"))
-------------------------

After this patch, you can read args "as normal", or via stdin that are 
either newline- or null-separated:
-------------------------
~$ printargs "apa bepa" cepa
apa bepa
cepa
~$ echo "$apa"
aba
aca
~$ printf '%s\0' "$apa" bepa | printargs -z
aba
aca
bepa
~$ echo "$apa" | printargs
aba
aca
-------------------------

Best regards,
David




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

end of thread, other threads:[~2021-12-15 12:16 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-12 13:56 [bug#51791] [PATCH 0/2]: Update guile-bash david larsson
2021-11-12 14:00 ` [bug#51791] [PATCH 1/2]: " david larsson
2021-11-12 14:01 ` david larsson
2021-11-12 15:50 ` [bug#51791] [PATCH 2/2]: " david larsson
2021-11-26 19:16   ` [bug#51791] [PATCH 2/2 v2]: " david larsson
2021-12-01  7:20 ` [bug#51791] [PATCH 0/2]: " Ricardo Wurmus
2021-12-01 10:28 ` david larsson
2021-12-15 11:54 ` david larsson
2021-12-15 11:55 ` bug#51791: done david larsson

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.