Commit 7b691a00 authored by Rob Lemley's avatar Rob Lemley
Browse files

Bug 1817507 - Process lines from confvars.sh more carefully during msix 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
parent 247a1e28
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -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",