diff options
author | Markus Lehtonen <markus.lehtonen@linux.intel.com> | 2014-12-15 15:26:40 +0200 |
---|---|---|
committer | Markus Lehtonen <markus.lehtonen@linux.intel.com> | 2014-12-19 14:10:43 +0200 |
commit | 731c3b877a3263bea6185e33e9d84d2be0c9ac52 (patch) | |
tree | 91b65d6bbbbfd126cebde9b76aa873d4168eeb63 | |
parent | ee928a489fd7b544261cc7b3e1525cfe781d44be (diff) | |
download | git-buildpackage-731c3b877a3263bea6185e33e9d84d2be0c9ac52.tar.gz git-buildpackage-731c3b877a3263bea6185e33e9d84d2be0c9ac52.tar.bz2 git-buildpackage-731c3b877a3263bea6185e33e9d84d2be0c9ac52.zip |
WIP: support multi-layer packagesfeature/bitbake
Support multiple layers in import-bb, pq-bb and buildpackage-bb.
Change-Id: I4663f03a3c65b87f047165a90c085ef626733d19
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
-rw-r--r-- | gbp/bb/__init__.py | 16 | ||||
-rwxr-xr-x | gbp/scripts/import_bb.py | 4 |
2 files changed, 20 insertions, 0 deletions
diff --git a/gbp/bb/__init__.py b/gbp/bb/__init__.py index 1efeb221..aec4bbae 100644 --- a/gbp/bb/__init__.py +++ b/gbp/bb/__init__.py @@ -497,5 +497,21 @@ def guess_pkg(tinfoil, pkg): return pkg_bb +def get_layers(cfg_data): + """Get enabled layers""" + return cfg_data.getVar('BBLAYERS').split() + +def get_layer(cfg_data, path): + """Get layer under which a certain file resides""" + abspath = os.path.abspath(path) + layers = get_layers(cfg_data) + for layer in layers: + if abspath.startswith(layer): + return layer + raise GbpError("File %s does under any configured layer" % abspath) + + + + # Initialize module bb = import_bb() diff --git a/gbp/scripts/import_bb.py b/gbp/scripts/import_bb.py index d0aeae1c..18db3317 100755 --- a/gbp/scripts/import_bb.py +++ b/gbp/scripts/import_bb.py @@ -310,6 +310,10 @@ def main(argv): prefix='import-bb') tinfoil = init_tinfoil() pkg_bb = guess_pkg(tinfoil, args[0]) + #bb_appends = tinfoil.cooker.collection.get_file_appends(pkg_bb) + #layers = get_package_layers(pkg + + dirs['src'] = os.path.abspath(os.path.dirname(pkg_bb)) gbp.log.info("Importing '%s' from '%s'" % (os.path.basename(pkg_bb), dirs['src'])) |