diff --git a/rrs/tools/rrs_distros.py b/rrs/tools/rrs_distros.py index e4c6045..4c5b273 100755 --- a/rrs/tools/rrs_distros.py +++ b/rrs/tools/rrs_distros.py @@ -33,7 +33,13 @@ if not fetchdir: sys.exit(1) # setup bitbake path -bitbakepath = os.path.join(fetchdir, 'bitbake') +from layerindex.models import LayerItem +bitbakeitem = LayerItem() +bitbakeitem.vcs_url = settings.BITBAKE_REPO_URL +bitbakepath = os.path.join(fetchdir, bitbakeitem.get_fetch_dir()) +if getattr(settings, 'BITBAKE_PATH', ''): + bitbakepath = os.path.join(bitbakepath, settings.BITBAKE_PATH) + sys.path.insert(0, os.path.join(bitbakepath, 'lib')) diff --git a/rrs/tools/rrs_upgrade_history.py b/rrs/tools/rrs_upgrade_history.py index 42ba9b8..b762144 100755 --- a/rrs/tools/rrs_upgrade_history.py +++ b/rrs/tools/rrs_upgrade_history.py @@ -31,11 +31,16 @@ import settings logger = get_logger("HistoryUpgrade", settings) fetchdir = settings.LAYER_FETCH_DIR -bitbakepath = os.path.join(fetchdir, 'bitbake') if not fetchdir: logger.error("Please set LAYER_FETCH_DIR in settings.py") sys.exit(1) +from layerindex.models import LayerItem +bitbakeitem = LayerItem() +bitbakeitem.vcs_url = settings.BITBAKE_REPO_URL +bitbakepath = os.path.join(fetchdir, bitbakeitem.get_fetch_dir()) +if getattr(settings, 'BITBAKE_PATH', ''): + bitbakepath = os.path.join(bitbakepath, settings.BITBAKE_PATH) def run_internal(maintplanlayerbranch, commit, commitdate, options, logger, bitbake_map, initial=False): from layerindex.models import PythonEnvironment diff --git a/rrs/tools/rrs_upstream_history.py b/rrs/tools/rrs_upstream_history.py index 73b6d91..2a17c30 100755 --- a/rrs/tools/rrs_upstream_history.py +++ b/rrs/tools/rrs_upstream_history.py @@ -33,7 +33,13 @@ if not fetchdir: sys.exit(1) # setup bitbake path -bitbakepath = os.path.join(fetchdir, 'bitbake') +from layerindex.models import LayerItem +bitbakeitem = LayerItem() +bitbakeitem.vcs_url = settings.BITBAKE_REPO_URL +bitbakepath = os.path.join(fetchdir, bitbakeitem.get_fetch_dir()) +if getattr(settings, 'BITBAKE_PATH', ''): + bitbakepath = os.path.join(bitbakepath, settings.BITBAKE_PATH) + sys.path.insert(0, os.path.join(bitbakepath, 'lib')) from layerindex.models import Recipe, LayerBranch diff --git a/rrs/tools/upgrade_history_internal.py b/rrs/tools/upgrade_history_internal.py index 842fe81..7f3b93e 100644 --- a/rrs/tools/upgrade_history_internal.py +++ b/rrs/tools/upgrade_history_internal.py @@ -448,7 +448,13 @@ def generate_history(options, layerbranch_id, commit, logger): return # setup bitbake - bitbakepath = os.path.join(fetchdir, 'bitbake') + from layerindex.models import LayerItem + bitbakeitem = LayerItem() + bitbakeitem.vcs_url = settings.BITBAKE_REPO_URL + bitbakepath = os.path.join(fetchdir, bitbakeitem.get_fetch_dir()) + if getattr(settings, 'BITBAKE_PATH', ''): + bitbakepath = os.path.join(bitbakepath, settings.BITBAKE_PATH) + if options.bitbake_rev: bitbake_rev = options.bitbake_rev if not re.match('^[0-9a-f]{40}$', bitbake_rev):