summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2024-10-03 23:52:25 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-10-08 13:26:39 +0100
commit35c3b9132d9ea3bc20d5744f7027156ef1049b7c (patch)
tree275deeeaf6524b05796dd18ec1d3709d84709cef /meta/classes
parent64e1d81be2e1e5fc466dbe3f025fe9aab074feab (diff)
downloadpoky-35c3b9132d9ea3bc20d5744f7027156ef1049b7c.tar.gz
migrate_localcount: Drop long obsolete code
If BB_URI_LOCALCOUNT isn't set, the code does nothing. That code was removed in 2012: https://git.yoctoproject.org/poky/commit/?id=d0f35207f9e19b440393a79ebf621649c495738d Therefore drop the rest of it! (From OE-Core rev: fca25fc4d7721f85f64c942307ebe7ba9f2fad3e) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/migrate_localcount.bbclass52
1 files changed, 0 insertions, 52 deletions
diff --git a/meta/classes/migrate_localcount.bbclass b/meta/classes/migrate_localcount.bbclass
deleted file mode 100644
index 1d00c110e2..0000000000
--- a/meta/classes/migrate_localcount.bbclass
+++ /dev/null
@@ -1,52 +0,0 @@
1#
2# Copyright OpenEmbedded Contributors
3#
4# SPDX-License-Identifier: MIT
5#
6
7PRSERV_DUMPDIR ??= "${LOG_DIR}/db"
8LOCALCOUNT_DUMPFILE ??= "${PRSERV_DUMPDIR}/prserv-localcount-exports.inc"
9
10python migrate_localcount_handler () {
11 import bb.event
12 if not e.data:
13 return
14
15 pv = e.data.getVar('PV')
16 if not 'AUTOINC' in pv:
17 return
18
19 localcounts = bb.persist_data.persist('BB_URI_LOCALCOUNT', e.data)
20 pn = e.data.getVar('PN')
21 revs = localcounts.get_by_pattern('%%-%s_rev' % pn)
22 counts = localcounts.get_by_pattern('%%-%s_count' % pn)
23 if not revs or not counts:
24 return
25
26 if len(revs) != len(counts):
27 bb.warn("The number of revs and localcounts don't match in %s" % pn)
28 return
29
30 version = e.data.getVar('PRAUTOINX')
31 srcrev = bb.fetch2.get_srcrev(e.data)
32 base_ver = 'AUTOINC-%s' % version[:version.find(srcrev)]
33 pkgarch = e.data.getVar('PACKAGE_ARCH')
34 value = max(int(count) for count in counts)
35
36 if len(revs) == 1:
37 if srcrev != ('AUTOINC+%s' % revs[0]):
38 value += 1
39 else:
40 value += 1
41
42 bb.utils.mkdirhier(e.data.getVar('PRSERV_DUMPDIR'))
43 df = e.data.getVar('LOCALCOUNT_DUMPFILE')
44 flock = bb.utils.lockfile("%s.lock" % df)
45 with open(df, 'a') as fd:
46 fd.write('PRAUTO$%s$%s$%s = "%s"\n' %
47 (base_ver, pkgarch, srcrev, str(value)))
48 bb.utils.unlockfile(flock)
49}
50
51addhandler migrate_localcount_handler
52migrate_localcount_handler[eventmask] = "bb.event.RecipeParsed"