summaryrefslogtreecommitdiffstats
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
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>
-rw-r--r--meta/classes/migrate_localcount.bbclass52
-rw-r--r--meta/conf/migrate_localcount.conf1
-rwxr-xr-xscripts/bitbake-prserv-tool40
3 files changed, 0 insertions, 93 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"
diff --git a/meta/conf/migrate_localcount.conf b/meta/conf/migrate_localcount.conf
deleted file mode 100644
index e486e03e5f..0000000000
--- a/meta/conf/migrate_localcount.conf
+++ /dev/null
@@ -1 +0,0 @@
1INHERIT += "migrate_localcount"
diff --git a/scripts/bitbake-prserv-tool b/scripts/bitbake-prserv-tool
index 80028342b1..0559c4c38a 100755
--- a/scripts/bitbake-prserv-tool
+++ b/scripts/bitbake-prserv-tool
@@ -55,43 +55,6 @@ do_import ()
55 return $ret 55 return $ret
56} 56}
57 57
58do_migrate_localcount ()
59{
60 df=`bitbake -R conf/migrate_localcount.conf -e | \
61 grep ^LOCALCOUNT_DUMPFILE= | cut -f2 -d\"`
62 if [ "x${df}" == "x" ];
63 then
64 echo "LOCALCOUNT_DUMPFILE is not defined!"
65 return 1
66 fi
67
68 rm -f $df
69 clean_cache
70 echo "Exporting LOCALCOUNT to AUTOINCs..."
71 bitbake -R conf/migrate_localcount.conf -p
72 [ ! $? -eq 0 ] && echo "Exporting to file $df failed!" && exit 1
73
74 if [ -e $df ];
75 then
76 echo "Exporting to file $df succeeded!"
77 else
78 echo "Exporting to file $df failed!"
79 exit 1
80 fi
81
82 echo "Importing generated AUTOINC entries..."
83 [ -e $df ] && do_import $df
84
85 if [ ! $? -eq 0 ]
86 then
87 echo "Migration from LOCALCOUNT to AUTOINCs failed!"
88 return 1
89 fi
90
91 echo "Migration from LOCALCOUNT to AUTOINCs succeeded!"
92 return 0
93}
94
95[ $# -eq 0 ] && help && exit 1 58[ $# -eq 0 ] && help && exit 1
96 59
97case $2 in 60case $2 in
@@ -110,9 +73,6 @@ export)
110import) 73import)
111 do_import $2 74 do_import $2
112 ;; 75 ;;
113migrate_localcount)
114 do_migrate_localcount
115 ;;
116*) 76*)
117 help 77 help
118 exit 1 78 exit 1