summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKoen Kooi <koen@openembedded.org>2006-09-14 21:14:12 +0000
committerKoen Kooi <koen@openembedded.org>2006-09-14 21:14:12 +0000
commit189eeba1948c7e4def33a113ceffdeb4f5567e1f (patch)
treeeefca2a57c1c3e8ee8f8712448644b60363eaec0
parent267cf1fed093319afbc1f3d47e4efaca83d83149 (diff)
parent21a20a6d6cc8f87061d3e4fa557971447fa64adb (diff)
merge of 'a1d864e39820a6d83791681ce836e11ac38a89b6'
and 'db2f843f48cece5e25cf2e654db269ba3dba5192'
-rw-r--r--classes/base.bbclass48
-rw-r--r--classes/package.bbclass30
-rw-r--r--classes/package_ipk.bbclass3
-rw-r--r--classes/package_tar.bbclass3
4 files changed, 65 insertions, 19 deletions
diff --git a/classes/base.bbclass b/classes/base.bbclass
index bb4abb9571..0a28194719 100644
--- a/classes/base.bbclass
+++ b/classes/base.bbclass
@@ -631,24 +631,60 @@ python read_shlibdeps () {
bb.data.setVar('RDEPENDS_' + pkg, " " + " ".join(rdepends), d)
}
-python read_subpackage_metadata () {
- import re
+def read_pkgdatafile(fn):
+ pkgdata = {}
def decode(str):
import codecs
c = codecs.getdecoder("string_escape")
return c(str)[0]
- data_file = bb.data.expand("${WORKDIR}/install/${PN}.package", d)
- if os.access(data_file, os.R_OK):
- f = file(data_file, 'r')
+ import os
+ if os.access(fn, os.R_OK):
+ import re
+ f = file(fn, 'r')
lines = f.readlines()
f.close()
r = re.compile("([^:]+):\s*(.*)")
for l in lines:
m = r.match(l)
if m:
- bb.data.setVar(m.group(1), decode(m.group(2)), d)
+ pkgdata[m.group(1)] = decode(m.group(2))
+
+ return pkgdata
+
+def has_subpkgdata(pkg, d):
+ import bb, os
+ fn = bb.data.expand('${STAGING_DIR}/pkgdata/runtime/%s' % pkg, d)
+ return os.access(fn, os.R_OK)
+
+def read_subpkgdata(pkg, d):
+ import bb, os
+ fn = bb.data.expand('${STAGING_DIR}/pkgdata/runtime/%s' % pkg, d)
+ return read_pkgdatafile(fn)
+
+
+def has_pkgdata(pn, d):
+ import bb, os
+ fn = bb.data.expand('${STAGING_DIR}/pkgdata/%s' % pn, d)
+ return os.access(fn, os.R_OK)
+
+def read_pkgdata(pn, d):
+ import bb, os
+ fn = bb.data.expand('${STAGING_DIR}/pkgdata/%s' % pn, d)
+ return read_pkgdatafile(fn)
+
+python read_subpackage_metadata () {
+ import bb
+ data = read_pkgdata(bb.data.getVar('PN', d, 1), d)
+
+ for key in data.keys():
+ bb.data.setVar(key, data[key], d)
+
+ for pkg in bb.data.getVar('PACKAGES', d, 1).split():
+ sdata = read_subpkgdata(pkg, d)
+ for key in sdata.keys():
+ bb.data.setVar(key, sdata[key], d)
}
python __anonymous () {
diff --git a/classes/package.bbclass b/classes/package.bbclass
index 3c6d97da28..964cc67048 100644
--- a/classes/package.bbclass
+++ b/classes/package.bbclass
@@ -401,21 +401,25 @@ python populate_packages () {
if val:
f.write('%s_%s: %s\n' % (var, pkg, encode(val)))
- data_file = os.path.join(workdir, "install", pn + ".package")
+ data_file = bb.data.expand("${STAGING_DIR}/pkgdata/${PN}", d)
f = open(data_file, 'w')
f.write("PACKAGES: %s\n" % packages)
- for pkg in package_list:
- write_if_exists(f, pkg, 'DESCRIPTION')
- write_if_exists(f, pkg, 'RDEPENDS')
- write_if_exists(f, pkg, 'RPROVIDES')
- write_if_exists(f, pkg, 'PKG')
- write_if_exists(f, pkg, 'ALLOW_EMPTY')
- write_if_exists(f, pkg, 'FILES')
- write_if_exists(f, pkg, 'pkg_postinst')
- write_if_exists(f, pkg, 'pkg_postrm')
- write_if_exists(f, pkg, 'pkg_preinst')
- write_if_exists(f, pkg, 'pkg_prerm')
f.close()
+
+ for pkg in package_list:
+ subdata_file = bb.data.expand("${STAGING_DIR}/pkgdata/runtime/%s" % pkg, d)
+ sf = open(subdata_file, 'w')
+ write_if_exists(sf, pkg, 'DESCRIPTION')
+ write_if_exists(sf, pkg, 'RDEPENDS')
+ write_if_exists(sf, pkg, 'RPROVIDES')
+ write_if_exists(sf, pkg, 'PKG')
+ write_if_exists(sf, pkg, 'ALLOW_EMPTY')
+ write_if_exists(sf, pkg, 'FILES')
+ write_if_exists(sf, pkg, 'pkg_postinst')
+ write_if_exists(sf, pkg, 'pkg_postrm')
+ write_if_exists(sf, pkg, 'pkg_preinst')
+ write_if_exists(sf, pkg, 'pkg_prerm')
+ sf.close()
bb.build.exec_func("read_subpackage_metadata", d)
}
@@ -741,6 +745,6 @@ python package_do_package () {
do_package[dirs] = "${D}"
# shlibs requires any DEPENDS to have already packaged for the *.list files
do_package[deptask] = "do_package"
-populate_packages[dirs] = "${D}"
+populate_packages[dirs] = "${STAGING_DIR}/pkgdata/runtime ${D}"
EXPORT_FUNCTIONS do_package do_shlibs do_split_locales mapping_rename_hook
addtask package before do_build after do_install
diff --git a/classes/package_ipk.bbclass b/classes/package_ipk.bbclass
index 9ae526bb3b..0cb5128e17 100644
--- a/classes/package_ipk.bbclass
+++ b/classes/package_ipk.bbclass
@@ -129,6 +129,7 @@ python do_package_ipk () {
from bb import note
note("Not creating empty archive for %s-%s-%s" % (pkg, bb.data.getVar('PV', localdata, 1), bb.data.getVar('PR', localdata, 1)))
continue
+
controldir = os.path.join(root, 'CONTROL')
bb.mkdirhier(controldir)
try:
@@ -220,6 +221,8 @@ python do_package_ipk () {
if ret != 0:
raise bb.build.FuncFailed("ipkg-build execution failed")
+ file(bb.data.expand('${STAGING_DIR}/pkgdata/runtime/%s.packaged' % pkg, d), 'w').close()
+
for script in ["preinst", "postinst", "prerm", "postrm", "control" ]:
scriptfile = os.path.join(controldir, script)
try:
diff --git a/classes/package_tar.bbclass b/classes/package_tar.bbclass
index 359e35f113..63e82f7f39 100644
--- a/classes/package_tar.bbclass
+++ b/classes/package_tar.bbclass
@@ -94,6 +94,9 @@ python do_package_tar () {
ret = os.system("tar -czvf %s %s" % (tarfn, '.'))
if ret != 0:
bb.error("Creation of tar %s failed." % tarfn)
+
+ file(bb.data.expand('${STAGING_DIR}/pkgdata/runtime/%s.packaged' % pkg, d), 'w').close()
+
# end stuff
del localdata
}