mirror of
https://git.yoctoproject.org/git/poky
synced 2026-01-01 13:58:04 +00:00
lib/oe/go: document map_arch, and raise an error on unknown architecture
Add a comment explaining what this function does and where the values come from. If the architecture isn't know, instead of returning an empty string which could fail mysteriously, raise a KeyError so it fails quickly. (From OE-Core rev: 025414c16319b068df1cd757ad9a3c987a6b871d) (From OE-Core rev: e6de433ccb2784581d6c775cce97f414ef9334b1) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Peter Marko <peter.marko@siemens.com> Signed-off-by: Steve Sakoman <steve@sakoman.com>
This commit is contained in:
parent
cac0ff2d90
commit
6707dcecb2
|
|
@ -7,6 +7,10 @@
|
|||
import re
|
||||
|
||||
def map_arch(a):
|
||||
"""
|
||||
Map our architecture names to Go's GOARCH names.
|
||||
See https://github.com/golang/go/blob/master/src/internal/syslist/syslist.go for the complete list.
|
||||
"""
|
||||
if re.match('i.86', a):
|
||||
return '386'
|
||||
elif a == 'x86_64':
|
||||
|
|
@ -31,4 +35,4 @@ def map_arch(a):
|
|||
return 'riscv64'
|
||||
elif a == 'loongarch64':
|
||||
return 'loong64'
|
||||
return ''
|
||||
raise KeyError(f"Cannot map architecture {a}")
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user