Use dpkg --print-architecture to determine the local package architecture.

This commit is contained in:
Jeffrey Townsend
2018-12-28 15:39:48 +00:00
parent 2592bbbd9b
commit 504e168051
3 changed files with 6 additions and 6 deletions

View File

@@ -41,11 +41,7 @@ class OnlSystemConfig(object):
self.variables = {}
self.variables['PLATFORM'] = platform.platform()
self.variables['ARCH'] = pp.machine()
self.variables['PARCH'] = dict(ppc='powerpc',
x86_64='amd64',
armv7l='armel',
aarch64='arm64')[pp.machine()]
self.variables['PARCH'] = onl.util.dpkg_architecture()
self.config = {}
for dir_ in self.SYSTEM_CONFIG_DIRS:
if os.path.isdir(dir_):

View File

@@ -15,6 +15,7 @@ import string
import argparse
import yaml
from time import sleep
import onl.util
from onl.platform.current import OnlPlatform, OnlPlatformName
from onl.mounts import OnlMountManager, OnlMountContextReadOnly, OnlMountContextReadWrite
@@ -37,7 +38,7 @@ class BaseUpgrade(object):
self.init_argparser()
self.load_config()
self.arch = pp.machine()
self.parch = dict(ppc='powerpc', x86_64='amd64', armv7l='armel', aarch64='arm64')[self.arch]
self.parch = onl.util.dpkg_architecture()
self.platform = OnlPlatform()
self.init()

View File

@@ -148,3 +148,6 @@ def wget(url, directory=None, temp_directory=None, extension=None):
return (None, filename, directory)
except subprocess.CalledProcessError, e:
return (e, None, None)
def dpkg_architecture():
return subprocess.check_output("dpkg --print-architecture", shell=True).strip()