From 09a62d96c76333f8abda1d28156378e42630fd9a Mon Sep 17 00:00:00 2001 From: Scott Murray Date: Thu, 17 Feb 2022 17:09:32 -0500 Subject: bitbake: lib: Replace remaining "blacklist"/"whitelist" usage In line with the inclusive language migration defined at: https://wiki.yoctoproject.org/wiki/Inclusive_language replace the remaining non-backwards-compatibility related usage of "blacklist"/"whitelist" with "allowed"/"disallowed" in a few places as appropriate. (Bitbake rev: f579fb8c23d2919d25641fa4234f8a1e9c06a922) Signed-off-by: Scott Murray Signed-off-by: Richard Purdie --- bitbake/lib/bb/fetch2/__init__.py | 2 +- bitbake/lib/layerindexlib/__init__.py | 4 ++-- bitbake/lib/layerindexlib/cooker.py | 2 +- .../lib/toaster/orm/management/commands/lsupdates.py | 12 ++++++------ .../lib/toaster/toastergui/templates/projectconf.html | 10 +++++----- bitbake/lib/toaster/toastergui/views.py | 18 +++++++++--------- 6 files changed, 24 insertions(+), 24 deletions(-) (limited to 'bitbake/lib') diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py index 35fae6623a..5dfe5ff360 100644 --- a/bitbake/lib/bb/fetch2/__init__.py +++ b/bitbake/lib/bb/fetch2/__init__.py @@ -199,7 +199,7 @@ class URI(object): file://hostname/absolute/path.diff (would be IETF compliant) Note that the last case only applies to a list of - "whitelisted" schemes (currently only file://), that requires + explicitly allowed schemes (currently only file://), that requires its URIs to not have a network location. """ diff --git a/bitbake/lib/layerindexlib/__init__.py b/bitbake/lib/layerindexlib/__init__.py index 08063c571e..ac03d89876 100644 --- a/bitbake/lib/layerindexlib/__init__.py +++ b/bitbake/lib/layerindexlib/__init__.py @@ -1278,7 +1278,7 @@ class Recipe(LayerIndexItemObj_LayerBranch): filename, filepath, pn, pv, layerbranch, summary="", description="", section="", license="", homepage="", bugtracker="", provides="", bbclassextend="", - inherits="", blacklisted="", updated=None): + inherits="", disallowed="", updated=None): self.id = id self.filename = filename self.filepath = filepath @@ -1294,7 +1294,7 @@ class Recipe(LayerIndexItemObj_LayerBranch): self.bbclassextend = bbclassextend self.inherits = inherits self.updated = updated or datetime.datetime.today().isoformat() - self.blacklisted = blacklisted + self.disallowed = disallowed if isinstance(layerbranch, LayerBranch): self.layerbranch = layerbranch else: diff --git a/bitbake/lib/layerindexlib/cooker.py b/bitbake/lib/layerindexlib/cooker.py index 2de6e5faa0..ced3e06360 100644 --- a/bitbake/lib/layerindexlib/cooker.py +++ b/bitbake/lib/layerindexlib/cooker.py @@ -279,7 +279,7 @@ class CookerPlugin(layerindexlib.plugin.IndexPlugin): summary=pn, description=pn, section='?', license='?', homepage='?', bugtracker='?', provides='?', bbclassextend='?', inherits='?', - blacklisted='?', layerbranch=depBranchId) + disallowed='?', layerbranch=depBranchId) index = addElement("recipes", [recipe], index) diff --git a/bitbake/lib/toaster/orm/management/commands/lsupdates.py b/bitbake/lib/toaster/orm/management/commands/lsupdates.py index 3b950e6e15..eb097555e2 100644 --- a/bitbake/lib/toaster/orm/management/commands/lsupdates.py +++ b/bitbake/lib/toaster/orm/management/commands/lsupdates.py @@ -87,13 +87,13 @@ class Command(BaseCommand): # update branches; only those that we already have names listed in the # Releases table - whitelist_branch_names = [rel.branch_name - for rel in Release.objects.all()] - if len(whitelist_branch_names) == 0: + allowed_branch_names = [rel.branch_name + for rel in Release.objects.all()] + if len(allowed_branch_names) == 0: raise Exception("Failed to make list of branches to fetch") logger.info("Fetching metadata for %s", - " ".join(whitelist_branch_names)) + " ".join(allowed_branch_names)) # We require a non-empty bb.data, but we can fake it with a dictionary layerindex = layerindexlib.LayerIndex({"DUMMY" : "VALUE"}) @@ -101,8 +101,8 @@ class Command(BaseCommand): http_progress = Spinner() http_progress.start() - if whitelist_branch_names: - url_branches = ";branch=%s" % ','.join(whitelist_branch_names) + if allowed_branch_names: + url_branches = ";branch=%s" % ','.join(allowed_branch_names) else: url_branches = "" layerindex.load_layerindex("%s%s" % (self.apiurl, url_branches)) diff --git a/bitbake/lib/toaster/toastergui/templates/projectconf.html b/bitbake/lib/toaster/toastergui/templates/projectconf.html index bd49f1f585..d62691df1d 100644 --- a/bitbake/lib/toaster/toastergui/templates/projectconf.html +++ b/bitbake/lib/toaster/toastergui/templates/projectconf.html @@ -167,8 +167,8 @@ {% for fstype in vars_fstypes %} {% endfor %} - {% for b in vars_blacklist %} - + {% for b in vars_disallowed %} + {% endfor %} {% for b in vars_managed %} @@ -238,9 +238,9 @@ function validate_new_variable() { } } - var blacklist_configvars = document.getElementsByClassName('js-config-blacklist-name'); - for (var i = 0, length = blacklist_configvars.length; i < length; i++) { - if (blacklist_configvars[i].value.toUpperCase() == variable.toUpperCase()) { + var disallowed_configvars = document.getElementsByClassName('js-config-disallowed-name'); + for (var i = 0, length = disallowed_configvars.length; i < length; i++) { + if (disallowed_configvars[i].value.toUpperCase() == variable.toUpperCase()) { error_msg = "You cannot edit this variable in Toaster because it is set by the build servers"; } } diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py index 74f9d56963..a571b8cc18 100644 --- a/bitbake/lib/toaster/toastergui/views.py +++ b/bitbake/lib/toaster/toastergui/views.py @@ -1683,12 +1683,12 @@ if True: t=request.POST['configvarDel'].strip() pt = ProjectVariable.objects.get(pk = int(t)).delete() - # return all project settings, filter out blacklist and elsewhere-managed variables - vars_managed,vars_fstypes,vars_blacklist = get_project_configvars_context() + # return all project settings, filter out disallowed and elsewhere-managed variables + vars_managed,vars_fstypes,vars_disallowed = get_project_configvars_context() configvars_query = ProjectVariable.objects.filter(project_id = pid).all() for var in vars_managed: configvars_query = configvars_query.exclude(name = var) - for var in vars_blacklist: + for var in vars_disallowed: configvars_query = configvars_query.exclude(name = var) return_data = { @@ -1781,7 +1781,7 @@ if True: 'MACHINE', 'BBLAYERS' } - vars_blacklist = { + vars_disallowed = { 'PARALLEL_MAKE','BB_NUMBER_THREADS', 'BB_DISKMON_DIRS','BB_NUMBER_THREADS','CVS_PROXY_HOST','CVS_PROXY_PORT', 'PARALLEL_MAKE','TMPDIR', @@ -1790,7 +1790,7 @@ if True: vars_fstypes = Target_Image_File.SUFFIXES - return(vars_managed,sorted(vars_fstypes),vars_blacklist) + return(vars_managed,sorted(vars_fstypes),vars_disallowed) def projectconf(request, pid): @@ -1799,12 +1799,12 @@ if True: except Project.DoesNotExist: return HttpResponseNotFound("

Project id " + pid + " is unavailable

") - # remove blacklist and externally managed varaibles from this list - vars_managed,vars_fstypes,vars_blacklist = get_project_configvars_context() + # remove disallowed and externally managed varaibles from this list + vars_managed,vars_fstypes,vars_disallowed = get_project_configvars_context() configvars = ProjectVariable.objects.filter(project_id = pid).all() for var in vars_managed: configvars = configvars.exclude(name = var) - for var in vars_blacklist: + for var in vars_disallowed: configvars = configvars.exclude(name = var) context = { @@ -1812,7 +1812,7 @@ if True: 'configvars': configvars, 'vars_managed': vars_managed, 'vars_fstypes': vars_fstypes, - 'vars_blacklist': vars_blacklist, + 'vars_disallowed': vars_disallowed, } try: -- cgit v1.2.3-54-g00ecf