diff options
| author | Bogdan Oprescu <bogdan.oprescu@enea.com> | 2022-11-07 09:27:26 +0100 |
|---|---|---|
| committer | Bogdan Oprescu <bogdan.oprescu@enea.com> | 2023-01-23 11:15:55 +0100 |
| commit | 024e69ac94583a965d415b777935d6d634863901 (patch) | |
| tree | 087036b29745907bbc91668552b93b25d41563e6 /classes | |
| parent | 255f2098b16aa1f7e8600e30ab9db59a669a3d79 (diff) | |
| download | meta-el-common-024e69ac94583a965d415b777935d6d634863901.tar.gz | |
Update layer for kirkstone build
Change-Id: Iee0a4b00b50e4a5e362aea386c7af0c7c7439fcb
Signed-off-by: Bogdan Oprescu <bogdan.oprescu@enea.com>
Diffstat (limited to 'classes')
| -rw-r--r-- | classes/distrodata.bbclass | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/classes/distrodata.bbclass b/classes/distrodata.bbclass new file mode 100644 index 0000000..dc06177 --- /dev/null +++ b/classes/distrodata.bbclass | |||
| @@ -0,0 +1,86 @@ | |||
| 1 | addtask distrodata | ||
| 2 | do_distrodata[nostamp] = "1" | ||
| 3 | python do_distrodata() { | ||
| 4 | import csv | ||
| 5 | logpath = d.getVar('LOG_DIR') | ||
| 6 | bb.utils.mkdirhier(logpath) | ||
| 7 | logfile = os.path.join(logpath, "distrodata.csv") | ||
| 8 | |||
| 9 | localdata = bb.data.createCopy(d) | ||
| 10 | tmpdir = d.getVar('TMPDIR') | ||
| 11 | distro_check_dir = os.path.join(tmpdir, "distro_check") | ||
| 12 | |||
| 13 | pn = d.getVar("PN") | ||
| 14 | bb.note("Package Name: %s" % pn) | ||
| 15 | |||
| 16 | if pn.find("-native") != -1: | ||
| 17 | pnstripped = pn.split("-native") | ||
| 18 | bb.note("Native Split: %s" % pnstripped) | ||
| 19 | localdata.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + d.getVar('OVERRIDES')) | ||
| 20 | |||
| 21 | if pn.startswith("nativesdk-"): | ||
| 22 | pnstripped = pn.replace("nativesdk-", "") | ||
| 23 | bb.note("NativeSDK Split: %s" % pnstripped) | ||
| 24 | localdata.setVar('OVERRIDES', "pn-" + pnstripped + ":" + d.getVar('OVERRIDES')) | ||
| 25 | |||
| 26 | if pn.find("-cross") != -1: | ||
| 27 | pnstripped = pn.split("-cross") | ||
| 28 | bb.note("cross Split: %s" % pnstripped) | ||
| 29 | localdata.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + d.getVar('OVERRIDES')) | ||
| 30 | |||
| 31 | if pn.find("-crosssdk") != -1: | ||
| 32 | pnstripped = pn.split("-crosssdk") | ||
| 33 | bb.note("cross Split: %s" % pnstripped) | ||
| 34 | localdata.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + d.getVar('OVERRIDES')) | ||
| 35 | |||
| 36 | if pn.find("-initial") != -1: | ||
| 37 | pnstripped = pn.split("-initial") | ||
| 38 | bb.note("initial Split: %s" % pnstripped) | ||
| 39 | localdata.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + d.getVar('OVERRIDES')) | ||
| 40 | |||
| 41 | """generate package information from .bb file""" | ||
| 42 | pname = localdata.getVar('PN') | ||
| 43 | pcurver = localdata.getVar('PV') | ||
| 44 | pdesc = localdata.getVar('DESCRIPTION') | ||
| 45 | if pdesc is not None: | ||
| 46 | pdesc = pdesc.replace(',','') | ||
| 47 | pdesc = pdesc.replace('\n','') | ||
| 48 | |||
| 49 | |||
| 50 | pgrp = localdata.getVar('SECTION') | ||
| 51 | plicense = localdata.getVar('LICENSE').replace(',','_') | ||
| 52 | |||
| 53 | rstatus = localdata.getVar('RECIPE_COLOR') | ||
| 54 | if rstatus is not None: | ||
| 55 | rstatus = rstatus.replace(',','') | ||
| 56 | |||
| 57 | pupver = localdata.getVar('RECIPE_UPSTREAM_VERSION') | ||
| 58 | if pcurver == pupver: | ||
| 59 | vermatch="1" | ||
| 60 | else: | ||
| 61 | vermatch="0" | ||
| 62 | |||
| 63 | noupdate_reason = localdata.getVar('RECIPE_NO_UPDATE_REASON') | ||
| 64 | if noupdate_reason is None: | ||
| 65 | noupdate="0" | ||
| 66 | else: | ||
| 67 | noupdate="1" | ||
| 68 | noupdate_reason = noupdate_reason.replace(',','') | ||
| 69 | |||
| 70 | maintainer = localdata.getVar('RECIPE_MAINTAINER') | ||
| 71 | rlrd = localdata.getVar('RECIPE_UPSTREAM_DATE') | ||
| 72 | # do the comparison | ||
| 73 | result = "" | ||
| 74 | |||
| 75 | lf = bb.utils.lockfile("%s.lock" % logfile) | ||
| 76 | with open(logfile, "a") as f: | ||
| 77 | row = [pname, pdesc, maintainer, plicense, vermatch, pcurver, pupver, noupdate_reason, rstatus] | ||
| 78 | row.extend(result) | ||
| 79 | |||
| 80 | writer = csv.writer(f) | ||
| 81 | writer.writerow(row) | ||
| 82 | f.close() | ||
| 83 | bb.utils.unlockfile(lf) | ||
| 84 | } | ||
| 85 | do_distrodata[vardepsexclude] = "DATETIME" | ||
| 86 | |||
