diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:47:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:47:29 +0000 |
commit | 0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d (patch) | |
tree | a31f07c9bcca9d56ce61e9a1ffd30ef350d513aa /security/nss/coreconf/detect_host_arch.py | |
parent | Initial commit. (diff) | |
download | firefox-esr-0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d.tar.xz firefox-esr-0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d.zip |
Adding upstream version 115.8.0esr.upstream/115.8.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'security/nss/coreconf/detect_host_arch.py')
-rw-r--r-- | security/nss/coreconf/detect_host_arch.py | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/security/nss/coreconf/detect_host_arch.py b/security/nss/coreconf/detect_host_arch.py new file mode 100644 index 0000000000..69fd960f65 --- /dev/null +++ b/security/nss/coreconf/detect_host_arch.py @@ -0,0 +1,29 @@ +#!/usr/bin/env python +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this file, +# You can obtain one at http://mozilla.org/MPL/2.0/. + +from __future__ import print_function + +import fnmatch +import platform + +def main(): + host_arch = platform.machine().lower() + if host_arch in ('amd64', 'x86_64'): + host_arch = 'x64' + elif fnmatch.fnmatch(host_arch, 'i?86') or host_arch == 'i86pc': + host_arch = 'ia32' + elif host_arch == 'arm64': + pass + elif host_arch.startswith('arm'): + host_arch = 'arm' + elif host_arch.startswith('mips64'): + host_arch = 'mips64' + elif host_arch.startswith('mips'): + host_arch = 'mips' + print(host_arch) + +if __name__ == '__main__': + main() |