summaryrefslogtreecommitdiffstats
path: root/meta/classes/package_ipk.bbclass
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2017-03-30 22:02:08 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-05-12 08:45:36 +0100
commit8454756453789060be677d9ea1402a92b269d779 (patch)
tree6ee0e33f1152da6d4d446243f05ab44daee93413 /meta/classes/package_ipk.bbclass
parentc22953e8ec6d9dcf9f0877031ede61cd012f9493 (diff)
downloadpoky-8454756453789060be677d9ea1402a92b269d779.tar.gz
package_ipk: Split into two functions
This prepares the way to parallelise ipk generation and splits the iteration over packages and the package generation into separate functions. Whitespace indentation is unchanged deliberately and is fixed in a followup patch. There should be no functional change. (From OE-Core rev: f190d8456c7e135164d3073acfb3319e75c9de76) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/package_ipk.bbclass')
-rw-r--r--meta/classes/package_ipk.bbclass38
1 files changed, 23 insertions, 15 deletions
diff --git a/meta/classes/package_ipk.bbclass b/meta/classes/package_ipk.bbclass
index c7cec9d63d..16ee761537 100644
--- a/meta/classes/package_ipk.bbclass
+++ b/meta/classes/package_ipk.bbclass
@@ -17,11 +17,6 @@ OPKG_ARGS += "${@['', '--add-exclude ' + ' --add-exclude '.join((d.getVar('PACKA
17OPKGLIBDIR = "${localstatedir}/lib" 17OPKGLIBDIR = "${localstatedir}/lib"
18 18
19python do_package_ipk () { 19python do_package_ipk () {
20 import re, copy
21 import textwrap
22 import subprocess
23 import collections
24
25 oldcwd = os.getcwd() 20 oldcwd = os.getcwd()
26 21
27 workdir = d.getVar('WORKDIR') 22 workdir = d.getVar('WORKDIR')
@@ -42,13 +37,27 @@ python do_package_ipk () {
42 if os.access(os.path.join(tmpdir, "stamps", "IPK_PACKAGE_INDEX_CLEAN"), os.R_OK): 37 if os.access(os.path.join(tmpdir, "stamps", "IPK_PACKAGE_INDEX_CLEAN"), os.R_OK):
43 os.unlink(os.path.join(tmpdir, "stamps", "IPK_PACKAGE_INDEX_CLEAN")) 38 os.unlink(os.path.join(tmpdir, "stamps", "IPK_PACKAGE_INDEX_CLEAN"))
44 39
45 def cleanupcontrol(root):
46 for p in ['CONTROL', 'DEBIAN']:
47 p = os.path.join(root, p)
48 if os.path.exists(p):
49 bb.utils.prunedir(p)
50
51 for pkg in packages.split(): 40 for pkg in packages.split():
41 ipk_write_pkg(pkg, d)
42
43 os.chdir(oldcwd)
44}
45
46def ipk_write_pkg(pkg, d):
47 import re, copy
48 import subprocess
49 import textwrap
50 import collections
51
52 def cleanupcontrol(root):
53 for p in ['CONTROL', 'DEBIAN']:
54 p = os.path.join(root, p)
55 if os.path.exists(p):
56 bb.utils.prunedir(p)
57
58 outdir = d.getVar('PKGWRITEDIRIPK')
59 pkgdest = d.getVar('PKGDEST')
60
52 localdata = bb.data.createCopy(d) 61 localdata = bb.data.createCopy(d)
53 root = "%s/%s" % (pkgdest, pkg) 62 root = "%s/%s" % (pkgdest, pkg)
54 63
@@ -99,7 +108,7 @@ python do_package_ipk () {
99 if not g and localdata.getVar('ALLOW_EMPTY', False) != "1": 108 if not g and localdata.getVar('ALLOW_EMPTY', False) != "1":
100 bb.note("Not creating empty archive for %s-%s-%s" % (pkg, localdata.getVar('PKGV'), localdata.getVar('PKGR'))) 109 bb.note("Not creating empty archive for %s-%s-%s" % (pkg, localdata.getVar('PKGV'), localdata.getVar('PKGR')))
101 bb.utils.unlockfile(lf) 110 bb.utils.unlockfile(lf)
102 continue 111 return
103 112
104 controldir = os.path.join(root, 'CONTROL') 113 controldir = os.path.join(root, 'CONTROL')
105 bb.utils.mkdirhier(controldir) 114 bb.utils.mkdirhier(controldir)
@@ -239,10 +248,9 @@ python do_package_ipk () {
239 cleanupcontrol(root) 248 cleanupcontrol(root)
240 bb.utils.unlockfile(lf) 249 bb.utils.unlockfile(lf)
241 250
242 os.chdir(oldcwd)
243}
244# Otherwise allarch packages may change depending on override configuration 251# Otherwise allarch packages may change depending on override configuration
245do_package_ipk[vardepsexclude] = "OVERRIDES" 252ipk_write_pkg[vardepsexclude] = "OVERRIDES"
253
246 254
247SSTATETASKS += "do_package_write_ipk" 255SSTATETASKS += "do_package_write_ipk"
248do_package_write_ipk[sstate-inputdirs] = "${PKGWRITEDIRIPK}" 256do_package_write_ipk[sstate-inputdirs] = "${PKGWRITEDIRIPK}"