diff options
Diffstat (limited to 'meta/lib/oe')
-rw-r--r-- | meta/lib/oe/packagedata.py | 43 |
1 files changed, 12 insertions, 31 deletions
diff --git a/meta/lib/oe/packagedata.py b/meta/lib/oe/packagedata.py index 14c38bdc0f..cd5f0445f5 100644 --- a/meta/lib/oe/packagedata.py +++ b/meta/lib/oe/packagedata.py | |||
@@ -23,21 +23,7 @@ def read_pkgdatafile(fn): | |||
23 | 23 | ||
24 | return pkgdata | 24 | return pkgdata |
25 | 25 | ||
26 | def all_pkgdatadirs(d): | ||
27 | dirs = [] | ||
28 | triplets = (d.getVar("PKGMLTRIPLETS") or "").split() | ||
29 | for t in triplets: | ||
30 | dirs.append(t + "/runtime/") | ||
31 | return dirs | ||
32 | |||
33 | def get_subpkgedata_fn(pkg, d): | 26 | def get_subpkgedata_fn(pkg, d): |
34 | dirs = all_pkgdatadirs(d) | ||
35 | |||
36 | pkgdata = d.expand('${TMPDIR}/pkgdata/') | ||
37 | for dir in dirs: | ||
38 | fn = pkgdata + dir + pkg | ||
39 | if os.path.exists(fn): | ||
40 | return fn | ||
41 | return d.expand('${PKGDATA_DIR}/runtime/%s' % pkg) | 27 | return d.expand('${PKGDATA_DIR}/runtime/%s' % pkg) |
42 | 28 | ||
43 | def has_subpkgdata(pkg, d): | 29 | def has_subpkgdata(pkg, d): |
@@ -70,29 +56,24 @@ def read_subpkgdata_dict(pkg, d): | |||
70 | def _pkgmap(d): | 56 | def _pkgmap(d): |
71 | """Return a dictionary mapping package to recipe name.""" | 57 | """Return a dictionary mapping package to recipe name.""" |
72 | 58 | ||
73 | target_os = d.getVar("TARGET_OS", True) | 59 | pkgdatadir = d.getVar("PKGDATA_DIR", True) |
74 | target_vendor = d.getVar("TARGET_VENDOR", True) | ||
75 | basedir = os.path.dirname(d.getVar("PKGDATA_DIR", True)) | ||
76 | |||
77 | dirs = ("%s%s-%s" % (arch, target_vendor, target_os) | ||
78 | for arch in d.getVar("PACKAGE_ARCHS", True).split()) | ||
79 | 60 | ||
80 | pkgmap = {} | 61 | pkgmap = {} |
81 | for pkgdatadir in (os.path.join(basedir, sys) for sys in dirs): | 62 | try: |
63 | files = os.listdir(pkgdatadir) | ||
64 | except OSError: | ||
65 | bb.warn("No files in %s?" % pkgdatadir) | ||
66 | files = [] | ||
67 | |||
68 | for pn in filter(lambda f: not os.path.isdir(os.path.join(pkgdatadir, f)), files): | ||
82 | try: | 69 | try: |
83 | files = os.listdir(pkgdatadir) | 70 | pkgdata = read_pkgdatafile(os.path.join(pkgdatadir, pn)) |
84 | except OSError: | 71 | except OSError: |
85 | continue | 72 | continue |
86 | 73 | ||
87 | for pn in filter(lambda f: not os.path.isdir(os.path.join(pkgdatadir, f)), files): | 74 | packages = pkgdata.get("PACKAGES") or "" |
88 | try: | 75 | for pkg in packages.split(): |
89 | pkgdata = read_pkgdatafile(os.path.join(pkgdatadir, pn)) | 76 | pkgmap[pkg] = pn |
90 | except OSError: | ||
91 | continue | ||
92 | |||
93 | packages = pkgdata.get("PACKAGES") or "" | ||
94 | for pkg in packages.split(): | ||
95 | pkgmap[pkg] = pn | ||
96 | 77 | ||
97 | return pkgmap | 78 | return pkgmap |
98 | 79 | ||