~mil/mepo-devel

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
1

[PATCH mepo] Drop usage of non-standard xargs flag

Details
Message ID
<20240711235407.9356-2-hugo@whynothugo.nl>
DKIM signature
pass
Download raw message
Patch: +2 -1
A single usage of xargs relies on the -d flag, which is specific
to gnu findutils and not available in other xargs implementations
(e.g.: busybox, bsd, etc).

Drop this flag by simply replacing newlines in the input stream.

This drops findutils as a dependency.
---
 scripts/mepo_ui_helper_menu.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/scripts/mepo_ui_helper_menu.sh b/scripts/mepo_ui_helper_menu.sh
index 55f1047..2f6c3a5 100755
--- a/scripts/mepo_ui_helper_menu.sh
+++ b/scripts/mepo_ui_helper_menu.sh
@@ -46,7 +46,8 @@ inputzenity() {
    OPTS="$(printf %b "$OPTS" | tr -d \" | awk NF)"
    RESULT="$(
      echo "$OPTS" |
      xargs -d"\\n" zenity $(zenitydims 0.8 0.8) --title "Select an entry" --list --column=Selection --text "$PROMPT"
      tr '\n' '\0' |
      xargs -0 zenity $(zenitydims 0.8 0.8) --title "Select an entry" --list --column=Selection --text "$PROMPT"
    )"
    if [ "$RESULT" = "Type Custom" ]; then
      TEXTINPUT=1 inputzenity
-- 
2.45.2
Details
Message ID
<4885a941-66ff-4084-9b44-613252a3b4ae@app.fastmail.com>
In-Reply-To
<20240711235407.9356-2-hugo@whynothugo.nl> (view parent)
DKIM signature
pass
Download raw message
On Thu, Jul 11, 2024, at 7:54 PM, Hugo Osvaldo Barrera wrote:
> A single usage of xargs relies on the -d flag, which is specific
> to gnu findutils and not available in other xargs implementations
> (e.g.: busybox, bsd, etc).
>
> Drop this flag by simply replacing newlines in the input stream.
>
> This drops findutils as a dependency.
> ---
>  scripts/mepo_ui_helper_menu.sh | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/scripts/mepo_ui_helper_menu.sh 
> b/scripts/mepo_ui_helper_menu.sh
> index 55f1047..2f6c3a5 100755
> --- a/scripts/mepo_ui_helper_menu.sh
> +++ b/scripts/mepo_ui_helper_menu.sh
> @@ -46,7 +46,8 @@ inputzenity() {
>      OPTS="$(printf %b "$OPTS" | tr -d \" | awk NF)"
>      RESULT="$(
>        echo "$OPTS" |
> -      xargs -d"\\n" zenity $(zenitydims 0.8 0.8) --title "Select an 
> entry" --list --column=Selection --text "$PROMPT"
> +      tr '\n' '\0' |
> +      xargs -0 zenity $(zenitydims 0.8 0.8) --title "Select an entry" 
> --list --column=Selection --text "$PROMPT"
>      )"
>      if [ "$RESULT" = "Type Custom" ]; then
>        TEXTINPUT=1 inputzenity
> -- 
> 2.45.2

Awesome - had wanted to figure out how to drop findutils sometime back.

Thanks for figuring this out & sending - applied.
Reply to thread Export thread (mbox)