Commit 512c3417 authored by Colin McAllister's avatar Colin McAllister Committed by Stefano Babic
Browse files

swupdate-common: Modify sha256 placeholder regex



Updated the regex to detect placeholders for sha256 checksums in JSON
formatted sw-description files in addition to libconfig formatted files.
Signed-off-by: default avatarColin McAllister <colin.mcallister@garmin.com>
Tested-by: Stefano Babic's avatarStefano Babic <sbabic@denx.de>
parent d2fa5215
......@@ -80,7 +80,7 @@ def swupdate_write_sha256(s):
for line in f:
shastr = r"sha256.+=.+@(.+\")"
#m = re.match(r"^(?P<before_placeholder>.+)sha256.+=.+(?P<filename>\w+)", line)
m = re.match(r"^(?P<before_placeholder>.+)sha256.+=.+(?P<quote>[\'\"])@(?P<filename>.*)(?P=quote)", line)
m = re.match(r"^(?P<before_placeholder>.+)sha256.+[=:].*(?P<quote>[\'\"])@(?P<filename>.*)(?P=quote)", line)
if m:
filename = m.group('filename')
hash = swupdate_get_sha256(s, filename)
......
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