|
|
|
@ -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]
|
|
|
|
|