diff options
Diffstat (limited to 'meta/classes/toaster.bbclass')
-rw-r--r-- | meta/classes/toaster.bbclass | 28 |
1 files changed, 5 insertions, 23 deletions
diff --git a/meta/classes/toaster.bbclass b/meta/classes/toaster.bbclass index 7dbb3844d7..8dc1663165 100644 --- a/meta/classes/toaster.bbclass +++ b/meta/classes/toaster.bbclass | |||
@@ -39,8 +39,7 @@ python toaster_package_dumpdata() { | |||
39 | 39 | ||
40 | 40 | ||
41 | # scan and send data for each package | 41 | # scan and send data for each package |
42 | import ast | 42 | import json |
43 | import fnmatch | ||
44 | 43 | ||
45 | lpkgdata = {} | 44 | lpkgdata = {} |
46 | for pkg in packages.split(): | 45 | for pkg in packages.split(): |
@@ -54,28 +53,11 @@ python toaster_package_dumpdata() { | |||
54 | (n, v) = line.rstrip().split(":", 1) | 53 | (n, v) = line.rstrip().split(":", 1) |
55 | if pkg in n: | 54 | if pkg in n: |
56 | n = n.replace("_" + pkg, "") | 55 | n = n.replace("_" + pkg, "") |
57 | lpkgdata[n] = v.strip() | ||
58 | line = sf.readline() | ||
59 | pkgsplitname = os.path.join(pkgdest, pkg) | ||
60 | # replace FILES_INFO data with a dictionary of file name - file size | ||
61 | if n == 'FILES_INFO': | 56 | if n == 'FILES_INFO': |
62 | filesizedata = {} | 57 | lpkgdata[n] = json.loads(v) |
63 | val = v.strip().replace('\\\'', '\'') | 58 | else: |
64 | dictval = ast.literal_eval(val) | 59 | lpkgdata[n] = v.strip() |
65 | for parent, dirlist in dictval.items(): | 60 | line = sf.readline() |
66 | idx = parent.find(pkgsplitname) | ||
67 | if idx > -1: | ||
68 | parent = parent[idx+len(pkgsplitname):] | ||
69 | else: | ||
70 | bb.error("Invalid path while looking for file ", parent) | ||
71 | for basename in dirlist: | ||
72 | fullpath = os.path.join(parent, basename) | ||
73 | try: | ||
74 | filesizedata[fullpath] = os.stat(pkgsplitname + fullpath).st_size | ||
75 | except OSError: | ||
76 | # we may hit a symlink that is not pointing correctly over package-split | ||
77 | filesizedata[fullpath] = 0 | ||
78 | lpkgdata[n] = filesizedata | ||
79 | 61 | ||
80 | # Fire an event containing the pkg data | 62 | # Fire an event containing the pkg data |
81 | bb.event.fire(bb.event.MetadataEvent("SinglePackageInfo", lpkgdata), d) | 63 | bb.event.fire(bb.event.MetadataEvent("SinglePackageInfo", lpkgdata), d) |