Browse Source

Сброс кэша если в списке пакетов есть blocks

develop 3.3.2.1
Mike Khiretskiy 7 years ago
parent
commit
8b467fc281
  1. 4
      pym/update/emerge_parser.py
  2. 3
      pym/update/update.py

4
pym/update/emerge_parser.py

@ -207,18 +207,22 @@ class InstallPackagesBlock(EmergeInformationBlock):
"""
list = PackageList([])
remove_list = PackageList([])
block_packages = False
_new_line = EmergeInformationBlock._new_line
_color_block = EmergeInformationBlock._color_block
token = "\n["
end_token = ["\r\n\r", "\n\n"]
re_block = re.compile(r"((?:^\[.*?{nl})+)".format(nl=_new_line),
re.MULTILINE)
re_blocks = re.compile(r"\[{c}blocks{c} {c}b".format(c=_color_block))
def get_data(self, match):
super(InstallPackagesBlock, self).get_data(match)
list_block = XmlConverter().transform(self.result).split('\n')
self.list = PackageList(map(EmergeUpdateInfo, list_block))
self.remove_list = PackageList(map(EmergeRemoveInfo, list_block))
self.block_packages = any(self.re_blocks.search(x) for x in list_block)
class UninstallPackagesBlock(EmergeInformationBlock):

3
pym/update/update.py

@ -728,6 +728,9 @@ class Update(object):
if emerge.install_packages.remove_list:
self.emerge_cache.drop_cache(
"List has packages for remove")
elif emerge.install_packages.block_packages:
self.emerge_cache.drop_cache(
"List has block packages")
else:
self.updateCache(emerge.install_packages.list)
if not emerge.install_packages.list:

Loading…
Cancel
Save