From 638b197406b6baaf772eb179a1cbf4d65cd977b0 Mon Sep 17 00:00:00 2001 From: Mike Hiretsky Date: Wed, 20 Jun 2018 10:46:04 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=BE=20=D1=81=D1=80=D0=B0=D0=B2=D0=BD=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D0=B5=20=D0=BF=D0=B0=D0=BA=D0=B5=D1=82=D0=BE=D0=B2=20?= =?UTF-8?q?=D0=BD=D0=B0=20=D0=B8=D0=B7=D0=BC=D0=B5=D0=BD=D1=91=D0=BD=D0=BD?= =?UTF-8?q?=D0=BE=D1=81=D1=82=D1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * IUSE сравнивается после сортировки --- pym/calculate/lib/utils/portage.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/pym/calculate/lib/utils/portage.py b/pym/calculate/lib/utils/portage.py index ed94162..e2a0c9f 100644 --- a/pym/calculate/lib/utils/portage.py +++ b/pym/calculate/lib/utils/portage.py @@ -1289,7 +1289,6 @@ class SimpleRepositoryMapper(Mapping): class EbuildInfoError(Exception): pass - class EbuildInfo(object): """ Информация о ebuild (DEPEND) из metadata @@ -1303,7 +1302,12 @@ class EbuildInfo(object): self._meta_info_path = path.join(meta_path, atom) if not path.exists(self._meta_info_path): raise EbuildInfoError("Package is not found") - self._info = self._get_info() + self._info = self.prepare_use_flags(self._get_info()) + + @staticmethod + def prepare_use_flags(d): + d["IUSE"] = tuple(sorted(x for x in d.get("IUSE","").split(' ') if x )) + return d def _get_info(self): with open(self._meta_info_path, 'r') as f: @@ -1325,7 +1329,7 @@ class EbuildInfo(object): # if res: # for k in self.support_keys: # if other[k] != self[k]: - # print k,":", other[k], "!=", self[k] + # print "DEBUG:", k,":", other[k], "!=", self[k] return res @@ -1360,7 +1364,7 @@ class InstalledPackageInfo(object): info[key] = value.strip() rep_path = path.join(self._pkg_path, 'repository') info['repository'] = readFile(rep_path).strip() - return info + return EbuildInfo.prepare_use_flags(info) def __getitem__(self, item): return self._info[item]