<p dir="ltr">Thanks Richard </p>
<div class="gmail_quote">On May 23, 2016 2:33 AM, "Richard Purdie" <<a href="mailto:richard.purdie@linuxfoundation.org">richard.purdie@linuxfoundation.org</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><a href="http://git.openembedded.org/openembedded-core-contrib/commit/?id=642c6cf0b6a0371de476513162bd0cefa9c438b3" rel="noreferrer" target="_blank">http://git.openembedded.org/openembedded-core-contrib/commit/?id=642c6cf0b6a0371de476513162bd0cefa9c438b3</a><br>
introduces a problem if the USERADD_PARAM variable has trailing<br>
whitespace as the code infinitely loops causing build hangs.<br>
<br>
Add a similar sed expression to $remaining to avoid this.<br>
<br>
Signed-off-by: Richard Purdie <<a href="mailto:richard.purdie@linuxfoundation.org">richard.purdie@linuxfoundation.org</a>><br>
<br>
diff --git a/meta/classes/useradd.bbclass b/meta/classes/useradd.bbclass<br>
index 67dae88..28dd341 100644<br>
--- a/meta/classes/useradd.bbclass<br>
+++ b/meta/classes/useradd.bbclass<br>
@@ -55,14 +55,14 @@ if test "x`echo $GROUPADD_PARAM | tr -d '[:space:]'`" != "x"; then<br>
# Invoke multiple instances of groupadd for parameter lists<br>
# separated by ';'<br>
opts=`echo "$GROUPADD_PARAM" | cut -d ';' -f 1 | sed -e 's#[ \t]*$##'`<br>
- remaining=`echo "$GROUPADD_PARAM" | cut -d ';' -f 2-`<br>
+ remaining=`echo "$GROUPADD_PARAM" | cut -d ';' -f 2- | sed -e 's#[ \t]*$##'`<br>
while test "x$opts" != "x"; do<br>
perform_groupadd "$SYSROOT" "$OPT $opts"<br>
if test "x$opts" = "x$remaining"; then<br>
break<br>
fi<br>
opts=`echo "$remaining" | cut -d ';' -f 1 | sed -e 's#[ \t]*$##'`<br>
- remaining=`echo "$remaining" | cut -d ';' -f 2-`<br>
+ remaining=`echo "$remaining" | cut -d ';' -f 2- | sed -e 's#[ \t]*$##'`<br>
done<br>
fi<br>
<br>
@@ -71,14 +71,14 @@ if test "x`echo $USERADD_PARAM | tr -d '[:space:]'`" != "x"; then<br>
# Invoke multiple instances of useradd for parameter lists<br>
# separated by ';'<br>
opts=`echo "$USERADD_PARAM" | cut -d ';' -f 1 | sed -e 's#[ \t]*$##'`<br>
- remaining=`echo "$USERADD_PARAM" | cut -d ';' -f 2-`<br>
+ remaining=`echo "$USERADD_PARAM" | cut -d ';' -f 2- | sed -e 's#[ \t]*$##'`<br>
while test "x$opts" != "x"; do<br>
perform_useradd "$SYSROOT" "$OPT $opts"<br>
if test "x$opts" = "x$remaining"; then<br>
break<br>
fi<br>
opts=`echo "$remaining" | cut -d ';' -f 1 | sed -e 's#[ \t]*$##'`<br>
- remaining=`echo "$remaining" | cut -d ';' -f 2-`<br>
+ remaining=`echo "$remaining" | cut -d ';' -f 2- | sed -e 's#[ \t]*$##'`<br>
done<br>
fi<br>
<br>
@@ -87,14 +87,14 @@ if test "x`echo $GROUPMEMS_PARAM | tr -d '[:space:]'`" != "x"; then<br>
# Invoke multiple instances of groupmems for parameter lists<br>
# separated by ';'<br>
opts=`echo "$GROUPMEMS_PARAM" | cut -d ';' -f 1 | sed -e 's#[ \t]*$##'`<br>
- remaining=`echo "$GROUPMEMS_PARAM" | cut -d ';' -f 2-`<br>
+ remaining=`echo "$GROUPMEMS_PARAM" | cut -d ';' -f 2- | sed -e 's#[ \t]*$##'`<br>
while test "x$opts" != "x"; do<br>
perform_groupmems "$SYSROOT" "$OPT $opts"<br>
if test "x$opts" = "x$remaining"; then<br>
break<br>
fi<br>
opts=`echo "$remaining" | cut -d ';' -f 1 | sed -e 's#[ \t]*$##'`<br>
- remaining=`echo "$remaining" | cut -d ';' -f 2-`<br>
+ remaining=`echo "$remaining" | cut -d ';' -f 2- | sed -e 's#[ \t]*$##'`<br>
done<br>
fi<br>
}<br>
<br>
<br>
--<br>
_______________________________________________<br>
Openembedded-core mailing list<br>
<a href="mailto:Openembedded-core@lists.openembedded.org">Openembedded-core@lists.openembedded.org</a><br>
<a href="http://lists.openembedded.org/mailman/listinfo/openembedded-core" rel="noreferrer" target="_blank">http://lists.openembedded.org/mailman/listinfo/openembedded-core</a><br>
</blockquote></div>