From 350427b094816ca70126e0c5602f1512e247a678 Mon Sep 17 00:00:00 2001 From: Jeffrey04 Date: Wed, 16 Oct 2024 16:47:49 +0800 Subject: [PATCH 1/2] fix firefox installation --- umake/frameworks/web.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/umake/frameworks/web.py b/umake/frameworks/web.py index cd8e0907..e5b244ad 100644 --- a/umake/frameworks/web.py +++ b/umake/frameworks/web.py @@ -50,12 +50,15 @@ class FirefoxDev(umake.frameworks.baseinstaller.BaseInstaller): def __init__(self, **kwargs): super().__init__(name="Firefox Dev", description=_("Firefox Developer Edition"), only_on_archs=_supported_archs, - download_page="https://www.mozilla.org/en-US/firefox/developer/all", + download_page=f"https://www.mozilla.org/en-US/firefox/all/desktop-developer/linux{self.get_tag_machine()}/", dir_to_decompress_in_tarball="firefox", desktop_filename="firefox-developer.desktop", required_files_path=["firefox"], **kwargs) self.arg_lang = None + def get_tag_machine(self): + return "" if platform.machine() == "x86_64" else "64" + @MainLoop.in_mainloop_thread def language_select_callback(self, url): url = url.replace("&", "&") @@ -79,20 +82,17 @@ def get_metadata_and_check_license(self, result): arch = platform.machine() arg_lang_url = None default_label = '' - tag_machine = '' - if arch == 'x86_64': - tag_machine = '64' + tag_machine = self.get_tag_machine() - reg_expression = r'href="(\S+firefox-devedition\S+os=linux{}&lang=\S+)"'.format(tag_machine) + reg_expression = r'href="\S+desktop-developer\/linux{}\/([\w\-]+)\/"'.format(tag_machine) languages = [] decoded_page = result[self.download_page].buffer.getvalue().decode() for index, p in enumerate(re.finditer(reg_expression, decoded_page)): with suppress(AttributeError): - url = p.group(1) + lang = p.group(1) - m = re.search(r'lang=(.*)', url) with suppress(AttributeError): - lang = m.group(1) + url = f'https://download.mozilla.org/?product=firefox-devedition-latest-ssl&os=linux{tag_machine}&lang={lang}' if self.arg_lang and self.arg_lang.lower() == lang.lower(): arg_lang_url = url From d633bebed33c199f50312b81bf2eefcc227f2e42 Mon Sep 17 00:00:00 2001 From: Jeffrey04 Date: Thu, 17 Oct 2024 23:38:06 +0800 Subject: [PATCH 2/2] fix 64 bit build --- umake/frameworks/web.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/umake/frameworks/web.py b/umake/frameworks/web.py index e5b244ad..3d37e2af 100644 --- a/umake/frameworks/web.py +++ b/umake/frameworks/web.py @@ -57,7 +57,7 @@ def __init__(self, **kwargs): self.arg_lang = None def get_tag_machine(self): - return "" if platform.machine() == "x86_64" else "64" + return "64" if platform.machine() == "x86_64" else "" @MainLoop.in_mainloop_thread def language_select_callback(self, url):