|
|
|
@ -29,6 +29,7 @@ from calculate.lib.utils.files import (getProgPath, STDOUT,
|
|
|
|
|
PercentProgress, process, readFile,
|
|
|
|
|
readLinesFile)
|
|
|
|
|
from calculate.lib.utils.common import cmpVersion
|
|
|
|
|
from calculate.lib.utils.tools import ignore
|
|
|
|
|
from contextlib import closing
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -598,16 +599,18 @@ class PackageInformation:
|
|
|
|
|
pkg_list = "|".join(
|
|
|
|
|
[x['CATEGORY/PN'].replace("+", r"\+") for x in self.query_packages])
|
|
|
|
|
output = pexpect.spawn(self.eix_cmd, ["--xml", pkg_list]).read()
|
|
|
|
|
xml = ET.fromstring(output)
|
|
|
|
|
for pkg in self.query_packages:
|
|
|
|
|
cat_pn = pkg['CATEGORY/PN']
|
|
|
|
|
if not cat_pn in self.information_cache:
|
|
|
|
|
descr_node = xml.find(
|
|
|
|
|
'category[@name="%s"]/package[@name="%s"]/description'
|
|
|
|
|
% (pkg['CATEGORY'], pkg['PN']))
|
|
|
|
|
if descr_node is not None:
|
|
|
|
|
self.information_cache[cat_pn]['DESCRIPTION'] = \
|
|
|
|
|
descr_node.text
|
|
|
|
|
re_cut = re.compile("^.*?(?=<\?xml version)",re.S)
|
|
|
|
|
with ignore(ET.ParseError):
|
|
|
|
|
xml = ET.fromstring(re_cut.sub('',output))
|
|
|
|
|
for pkg in self.query_packages:
|
|
|
|
|
cat_pn = pkg['CATEGORY/PN']
|
|
|
|
|
if not cat_pn in self.information_cache:
|
|
|
|
|
descr_node = xml.find(
|
|
|
|
|
'category[@name="%s"]/package[@name="%s"]/description'
|
|
|
|
|
% (pkg['CATEGORY'], pkg['PN']))
|
|
|
|
|
if descr_node is not None:
|
|
|
|
|
self.information_cache[cat_pn]['DESCRIPTION'] = \
|
|
|
|
|
descr_node.text
|
|
|
|
|
while self.query_packages:
|
|
|
|
|
self.query_packages.pop()
|
|
|
|
|
|
|
|
|
|