From 136621e4b82be79bad257695c9bb93a9ce856e9f Mon Sep 17 00:00:00 2001 From: Denis Silakov Date: Thu, 27 Feb 2014 06:23:55 -0500 Subject: [PATCH] Fix handling of noarch and 32 vs 64 arch problems --- rpm5utils/synthesis.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/rpm5utils/synthesis.py b/rpm5utils/synthesis.py index f720b13..4639ea0 100644 --- a/rpm5utils/synthesis.py +++ b/rpm5utils/synthesis.py @@ -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):