瀏覽代碼

swupdate-common: Allow to use sha256 as version

For images that do not have a version, but could use the
install-if-different flag, the sha256 sum could be used instead.  A
previous regex would allow this because the '@filname' was replaced
with the sha256, no matter what key the value was associated with.

The current regex is updated to support using the placeholder for both
the sha256 and version keys.

Signed-off-by: Colin McAllister <colin.mcallister@garmin.com>
Colin McAllister 4 年之前
父節點
當前提交
d9b54f5ec7
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      classes/swupdate-common.bbclass

+ 1 - 1
classes/swupdate-common.bbclass

@@ -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|version].+[=:].*(?P<quote>[\'\"])@(?P<filename>.*)(?P=quote)", line)
           if m:
               filename = m.group('filename')
               hash = swupdate_get_sha256(s, filename)