diff mbox series

[meta,12/12] Raise a warning if old syntax for sha256 is used

Message ID 20220405071005.3855186-13-sbabic@denx.de
State Changes Requested
Headers show
Series Support to call functions inside sw-description | expand

Commit Message

Stefano Babic April 5, 2022, 7:10 a.m. UTC
Generation of attributes in sw-description should be done by separate
function. The old syntax with '@<artifact name>' is still allowed for
compatibility reason, but it will be removed in future.

Signed-off-by: Stefano Babic <sbabic@denx.de>
---
 classes/swupdate-common.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/classes/swupdate-common.bbclass b/classes/swupdate-common.bbclass
index 1ee241d..37403c0 100644
--- a/classes/swupdate-common.bbclass
+++ b/classes/swupdate-common.bbclass
@@ -57,10 +57,10 @@  def swupdate_write_sha256(s):
     with open(os.path.join(s, "sw-description"), 'r') as f:
        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)
           if m:
               filename = m.group('filename')
+              bb.warn("Syntax for sha256 changed, please use $swupdate_get_sha256(%s)" % filename)
               hash = swupdate_get_sha256(None, s, filename)
               write_lines.append(line.replace("@%s" % (filename), hash))
           else: