diff options
Diffstat (limited to 'yocto-poky/meta/lib/oe/utils.py')
-rw-r--r-- | yocto-poky/meta/lib/oe/utils.py | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/yocto-poky/meta/lib/oe/utils.py b/yocto-poky/meta/lib/oe/utils.py index cee087fdf..30d30629f 100644 --- a/yocto-poky/meta/lib/oe/utils.py +++ b/yocto-poky/meta/lib/oe/utils.py @@ -208,6 +208,28 @@ def squashspaces(string): import re return re.sub("\s+", " ", string).strip() +def format_pkg_list(pkg_dict, ret_format=None): + output = [] + + if ret_format == "arch": + for pkg in sorted(pkg_dict): + output.append("%s %s" % (pkg, pkg_dict[pkg]["arch"])) + elif ret_format == "file": + for pkg in sorted(pkg_dict): + output.append("%s %s %s" % (pkg, pkg_dict[pkg]["filename"], pkg_dict[pkg]["arch"])) + elif ret_format == "ver": + for pkg in sorted(pkg_dict): + output.append("%s %s %s" % (pkg, pkg_dict[pkg]["arch"], pkg_dict[pkg]["ver"])) + elif ret_format == "deps": + for pkg in sorted(pkg_dict): + for dep in pkg_dict[pkg]["deps"]: + output.append("%s|%s" % (pkg, dep)) + else: + for pkg in sorted(pkg_dict): + output.append(pkg) + + return '\n'.join(output) + # # Python 2.7 doesn't have threaded pools (just multiprocessing) # so implement a version here @@ -271,3 +293,14 @@ class ThreadedPool: self.tasks.join() for worker in self.workers: worker.join() + +def write_ld_so_conf(d): + # Some utils like prelink may not have the correct target library paths + # so write an ld.so.conf to help them + ldsoconf = d.expand("${STAGING_DIR_TARGET}${sysconfdir}/ld.so.conf") + if os.path.exists(ldsoconf): + bb.utils.remove(ldsoconf) + bb.utils.mkdirhier(os.path.dirname(ldsoconf)) + with open(ldsoconf, "w") as f: + f.write(d.getVar("base_libdir", True) + '\n') + f.write(d.getVar("libdir", True) + '\n') |