Prepare for aarch64 host support, fix typo in arch mapping
Relates to #106.
This commit is contained in:
parent
fcc5501a44
commit
19b93c2d04
|
@ -17,7 +17,6 @@ You should have received a copy of the GNU General Public License
|
||||||
along with pmbootstrap. If not, see <http://www.gnu.org/licenses/>.
|
along with pmbootstrap. If not, see <http://www.gnu.org/licenses/>.
|
||||||
"""
|
"""
|
||||||
import platform
|
import platform
|
||||||
import logging
|
|
||||||
import fnmatch
|
import fnmatch
|
||||||
|
|
||||||
|
|
||||||
|
@ -25,13 +24,14 @@ def alpine_native():
|
||||||
machine = platform.machine()
|
machine = platform.machine()
|
||||||
ret = ""
|
ret = ""
|
||||||
|
|
||||||
if machine == "x86_64":
|
mapping = {
|
||||||
ret = "x86_64"
|
"x86_64": "x86_64",
|
||||||
else:
|
"aarch64": "aarch64"
|
||||||
|
}
|
||||||
|
if machine in mapping:
|
||||||
|
return mapping[machine]
|
||||||
raise ValueError("Can not map platform.machine " + machine +
|
raise ValueError("Can not map platform.machine " + machine +
|
||||||
" to the right Alpine Linux architecture")
|
" to the right Alpine Linux architecture")
|
||||||
|
|
||||||
logging.debug("(native) Alpine architecture: " + ret)
|
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
|
||||||
|
@ -95,7 +95,7 @@ def alpine_to_hostspec(arch):
|
||||||
"ppc64le": "powerpc64le-alpine-linux-musl",
|
"ppc64le": "powerpc64le-alpine-linux-musl",
|
||||||
"s390x": "s390x-alpine-linux-musl",
|
"s390x": "s390x-alpine-linux-musl",
|
||||||
"x86": "i586-alpine-linux-musl",
|
"x86": "i586-alpine-linux-musl",
|
||||||
"x86_66": "x86_64-alpine-linux-musl",
|
"x86_64": "x86_64-alpine-linux-musl",
|
||||||
}
|
}
|
||||||
if arch in mapping:
|
if arch in mapping:
|
||||||
return mapping[arch]
|
return mapping[arch]
|
||||||
|
|
Loading…
Reference in New Issue