Commit bd2b83d9 authored by brizental's avatar brizental Committed by brizental
Browse files

Bug 2013390: Test file extension before testing zip and tarfiles.r=ahal

The tarfile check specifically has been returning false positives on DMG
files.

Differential Revision: https://phabricator.services.mozilla.com/D281070
parent ffe41bf4
Loading
Loading
Loading
Loading
+2 −2
Changes for testing/mozbase/mozinstall/mozinstall/mozinstall.py: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -121,12 +121,12 @@ def install(src, dest):
        if src.lower().endswith(".msix"):
            # MSIX packages _are_ ZIP files, so we need to look for them first.
            install_dir = _install_msix(src)
        elif zipfile.is_zipfile(src) or tarfile.is_tarfile(src):
            install_dir = mozfile.extract(src, dest)[0]
        elif src.lower().endswith(".dmg"):
            install_dir = _install_dmg(src, dest)
        elif src.lower().endswith(".exe"):
            install_dir = _install_exe(src, dest)
        elif zipfile.is_zipfile(src) or tarfile.is_tarfile(src):
            install_dir = mozfile.extract(src, dest)[0]
        else:
            raise InvalidSource(f"{src} is not a valid installer file")