summaryrefslogtreecommitdiffstats
path: root/pym/portage/sets/security.py
diff options
context:
space:
mode:
Diffstat (limited to 'pym/portage/sets/security.py')
-rw-r--r--pym/portage/sets/security.py11
1 files changed, 4 insertions, 7 deletions
diff --git a/pym/portage/sets/security.py b/pym/portage/sets/security.py
index a172e6f8c..24661a42e 100644
--- a/pym/portage/sets/security.py
+++ b/pym/portage/sets/security.py
@@ -5,7 +5,6 @@
import os
import portage.glsa as glsa
from portage.util import grabfile, write_atomic
-from portage.const import CACHE_PATH
from portage.sets.base import PackageSet
__all__ = ["SecuritySet", "NewGlsaSet", "NewAffectedSet", "AffectedSet"]
@@ -21,13 +20,12 @@ class SecuritySet(PackageSet):
self._settings = settings
self._vardbapi = vardbapi
self._portdbapi = portdbapi
- self._checkfile = os.path.join(os.sep, self._settings["ROOT"], CACHE_PATH.lstrip(os.sep), "glsa")
self._least_change = least_change
def getGlsaList(self, skip_applied):
glsaindexlist = glsa.get_glsa_list(self._settings)
if skip_applied:
- applied_list = grabfile(self._checkfile)
+ applied_list = glsa.get_applied_glsas(self._settings)
glsaindexlist = set(glsaindexlist).difference(applied_list)
glsaindexlist = list(glsaindexlist)
glsaindexlist.sort()
@@ -48,12 +46,11 @@ class SecuritySet(PackageSet):
def updateAppliedList(self):
glsaindexlist = self.getGlsaList(True)
- applied_list = grabfile(self._checkfile)
+ applied_list = glsa.get_applied_glsas(self._settings)
for glsaid in glsaindexlist:
myglsa = glsa.Glsa(glsaid, self._settings, self._vardbapi, self._portdbapi)
- if not myglsa.isVulnerable():
- applied_list.append(glsaid)
- write_atomic(self._checkfile, "\n".join(applied_list))
+ if not myglsa.isVulnerable() and not myglsa.nr in applied_list:
+ myglsa.inject()
def singleBuilder(cls, options, settings, trees):
if "use_emerge_resoler" in options \