summaryrefslogtreecommitdiffstats
path: root/meta/classes/base.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes/base.bbclass')
-rw-r--r--meta/classes/base.bbclass102
1 files changed, 0 insertions, 102 deletions
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index b7eb62c01a..e801fd12a9 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -946,108 +946,6 @@ addtask build after do_populate_staging
946do_build = "" 946do_build = ""
947do_build[func] = "1" 947do_build[func] = "1"
948 948
949# Functions that update metadata based on files outputted
950# during the build process.
951
952def explode_deps(s):
953 r = []
954 l = s.split()
955 flag = False
956 for i in l:
957 if i[0] == '(':
958 flag = True
959 j = []
960 if flag:
961 j.append(i)
962 if i.endswith(')'):
963 flag = False
964 r[-1] += ' ' + ' '.join(j)
965 else:
966 r.append(i)
967 return r
968
969def packaged(pkg, d):
970 import os, bb
971 return os.access(get_subpkgedata_fn(pkg, d) + '.packaged', os.R_OK)
972
973def read_pkgdatafile(fn):
974 pkgdata = {}
975
976 def decode(str):
977 import codecs
978 c = codecs.getdecoder("string_escape")
979 return c(str)[0]
980
981 import os
982 if os.access(fn, os.R_OK):
983 import re
984 f = file(fn, 'r')
985 lines = f.readlines()
986 f.close()
987 r = re.compile("([^:]+):\s*(.*)")
988 for l in lines:
989 m = r.match(l)
990 if m:
991 pkgdata[m.group(1)] = decode(m.group(2))
992
993 return pkgdata
994
995def get_subpkgedata_fn(pkg, d):
996 import bb, os
997 archs = bb.data.expand("${PACKAGE_ARCHS}", d).split(" ")
998 archs.reverse()
999 pkgdata = bb.data.expand('${TMPDIR}/pkgdata/', d)
1000 targetdir = bb.data.expand('${TARGET_VENDOR}-${TARGET_OS}/runtime/', d)
1001 for arch in archs:
1002 fn = pkgdata + arch + targetdir + pkg
1003 if os.path.exists(fn):
1004 return fn
1005 return bb.data.expand('${PKGDATA_DIR}/runtime/%s' % pkg, d)
1006
1007def has_subpkgdata(pkg, d):
1008 import bb, os
1009 return os.access(get_subpkgedata_fn(pkg, d), os.R_OK)
1010
1011def read_subpkgdata(pkg, d):
1012 import bb
1013 return read_pkgdatafile(get_subpkgedata_fn(pkg, d))
1014
1015def has_pkgdata(pn, d):
1016 import bb, os
1017 fn = bb.data.expand('${PKGDATA_DIR}/%s' % pn, d)
1018 return os.access(fn, os.R_OK)
1019
1020def read_pkgdata(pn, d):
1021 import bb
1022 fn = bb.data.expand('${PKGDATA_DIR}/%s' % pn, d)
1023 return read_pkgdatafile(fn)
1024
1025python read_subpackage_metadata () {
1026 import bb
1027 data = read_pkgdata(bb.data.getVar('PN', d, 1), d)
1028
1029 for key in data.keys():
1030 bb.data.setVar(key, data[key], d)
1031
1032 for pkg in bb.data.getVar('PACKAGES', d, 1).split():
1033 sdata = read_subpkgdata(pkg, d)
1034 for key in sdata.keys():
1035 bb.data.setVar(key, sdata[key], d)
1036}
1037
1038
1039#
1040# Collapse FOO_pkg variables into FOO
1041#
1042def read_subpkgdata_dict(pkg, d):
1043 import bb
1044 ret = {}
1045 subd = read_pkgdatafile(get_subpkgedata_fn(pkg, d))
1046 for var in subd:
1047 newvar = var.replace("_" + pkg, "")
1048 ret[newvar] = subd[var]
1049 return ret
1050
1051# Make sure MACHINE isn't exported 949# Make sure MACHINE isn't exported
1052# (breaks binutils at least) 950# (breaks binutils at least)
1053MACHINE[unexport] = "1" 951MACHINE[unexport] = "1"