repos: Better heuristics for repo 64-bitness
This commit is contained in:
parent
4469729bc1
commit
e39256876e
@ -137,14 +137,11 @@ class Binary:
|
|||||||
|
|
||||||
class Repository:
|
class Repository:
|
||||||
|
|
||||||
def __init__(self, repo_name, sources, binaries, bits=None):
|
def __init__(self, repo_name, sources, binaries, bits):
|
||||||
self.name = repo_name
|
self.name = repo_name
|
||||||
self.sources = sources
|
self.sources = sources
|
||||||
self.binaries = binaries
|
self.binaries = binaries
|
||||||
if bits is not None:
|
|
||||||
self.bits = bits
|
self.bits = bits
|
||||||
else:
|
|
||||||
self.bits = 64 if ('64' in self.name) else 32
|
|
||||||
self.reverse_prov = {} # name -> [(provide, binary)]
|
self.reverse_prov = {} # name -> [(provide, binary)]
|
||||||
self.update_indexes()
|
self.update_indexes()
|
||||||
|
|
||||||
@ -165,6 +162,8 @@ class Repository:
|
|||||||
def load(cls, repo_name, path, arch, components=('classic',)):
|
def load(cls, repo_name, path, arch, components=('classic',)):
|
||||||
src_list, bin_list = lists.read_pkglist_heders_for_repo(
|
src_list, bin_list = lists.read_pkglist_heders_for_repo(
|
||||||
path, arch, components)
|
path, arch, components)
|
||||||
|
# xxx: not the very best heuristics
|
||||||
|
bits = 64 if any('64' in a for a in arch) else 32
|
||||||
sources = {}
|
sources = {}
|
||||||
for header in src_list:
|
for header in src_list:
|
||||||
name = header[rpm.RPMTAG_NAME]
|
name = header[rpm.RPMTAG_NAME]
|
||||||
@ -179,7 +178,7 @@ class Repository:
|
|||||||
else:
|
else:
|
||||||
LOG.warning('Duplicate binaries: %s %s', found,
|
LOG.warning('Duplicate binaries: %s %s', found,
|
||||||
header.format('%{NAME}-%{EVR}:%{DISTTAG})'))
|
header.format('%{NAME}-%{EVR}:%{DISTTAG})'))
|
||||||
return cls(repo_name, sources, binaries)
|
return cls(repo_name, sources, binaries, bits=bits)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def load_from_config(cls, repo_name, config):
|
def load_from_config(cls, repo_name, config):
|
||||||
|
Loading…
Reference in New Issue
Block a user