summaryrefslogtreecommitdiff
path: root/pym
diff options
context:
space:
mode:
authorfuzzyray <fuzzyray@gentoo.org>2009-05-20 21:53:30 +0000
committerfuzzyray <fuzzyray@gentoo.org>2009-05-20 21:53:30 +0000
commit4138f5b1b6dbcf1042663a45b3eae1e652bfc9be (patch)
treed97e27d65dd4946cc37720e8270b0a5f4277dbd4 /pym
parentb6a2a23926d54ccfa9a1ce331c1bc97dbe2c73d1 (diff)
downloadgentoolkit-4138f5b1b6dbcf1042663a45b3eae1e652bfc9be.tar.gz
Do not inject GLSAs into the checkfile when fixing them
There is no reason applied GLSAs must be stored in a checkfile. In the current glsa-check GUI this will make it impossible to determine whether the system is still affected by the GLSA (e.g. by re-emerging, or when a GLSA is changed afterwards). The current place for the checkfile (/var/cache) is not persistent per FHS, meaning that people might clean out the contents of their injected GLSAs. Since glsa.py is moving to portage anyway, we can use /var/lib/portage as a place to store the injected GLSAs. Documentation has been updated accordingly. Note that the old checkfile should not be moved to the previous location on upgrade since this will cause false negatives due to the above arguments. A message should appear on upgrade (pkg_postinst or similar). svn path=/trunk/gentoolkit/; revision=649
Diffstat (limited to 'pym')
-rw-r--r--pym/gentoolkit/glsa/__init__.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/pym/gentoolkit/glsa/__init__.py b/pym/gentoolkit/glsa/__init__.py
index 2ee294f..d283835 100644
--- a/pym/gentoolkit/glsa/__init__.py
+++ b/pym/gentoolkit/glsa/__init__.py
@@ -117,7 +117,7 @@ def checkconfig(myconfig):
"GLSA_DIR": portage.settings["PORTDIR"]+"/metadata/glsa/",
"GLSA_PREFIX": "glsa-",
"GLSA_SUFFIX": ".xml",
- "CHECKFILE": "/var/cache/edb/glsa",
+ "CHECKFILE": "/var/lib/portage/glsa_injected",
"GLSA_SERVER": "www.gentoo.org/security/en/glsa/", # not completely implemented yet
"CHECKMODE": "local", # not completely implemented yet
"PRINTWIDTH": "76"
@@ -669,14 +669,16 @@ class Glsa:
or (None != getMinUpgrade([v,], path["unaff_atoms"]))
return rValue
- def isApplied(self):
+ def isInjected(self):
"""
- Looks if the GLSA IDis in the GLSA checkfile to check if this
- GLSA was already applied.
+ Looks if the GLSA ID is in the GLSA checkfile to check if this
+ GLSA should be marked as applied.
@rtype: Boolean
- @returns: True if the GLSA was applied, False if not
+ @returns: True if the GLSA is in the inject file, False if not
"""
+ if not os.access(self.config["CHECKFILE"], os.R_OK):
+ return False
aList = portage.grabfile(self.config["CHECKFILE"])
return (self.nr in aList)
@@ -689,7 +691,7 @@ class Glsa:
@rtype: None
@returns: None
"""
- if not self.isApplied():
+ if not self.isInjected():
checkfile = open(self.config["CHECKFILE"], "a+")
checkfile.write(self.nr+"\n")
checkfile.close()