ソースを参照

Allow empty variables in bitbake espansion

Even if the current check remind that a variable is maybe missing, there
are use cases where it is useful to replace an empty variable.

Signed-off-by: Stefano Babic <sbabic@denx.de>
Stefano Babic 7 年 前
コミット
ed9d6a1086
1 ファイル変更4 行追加4 行削除
  1. 4 4
      classes/swupdate-common.bbclass

+ 4 - 4
classes/swupdate-common.bbclass

@@ -38,10 +38,10 @@ def swupdate_expand_bitbake_variables(d, s):
             m = re.match(r"^(?P<before_placeholder>.+)@@(?P<bitbake_variable_name>\w+)@@(?P<after_placeholder>.+)$", line)
             if m:
                 bitbake_variable_value = d.getVar(m.group('bitbake_variable_name'), True)
-                if bitbake_variable_value:
-                    write_lines.append(m.group('before_placeholder') + bitbake_variable_value + m.group('after_placeholder') + "\n");
-                else:
-                    bb.fatal("BitBake variable %s not set" % (m.group('bitbake_variable_name')))
+                if bitbake_variable_value is None:
+                   bitbake_variable_value = ""
+                   bb.warn("BitBake variable %s not set" % (m.group('bitbake_variable_name')))
+                write_lines.append(m.group('before_placeholder') + bitbake_variable_value + m.group('after_placeholder') + "\n");
             else:
                 write_lines.append(line)