Skip to content

Commit

Permalink
fix: better arm detection.
Browse files Browse the repository at this point in the history
  • Loading branch information
danielbraun89 authored Jun 11, 2023
1 parent 7714abb commit 517f0fe
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
21 changes: 11 additions & 10 deletions nanolayer/installers/gh_release/resolvers/asset_resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,17 @@

class AssetResolver:
ARCH_REGEX_MAP = {
LinuxInformationDesk.Architecture.ARMV5: "([Aa][Rr][Mm]v5)",
LinuxInformationDesk.Architecture.ARMV6: "([Aa][Rr][Mm]v6)",
LinuxInformationDesk.Architecture.ARMV7: "([Aa][Rr][Mm]v7)",
LinuxInformationDesk.Architecture.ARMHF: "([Aa][Rr][Mm]hf)",
LinuxInformationDesk.Architecture.I386: "(i386|-386|_386)",
LinuxInformationDesk.Architecture.ARM32: "([Aa]rm32|ARM32)",
LinuxInformationDesk.Architecture.ARM64: "([Aa]rm64|ARM64|-ARM)",
LinuxInformationDesk.Architecture.S390: "(s390x|s390)",
LinuxInformationDesk.Architecture.PPC64: "(-ppc|ppc64|PPC64|_ppc)",
LinuxInformationDesk.Architecture.x86_64: "([Aa]md64|-x64|x64|x86[_-]64)",
LinuxInformationDesk.Architecture.ARMV5: r"([Aa][Rr][Mm]v5)",
LinuxInformationDesk.Architecture.ARMV6: r"([Aa][Rr][Mm]v6)",
LinuxInformationDesk.Architecture.ARMV7: r"([Aa][Rr][Mm]v7)",
LinuxInformationDesk.Architecture.ARMHF: r"([Aa][Rr][Mm]hf)",
LinuxInformationDesk.Architecture.I386: r"(i386|\-386|_386)",
LinuxInformationDesk.Architecture.I686: r"(i686|\-686|_686)",
LinuxInformationDesk.Architecture.ARM32: r"([Aa]rm32|ARM32)",
LinuxInformationDesk.Architecture.ARM64: r"([Aa]rm64|ARM64|\-ARM|\-arm\-)",
LinuxInformationDesk.Architecture.S390: r"(s390x|s390)",
LinuxInformationDesk.Architecture.PPC64: r"(\-ppc|ppc64|PPC64|_ppc)",
LinuxInformationDesk.Architecture.x86_64: r"([Aa]md64|\-x64|x64|x86[_-]64)",
}

class PlatformType(Enum):
Expand Down
3 changes: 3 additions & 0 deletions nanolayer/utils/linux_information_desk.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class Architecture(Enum):
ARMHF = "armhf"
ARM32 = "arm32"
I386 = "i386"
I686 = "i686"
PPC64 = "ppc64"
S390 = "s390"
OTHER = "other"
Expand All @@ -64,6 +65,8 @@ def get_architecture(cls) -> "LinuxInformationDesk.Architecture":
return cls.Architecture.ARMHF
if "i386" in architecture:
return cls.Architecture.I386
if "i686" in architecture:
return cls.Architecture.I686
if "ppc" in architecture:
return cls.Architecture.PPC64
if "arm32" in architecture:
Expand Down

0 comments on commit 517f0fe

Please sign in to comment.