Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix firefox installation #704

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions umake/frameworks/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 "64" if platform.machine() == "x86_64" else ""

@MainLoop.in_mainloop_thread
def language_select_callback(self, url):
url = url.replace("&", "&")
Expand All @@ -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
Expand Down
Loading