From: William Sherrer <william.sherrer1@gmail.com>
To: buildroot@buildroot.org
Cc: William Sherrer <william.sherrer1@gmail.com>
Subject: [Buildroot] [PATCH 1/1] support/scripts/mkusers: fix double comma in group member list
Date: Mon, 9 Nov 2026 13:17:08 -0500 [thread overview]
Message-ID: <20261109181708.768625-1-william.sherrer1@gmail.com> (raw)
When add_user_to_group() updates an existing user, it removes the
current entry from the list and appends the user to the end. If the user
was in the middle of a list (e.g. "user1,user2,user3,user4"), remove "user3"
leaves a double command (e.g. "user1,user2,,user4,user3").
The cleanup regex `s/,+/,` matches on the first comma but fails to
collapse subsequent ones since it lacks the global flag.
This commit adds the `g` flag so consectutive commas are collapsed.
Signed-off-by: William Sherrer <william.sherrer1@gmail.com>
---
support/scripts/mkusers | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/support/scripts/mkusers b/support/scripts/mkusers
index 87a36a89a1..581df86f3e 100755
--- a/support/scripts/mkusers
+++ b/support/scripts/mkusers
@@ -300,7 +300,7 @@ add_user_to_group() {
sed -r -i --follow-symlinks \
-e 's/^('"${group}"':.*:)(([^:]+,)?)'"${username}"'(,[^:]+*)?$/\1\2\4/;' \
-e 's/^('"${group}"':.*)$/\1,'"${username}"'/;' \
- -e 's/,+/,/' \
+ -e 's/,+/,/g' \
-e 's/:,/:/' \
"${_f}"
done
--
2.43.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
reply other threads:[~2026-11-09 18:17 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261109181708.768625-1-william.sherrer1@gmail.com \
--to=william.sherrer1@gmail.com \
--cc=buildroot@buildroot.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox