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