Quellcode durchsuchen

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 vor 4 Jahren
Ursprung
Commit
82882e9902
1 geänderte Dateien mit 1 neuen und 1 gelöschten Zeilen
  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)