소스 검색

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 년 전
부모
커밋
a760a60402
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)