Commit 27d587f7 authored by Adrian Freihofer's avatar Adrian Freihofer Committed by Stefano Babic
Browse files

swupdate-common: add find bitbake variables

The new function is supposed to read all variables from sw-description
file and add them to the vardeps of the do_swuimage task. Bitbake
cannot know that the do_swuimage task which evaluates the templated
sw-description file needs to be executed if a variable which is
refered by the sw-description file but not by the recipe itself.

Using this function should be optional. That's why it is not called yet.
Signed-off-by: default avatarAdrian Freihofer <>
parent 512c3417
......@@ -128,6 +128,39 @@ def swupdate_expand_bitbake_variables(d, s):
for line in write_lines:
# Get all the variables referred by the sw-description at parse time.
def swupdate_find_bitbake_variables(d):
import re
vardeps = []
filespath = d.getVar('FILESPATH')
sw_desc_path = bb.utils.which(filespath, "sw-description")
with open(sw_desc_path, "r") as f:
for line in f:
found = False
while True:
m = re.match(r"^(?P<before_placeholder>.+)@@(?P<bitbake_variable_name>\w+)@@(?P<after_placeholder>.+)$", line)
if m:
bitbake_variable_value ='bitbake_variable_name')
line ='before_placeholder') + bitbake_variable_value +'after_placeholder')
found = True
m = re.match(r"^(?P<before_placeholder>.+)@@(?P<bitbake_variable_name>.+)\[(?P<flag_var_name>.+)\]@@(?P<after_placeholder>.+)$", line)
if m:
bitbake_variable_value ='bitbake_variable_name')
flag_name ='flag_var_name')
line ='before_placeholder') + bitbake_variable_value +'after_placeholder')
except IOError:
return ' '.join(set(vardeps))
def swupdate_expand_auto_versions(d, s):
import re
import oe.packagedata
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment