summaryrefslogtreecommitdiffstats
path: root/meta/classes/base.bbclass
diff options
context:
space:
mode:
authorChris Larson <kergoth@openedhand.com>2006-09-21 16:29:02 +0000
committerChris Larson <kergoth@openedhand.com>2006-09-21 16:29:02 +0000
commit8d804ea40a349e679850b716012120e54fe5242d (patch)
treed8b1d37ea78880df826f81bb4b791f8f93f1f985 /meta/classes/base.bbclass
parent5cacd3ea7efd69e57979d962616bf87c521c6f8b (diff)
downloadpoky-8d804ea40a349e679850b716012120e54fe5242d.tar.gz
Merge devgen branch to trunk.
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@743 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'meta/classes/base.bbclass')
-rw-r--r--meta/classes/base.bbclass48
1 files changed, 42 insertions, 6 deletions
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index a36829006e..0d5f5ea164 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -624,24 +624,60 @@ python read_shlibdeps () {
624 bb.data.setVar('RDEPENDS_' + pkg, " " + " ".join(rdepends), d) 624 bb.data.setVar('RDEPENDS_' + pkg, " " + " ".join(rdepends), d)
625} 625}
626 626
627python read_subpackage_metadata () { 627def read_pkgdatafile(fn):
628 import re 628 pkgdata = {}
629 629
630 def decode(str): 630 def decode(str):
631 import codecs 631 import codecs
632 c = codecs.getdecoder("string_escape") 632 c = codecs.getdecoder("string_escape")
633 return c(str)[0] 633 return c(str)[0]
634 634
635 data_file = bb.data.expand("${WORKDIR}/install/${PN}.package", d) 635 import os
636 if os.access(data_file, os.R_OK): 636 if os.access(fn, os.R_OK):
637 f = file(data_file, 'r') 637 import re
638 f = file(fn, 'r')
638 lines = f.readlines() 639 lines = f.readlines()
639 f.close() 640 f.close()
640 r = re.compile("([^:]+):\s*(.*)") 641 r = re.compile("([^:]+):\s*(.*)")
641 for l in lines: 642 for l in lines:
642 m = r.match(l) 643 m = r.match(l)
643 if m: 644 if m:
644 bb.data.setVar(m.group(1), decode(m.group(2)), d) 645 pkgdata[m.group(1)] = decode(m.group(2))
646
647 return pkgdata
648
649def has_subpkgdata(pkg, d):
650 import bb, os
651 fn = bb.data.expand('${STAGING_DIR}/pkgdata/runtime/%s' % pkg, d)
652 return os.access(fn, os.R_OK)
653
654def read_subpkgdata(pkg, d):
655 import bb, os
656 fn = bb.data.expand('${STAGING_DIR}/pkgdata/runtime/%s' % pkg, d)
657 return read_pkgdatafile(fn)
658
659
660def has_pkgdata(pn, d):
661 import bb, os
662 fn = bb.data.expand('${STAGING_DIR}/pkgdata/%s' % pn, d)
663 return os.access(fn, os.R_OK)
664
665def read_pkgdata(pn, d):
666 import bb, os
667 fn = bb.data.expand('${STAGING_DIR}/pkgdata/%s' % pn, d)
668 return read_pkgdatafile(fn)
669
670python read_subpackage_metadata () {
671 import bb
672 data = read_pkgdata(bb.data.getVar('PN', d, 1), d)
673
674 for key in data.keys():
675 bb.data.setVar(key, data[key], d)
676
677 for pkg in bb.data.getVar('PACKAGES', d, 1).split():
678 sdata = read_subpkgdata(pkg, d)
679 for key in sdata.keys():
680 bb.data.setVar(key, sdata[key], d)
645} 681}
646 682
647python __anonymous () { 683python __anonymous () {