mirror of
https://abf.rosa.ru/djam/urpm-tools.git
synced 2025-02-23 09:22:47 +00:00
Fix handling of noarch and 32 vs 64 arch problems
This commit is contained in:
parent
23fc962440
commit
136621e4b8
1 changed files with 7 additions and 7 deletions
|
@ -158,7 +158,7 @@ class NEVR(object):
|
|||
@staticmethod
|
||||
def from_filename(rpmname, E=None):
|
||||
''' Returns [name, version] for given rpm file or package name '''
|
||||
suffix = ['.x86_64', '.noarch'] + ['.i%s86' % i for i in range(3,6)]
|
||||
suffix = ['.x86_64', '.noarch', '.i386', '.i486', '.i586', '.i686']
|
||||
for s in suffix:
|
||||
if(rpmname.endswith(s)):
|
||||
rpmname = rpmname[:-len(s)]
|
||||
|
@ -322,7 +322,7 @@ class PackageSet:
|
|||
global fields
|
||||
fields = {"provides":[], "requires":[], "obsoletes":[], "suggests":[],
|
||||
"conflicts":[], "info":[], "summary":[]}
|
||||
arches32 = ['i%d86' for i in range(3,6)]
|
||||
arches32 = ['i386', 'i486', 'i586', 'i686']
|
||||
for tag in PackageSet.tags:
|
||||
self.what[tag] = {}
|
||||
|
||||
|
@ -348,7 +348,7 @@ class PackageSet:
|
|||
shutil.rmtree(tmppath)
|
||||
elif(synthesis_list.startswith("/")): #local file
|
||||
if not os.path.exists(synthesis_list):
|
||||
eprint(_('Could not read synthesis file. (File %s not found)') % synthesis_list)
|
||||
print(_('Could not read synthesis file. (File %s not found)') % synthesis_list)
|
||||
continue
|
||||
r = open(synthesis_list)
|
||||
s = r.read()
|
||||
|
@ -379,11 +379,11 @@ class PackageSet:
|
|||
nevr.DE = items[7]
|
||||
|
||||
arch = items[2].split('.')[-1]
|
||||
if arch in arches32 and ARCH in arches:
|
||||
if arch in arches32 and ARCH in arches32:
|
||||
arch = ARCH
|
||||
|
||||
in_repo = nevr.N in self.packages
|
||||
new_arch_correct = (arch == ARCH or arch == 'noarch' or ARCH == 'noarch')
|
||||
new_arch_correct = (arch == ARCH or arch == 'noarch')
|
||||
|
||||
if in_repo:
|
||||
if nevr.DE == self.packages[nevr.N]['nevr'].DE:
|
||||
|
@ -391,7 +391,7 @@ class PackageSet:
|
|||
else:
|
||||
ver_newer = (nevr.DE > self.packages[nevr.N]['nevr'].DE)
|
||||
|
||||
old_arch_correct = (self.packages[nevr.N]['arch'] == ARCH or self.packages[nevr.N]['arch'] == 'noarch' or ARCH == 'noarch')
|
||||
old_arch_correct = (self.packages[nevr.N]['arch'] == ARCH or self.packages[nevr.N]['arch'] == 'noarch')
|
||||
else:
|
||||
ver_newer = None
|
||||
old_arch_correct = None
|
||||
|
@ -427,7 +427,7 @@ class PackageSet:
|
|||
self.packages[nevr.N]['medium'] = medium_by_synth[synthesis_list]
|
||||
clear_data()
|
||||
except (HTTPError,URLError):
|
||||
eprint(_("File can not be processed! Url: ") + synthesis_list)
|
||||
print(_("File can not be processed! Url: ") + synthesis_list)
|
||||
|
||||
|
||||
def whattag(self, tag, val):
|
||||
|
|
Loading…
Add table
Reference in a new issue