|
36 | 36 | ) |
37 | 37 |
|
38 | 38 | from tools import feature_matrix, utils |
39 | | -from tools.feature_matrix import UNSUPPORTED |
| 39 | +from tools.feature_matrix import OLDEST_SUPPORTED_FIREFOX, UNSUPPORTED |
40 | 40 | from tools.shared import DEBUG, EMCC, exit_with_error |
41 | 41 | from tools.utils import LINUX, MACOS, WINDOWS, memoize, path_from_root, read_binary |
42 | 42 |
|
@@ -171,19 +171,16 @@ def get_firefox_version(): |
171 | 171 | # On Linux, Firefox system installation uses a specific directory structure, |
172 | 172 | # where platform.ini is not located in same directory as the browser executable. |
173 | 173 | if LINUX and exe_path.startswith('/usr/bin/'): |
174 | | - |
175 | | - # XXX |
176 | | - print('Searching for platform.ini') |
177 | | - for root, _dirs, files in os.walk("/usr"): |
178 | | - for name in files: |
179 | | - if name.endswith('.ini'): |
180 | | - print(os.path.join(root, name)) |
181 | | - print('Searching for platform.ini over') |
182 | | - |
183 | | - if os.path.isfile('/usr/lib/firefox-esr/platform.ini'): |
184 | | - ini_path = '/usr/lib/firefox-esr/platform.ini' |
185 | | - elif os.path.isfile('/usr/lib/firefox/platform.ini'): |
186 | | - ini_path = '/usr/lib/firefox/platform.ini' |
| 174 | + def find_system_firefox_platform_ini(): |
| 175 | + for path in {'/usr/lib/firefox-esr/', '/usr/lib/firefox/'}: |
| 176 | + ini = os.path.join(path, 'platform.ini') |
| 177 | + if os.path.isfile(ini): |
| 178 | + return ini |
| 179 | + |
| 180 | + ini_path = find_system_firefox_platform_ini() |
| 181 | + if not ini_path: |
| 182 | + logger.warning(f'Firefox browser detected in {EMTEST_BROWSER}, but could not find Firefox platform.ini to detect Firefox version. Assuming OLDEST_SUPPORTED_FIREFOX={OLDEST_SUPPORTED_FIREFOX}') |
| 183 | + return OLDEST_SUPPORTED_FIREFOX |
187 | 184 |
|
188 | 185 | # Extract the first numeric part before any dot (e.g. "Milestone=102.15.1" → 102) |
189 | 186 | m = re.search(r"^Milestone=(.*)$", read_file(ini_path), re.MULTILINE) |
|
0 commit comments