meta-qt6/classes/srcrev-update.bbclass
Samuli Piippo f61b87ae78 Move all Qt module SRCREVs into one file
Move all the module SRCREV into qt6-git.inc file using the same format,
where repository name is used for the postfix. Changes to the module SRCREVs
are mostly done by updating all the modules at once, usually either with
a separate update script, srcrev_update bbclass or by external update bot.
This change should make the update process more easily automated.

Update the srcrev_update bbclass to handle updates in qt6-git.inc in addition
to recipe files, with and without the repository name postfix.

Pick-to: 6.2
Change-Id: I711e7867dba3b066d363ca40f78e7b4aa740a69c
Reviewed-by: Mikko Gronoff <mikko.gronoff@qt.io>
2021-09-15 07:53:53 +03:00

36 lines
1.1 KiB
Plaintext

python do_srcrev_update() {
import subprocess
recipe = d.getVar('FILE')
srcrev_file = os.path.join(os.path.dirname(recipe), 'qt6-git.inc')
module = d.getVar('QT_MODULE')
scms = []
fetcher = bb.fetch2.Fetch(d.getVar('SRC_URI').split(), d)
urldata = fetcher.ud
for u in urldata:
if urldata[u].method.supports_srcrev():
scms.append(u)
if len(scms) == 0:
return
for scm in scms:
ud = urldata[scm]
for name in ud.names:
rev = ud.method.latest_revision(ud, d, name)
srcrev = d.getVar("SRCREV_%s" % name)
if srcrev is None: srcrev = d.getVar("SRCREV")
if srcrev == rev:
bb.plain("%s: %s is already latest" % (name, srcrev))
continue
bb.plain("%s: %s -> %s" % (name, srcrev, rev))
cmd = "sed -E -i %s %s -e '/SRCREV(_%s)? /s/%s/%s/'" % (recipe, srcrev_file, name, srcrev, rev)
bb.process.run(cmd, log=None, shell=True, stderr=subprocess.PIPE, cwd=None)
}
do_srcrev_update[nostamp] = "1"
addtask srcrev_update after do_fetch