]> code.ossystems Code Review - openembedded-core.git/commitdiff
useradd-staticids.bbclass: Avoid FutureWarning about split()
authorPeter Kjellerstedt <peter.kjellerstedt@axis.com>
Fri, 10 Jun 2016 15:46:11 +0000 (17:46 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sun, 12 Jun 2016 22:46:51 +0000 (23:46 +0100)
This avoids the following warning with Python 3.5:

  /usr/lib64/python3.5/re.py:203: FutureWarning: split() requires a
  non-empty pattern

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/classes/useradd-staticids.bbclass

index 440c0e384602396df295fb38cc795bd574a58aad..d963f283b718182acce61831f0aadbba281fc170 100644 (file)
@@ -97,7 +97,7 @@ def update_useradd_static_config(d):
             if not param:
                 continue
             try:
-                uaargs = parser.parse_args(re.split('''[ \t]*(?=(?:[^'"]|'[^']*'|"[^"]*")*$)''', param))
+                uaargs = parser.parse_args(re.split('''[ \t]+(?=(?:[^'"]|'[^']*'|"[^"]*")*$)''', param))
             except:
                 raise bb.build.FuncFailed("%s: Unable to parse arguments for USERADD_PARAM_%s: '%s'" % (d.getVar('PN', True), pkg, param))
 
@@ -231,7 +231,7 @@ def update_useradd_static_config(d):
                 continue
             try:
                 # If we're processing multiple lines, we could have left over values here...
-                gaargs = parser.parse_args(re.split('''[ \t]*(?=(?:[^'"]|'[^']*'|"[^"]*")*$)''', param))
+                gaargs = parser.parse_args(re.split('''[ \t]+(?=(?:[^'"]|'[^']*'|"[^"]*")*$)''', param))
             except:
                 raise bb.build.FuncFailed("%s: Unable to parse arguments for GROUPADD_PARAM_%s: '%s'" % (d.getVar('PN', True), pkg, param))