mirror of
https://github.com/Telecominfraproject/OpenNetworkLinux.git
synced 2025-12-25 09:17:08 +00:00
Use dpkg --print-architecture to determine the local package architecture.
This commit is contained in:
@@ -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_):
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user