Skip to content

Commit

Permalink
Bug 1817507 - Process lines from confvars.sh more carefully during ms…
Browse files Browse the repository at this point in the history
…ix repackaging. r=nalexander

browser/confvars.sh contains a comment with "MOZ_BRANDING_DIRECTORY" in it, so
"if key in line:" was True, even though the rest of the code to determine a
value failed silently.
Address the problem with multiple checks: Strip whitespace from either end of
the line, and skip comment lines. And, if value is not set, don't return yet.
This is more than strictly necessary to fix the immediate problem, but should
avoid similar bugs later.

Differential Revision: https://phabricator.services.mozilla.com/D170262
  • Loading branch information
jfx2006 committed Feb 19, 2023
1 parent 70bbd05 commit eb2cf6e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion python/mozbuild/mozbuild/repackaging/msix.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,10 +215,14 @@ def get_branding(use_official, build_app, finder, log=None):
def conf_vars_value(key):
lines = open(conf_vars).readlines()
for line in lines:
line = line.strip()
if line and line[0] == "#":
continue
if key not in line:
continue
_, _, value = line.partition("=")
value = value.strip()
if not value:
continue
log(
logging.INFO,
"msix",
Expand Down

0 comments on commit eb2cf6e

Please sign in to comment.