[OE-core] [PATCH] useradd-staticids.bbclass: Fix for Bug 6633

Fabrice Coulon fabrice.coulon at axis.com
Tue Sep 2 09:11:16 UTC 2014


From: Fabrice Coulon <fabrice at axis.com>

When using the useradd-staticids.bbclass under meta/classes,
this error occurs:
"<username> - <username>: Username  does not have a static uid defined."
There was a problem with the regular expression for parsing parameters,
it was sometimes returning an empty string.

I have fixed this by skipping empty strings.

Signed-off-by: Fabrice Coulon <fabrice at axis.com>
---
 meta/classes/useradd-staticids.bbclass | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/meta/classes/useradd-staticids.bbclass b/meta/classes/useradd-staticids.bbclass
index a89cb10..421a70a 100644
--- a/meta/classes/useradd-staticids.bbclass
+++ b/meta/classes/useradd-staticids.bbclass
@@ -58,7 +58,9 @@ def update_useradd_static_config(d):
 
         newparams = []
         for param in re.split('''[ \t]*;[ \t]*(?=(?:[^'"]|'[^']*'|"[^"]*")*$)''', params):
-            param=param.strip()
+            param = param.strip()
+            if not param:
+                continue
             try:
                 uaargs = parser.parse_args(re.split('''[ \t]*(?=(?:[^'"]|'[^']*'|"[^"]*")*$)''', param))
             except:
@@ -194,7 +196,9 @@ def update_useradd_static_config(d):
 
         newparams = []
         for param in re.split('''[ \t]*;[ \t]*(?=(?:[^'"]|'[^']*'|"[^"]*")*$)''', params):
-            param=param.strip()
+            param = param.strip()
+            if not param:
+                continue
             try:
                 # If we're processing multiple lines, we could have left over values here...
                 gaargs = parser.parse_args(re.split('''[ \t]*(?=(?:[^'"]|'[^']*'|"[^"]*")*$)''', param))
-- 
1.9.1




More information about the Openembedded-core mailing list