Prepare for aarch64 host support, fix typo in arch mapping

Relates to #106.
This commit is contained in:
Oliver Smith 2017-06-27 00:28:11 +02:00
parent fcc5501a44
commit 19b93c2d04
No known key found for this signature in database
GPG Key ID: 5AE7F5513E0885CB
1 changed files with 9 additions and 9 deletions

View File

@ -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/>.
"""
import platform
import logging
import fnmatch
@ -25,13 +24,14 @@ def alpine_native():
machine = platform.machine()
ret = ""
if machine == "x86_64":
ret = "x86_64"
else:
raise ValueError("Can not map platform.machine " + machine +
" to the right Alpine Linux architecture")
logging.debug("(native) Alpine architecture: " + ret)
mapping = {
"x86_64": "x86_64",
"aarch64": "aarch64"
}
if machine in mapping:
return mapping[machine]
raise ValueError("Can not map platform.machine " + machine +
" to the right Alpine Linux architecture")
return ret
@ -95,7 +95,7 @@ def alpine_to_hostspec(arch):
"ppc64le": "powerpc64le-alpine-linux-musl",
"s390x": "s390x-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:
return mapping[arch]