Message ID | 20210914201335.18948-1-colin.mcallister@garmin.com |
---|---|
State | Accepted |
Headers | show |
Series | [meta-swupdate] swupdate-common: Modify sha256 placeholder regex | expand |
Not sure how to specify this other than sending in another patch, but can this patch be applied to the Dunfell branch in addition to master? Colin On Tuesday, September 14, 2021 at 3:13:44 PM UTC-5 Colin McAllister wrote: > From: Colin McAllister <colin.mc...@garmin.com> > > Updated the regex to detect placeholders for sha256 checksums in JSON > formatted sw-description files in addition to libconfig formatted files. > > Signed-off-by: Colin McAllister <colin.mc...@garmin.com> > --- > classes/swupdate-common.bbclass | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/classes/swupdate-common.bbclass > b/classes/swupdate-common.bbclass > index dabd466..497ef43 100644 > --- a/classes/swupdate-common.bbclass > +++ b/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.+[=:].*(?P<quote>[\'\"])@(?P<filename>.*)(?P=quote)", > line) > if m: > filename = m.group('filename') > hash = swupdate_get_sha256(s, filename) > -- > 2.25.1 > >
On 14.09.21 22:13, colin.mcallister via swupdate wrote: > From: Colin McAllister <colin.mcallister@garmin.com> > > Updated the regex to detect placeholders for sha256 checksums in JSON > formatted sw-description files in addition to libconfig formatted files. > > Signed-off-by: Colin McAllister <colin.mcallister@garmin.com> > --- > classes/swupdate-common.bbclass | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/classes/swupdate-common.bbclass b/classes/swupdate-common.bbclass > index dabd466..497ef43 100644 > --- a/classes/swupdate-common.bbclass > +++ b/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.+[=:].*(?P<quote>[\'\"])@(?P<filename>.*)(?P=quote)", line) > if m: > filename = m.group('filename') > hash = swupdate_get_sha256(s, filename) > Tested-by: Stefano Babic <sbabic@denx.de> Applied to -master, -hardknott, -dunfell, thanks ! Best regards, Stefano Babic
diff --git a/classes/swupdate-common.bbclass b/classes/swupdate-common.bbclass index dabd466..497ef43 100644 --- a/classes/swupdate-common.bbclass +++ b/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.+[=:].*(?P<quote>[\'\"])@(?P<filename>.*)(?P=quote)", line) if m: filename = m.group('filename') hash = swupdate_get_sha256(s, filename)