diff options
author | Angelos Evripiotis <jevripiotis@bloomberg.net> | 2019-03-27 11:34:09 +0000 |
---|---|---|
committer | Angelos Evripiotis <angelos.evripiotis@gmail.com> | 2019-04-11 13:58:33 +0000 |
commit | 16079b49f10dc561749a429842094e066a699f5f (patch) | |
tree | e913a1be2e56b76450070a99f50b354c9d139c44 /buildstream | |
parent | 0d4e40d96c773fdc769069fed4d5c654ba6d25f0 (diff) | |
download | buildstream-16079b49f10dc561749a429842094e066a699f5f.tar.gz |
platform.canonicalize_arch: be case-insensitive
On the win32 platform, uname strings can come through in ALLCAPS.
Be case-insensitive by lowercasing the arch before lookup.
Diffstat (limited to 'buildstream')
-rw-r--r-- | buildstream/_platform/platform.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/buildstream/_platform/platform.py b/buildstream/_platform/platform.py index eae464682..4c637ffa5 100644 --- a/buildstream/_platform/platform.py +++ b/buildstream/_platform/platform.py @@ -85,6 +85,8 @@ class Platform(): # @staticmethod def canonicalize_arch(arch): + # Note that these are all expected to be lowercase, as we want a + # case-insensitive lookup. Windows can report its arch in ALLCAPS. aliases = { "aarch32": "aarch32", "aarch64": "aarch64", @@ -109,7 +111,7 @@ class Platform(): } try: - return aliases[arch.replace('_', '-')] + return aliases[arch.replace('_', '-').lower()] except KeyError: raise PlatformError("Unknown architecture: {}".format(arch)) |