summaryrefslogtreecommitdiffstats
path: root/meta/classes/package.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes/package.bbclass')
-rw-r--r--meta/classes/package.bbclass19
1 files changed, 9 insertions, 10 deletions
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index 48bb9828f5..cce2499122 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -1110,6 +1110,7 @@ PKGDESTWORK = "${WORKDIR}/pkgdata"
1110 1110
1111python emit_pkgdata() { 1111python emit_pkgdata() {
1112 from glob import glob 1112 from glob import glob
1113 import json
1113 1114
1114 def write_if_exists(f, pkg, var): 1115 def write_if_exists(f, pkg, var):
1115 def encode(str): 1116 def encode(str):
@@ -1173,22 +1174,20 @@ python emit_pkgdata() {
1173 workdir = d.getVar('WORKDIR', True) 1174 workdir = d.getVar('WORKDIR', True)
1174 1175
1175 for pkg in packages.split(): 1176 for pkg in packages.split():
1176 items = {}
1177 for files_list in pkgfiles[pkg]:
1178 item_name = os.path.basename(files_list)
1179 item_path = os.path.dirname(files_list)
1180 if item_path not in items:
1181 items[item_path] = []
1182 items[item_path].append(item_name)
1183 subdata_file = pkgdatadir + "/runtime/%s" % pkg
1184
1185 pkgval = d.getVar('PKG_%s' % pkg, True) 1177 pkgval = d.getVar('PKG_%s' % pkg, True)
1186 if pkgval is None: 1178 if pkgval is None:
1187 pkgval = pkg 1179 pkgval = pkg
1188 d.setVar('PKG_%s' % pkg, pkg) 1180 d.setVar('PKG_%s' % pkg, pkg)
1189 1181
1190 d.setVar('FILES_INFO', str(items)) 1182 pkgdestpkg = os.path.join(pkgdest, pkg)
1183 files = {}
1184 for f in pkgfiles[pkg]:
1185 relpth = os.path.relpath(f, pkgdestpkg)
1186 fstat = os.lstat(f)
1187 files[os.sep + relpth] = fstat.st_size
1188 d.setVar('FILES_INFO', json.dumps(files))
1191 1189
1190 subdata_file = pkgdatadir + "/runtime/%s" % pkg
1192 sf = open(subdata_file, 'w') 1191 sf = open(subdata_file, 'w')
1193 write_if_exists(sf, pkg, 'PN') 1192 write_if_exists(sf, pkg, 'PN')
1194 write_if_exists(sf, pkg, 'PV') 1193 write_if_exists(sf, pkg, 'PV')