瀏覽代碼

swupdate-common: fix sha256 regex

Change sha256 regex brackets to parenthesis to apply only on line with 'sha256'
and 'version'.

Signed-off-by: Louis Rannou <louis.rannou@gresille.org>
Louis Rannou 3 年之前
父節點
當前提交
8f54376736
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      classes/swupdate-common.bbclass

+ 1 - 1
classes/swupdate-common.bbclass

@@ -81,7 +81,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|version].+[=:].*(?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)