rrs: fix bitbakepath variable

Since commit[1], the bitbake default path no longer uses the path
'bitbake', but instead uses the same URL processing as the layer
fetching.

[1] https://git.yoctoproject.org/layerindex-web/commit/?id=c91372587bbddd4c595d7202e51a8740b787a06e

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Tim Orling <tim.orling@konsulko.com>
This commit is contained in:
Yi Zhao 2024-09-07 19:31:13 +08:00 committed by Tim Orling
parent 6747ed3707
commit 5b7e9423d2
4 changed files with 27 additions and 4 deletions

View File

@ -33,7 +33,13 @@ if not fetchdir:
sys.exit(1) sys.exit(1)
# setup bitbake path # 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')) sys.path.insert(0, os.path.join(bitbakepath, 'lib'))

View File

@ -31,11 +31,16 @@ import settings
logger = get_logger("HistoryUpgrade", settings) logger = get_logger("HistoryUpgrade", settings)
fetchdir = settings.LAYER_FETCH_DIR fetchdir = settings.LAYER_FETCH_DIR
bitbakepath = os.path.join(fetchdir, 'bitbake')
if not fetchdir: if not fetchdir:
logger.error("Please set LAYER_FETCH_DIR in settings.py") logger.error("Please set LAYER_FETCH_DIR in settings.py")
sys.exit(1) 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): def run_internal(maintplanlayerbranch, commit, commitdate, options, logger, bitbake_map, initial=False):
from layerindex.models import PythonEnvironment from layerindex.models import PythonEnvironment

View File

@ -33,7 +33,13 @@ if not fetchdir:
sys.exit(1) sys.exit(1)
# setup bitbake path # 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')) sys.path.insert(0, os.path.join(bitbakepath, 'lib'))
from layerindex.models import Recipe, LayerBranch from layerindex.models import Recipe, LayerBranch

View File

@ -448,7 +448,13 @@ def generate_history(options, layerbranch_id, commit, logger):
return return
# setup bitbake # 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: if options.bitbake_rev:
bitbake_rev = options.bitbake_rev bitbake_rev = options.bitbake_rev
if not re.match('^[0-9a-f]{40}$', bitbake_rev): if not re.match('^[0-9a-f]{40}$', bitbake_rev):