[layerindex-web][PATCH v2 2/3] recipe{desc,parse}.py: BB_ENV_PASSTHROUGH_ADDITIONS


Tim Orling
 

ERROR: Variable BB_ENV_EXTRAWHITE has been renamed to BB_ENV_PASSTHROUGH_ADDITIONS
ERROR: Variable BB_ENV_EXTRAWHITE from the shell environment has been renamed to BB_ENV_PASSTHROUGH_ADDITIONS
ERROR: Exiting to allow enviroment variables to be corrected

Replace BB_ENV_EXTRAWHITE with new variable BB_ENV_PASSTHROUGH_ADDITIONS

In order to be backward compatible with older branches, we must first check
for the presence of the bitbake commit which implemented the variable name
change, using layerindex.utils.is_commit_ancestor().

Signed-off-by: Tim Orling <tim.orling@...>
---
Changes in v2:
* Use new is_commit_ancestor check to check for the specific bitbake
commit that introduced the variable renaming. This provides for backward
compatibility in older branches (before bitbake 2.0).

layerindex/recipedesc.py | 8 +++++++-
layerindex/recipeparse.py | 7 ++++++-
2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/layerindex/recipedesc.py b/layerindex/recipedesc.py
index ee7f2fe..a844186 100644
--- a/layerindex/recipedesc.py
+++ b/layerindex/recipedesc.py
@@ -39,6 +39,7 @@ def main():
from layerindex.models import LayerItem, Recipe
from django.db import transaction
import settings
+ from layerindex.utils import is_commit_ancestor

setup_environ(settings)

@@ -62,8 +63,13 @@ def main():
print("Unable to find bitbake by searching BITBAKEDIR, specified path '%s' or its parent, or PATH" % basepath)
sys.exit(1)

+ # Commit "bitbake: Rename environment filtering variables"
+ bb_var_rename_commit = "87104b6a167188921da157c7dba45938849fb22a"
# Skip sanity checks
- os.environ['BB_ENV_EXTRAWHITE'] = 'DISABLE_SANITY_CHECKS'
+ if is_commit_ancestor(bitbakepath, bb_var_rename_commit, logger=logger):
+ os.environ['BB_ENV_PASSTHROUGH_ADDITIONS'] = 'DISABLE_SANITY_CHECKS'
+ else:
+ os.environ['BB_ENV_EXTRAWHITE'] = 'DISABLE_SANITY_CHECKS'
os.environ['DISABLE_SANITY_CHECKS'] = '1'

sys.path.extend([bitbakepath + '/lib'])
diff --git a/layerindex/recipeparse.py b/layerindex/recipeparse.py
index c918677..6202745 100644
--- a/layerindex/recipeparse.py
+++ b/layerindex/recipeparse.py
@@ -35,8 +35,13 @@ def init_parser(settings, branch, bitbakepath, enable_tracking=False, nocheckout
bitbake_ref = 'origin/%s' % branch.bitbake_branch
utils.checkout_repo(bitbakepath, bitbake_ref, logger=logger)

+ # Commit "bitbake: Rename environment filtering variables"
+ bb_var_rename_commit = "87104b6a167188921da157c7dba45938849fb22a"
# Skip sanity checks
- os.environ['BB_ENV_EXTRAWHITE'] = 'DISABLE_SANITY_CHECKS'
+ if utils.is_commit_ancestor(bitbakepath, bb_var_rename_commit, logger=logger):
+ os.environ['BB_ENV_PASSTHROUGH_ADDITIONS'] = 'DISABLE_SANITY_CHECKS'
+ else:
+ os.environ['BB_ENV_EXTRAWHITE'] = 'DISABLE_SANITY_CHECKS'
os.environ['DISABLE_SANITY_CHECKS'] = '1'

fetchdir = settings.LAYER_FETCH_DIR
--
2.32.0