aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarius Mauch <genone@gentoo.org>2007-11-09 15:38:48 +0000
committerMarius Mauch <genone@gentoo.org>2007-11-09 15:38:48 +0000
commitd042fff18f2b7621dc0ec11c57e9c5b1936c8ca2 (patch)
tree902329b6b4a82924e214decc2af127c025f9fc60 /pym/portage/glsa.py
parentMove glsa-check from gentoolkit into portage so the gentoolkit version can be... (diff)
downloadportage-d042fff18f2b7621dc0ec11c57e9c5b1936c8ca2.tar.gz
portage-d042fff18f2b7621dc0ec11c57e9c5b1936c8ca2.tar.bz2
portage-d042fff18f2b7621dc0ec11c57e9c5b1936c8ca2.zip
move checkfile parsing into its own function
svn path=/main/trunk/; revision=8479
Diffstat (limited to 'pym/portage/glsa.py')
-rw-r--r--pym/portage/glsa.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/pym/portage/glsa.py b/pym/portage/glsa.py
index 91f719c8f..2d2f27b30 100644
--- a/pym/portage/glsa.py
+++ b/pym/portage/glsa.py
@@ -19,6 +19,18 @@ opMapping = {"le": "<=", "lt": "<", "eq": "=", "gt": ">", "ge": ">=",
NEWLINE_ESCAPE = "!;\\n" # some random string to mark newlines that should be preserved
SPACE_ESCAPE = "!;_" # some random string to mark spaces that should be preserved
+def get_applied_glsas(settings):
+ """
+ Return a list of applied or injected GLSA IDs
+
+ @type settings: portage.config
+ @param settings: portage config instance
+ @rtype: list
+ @return: list of glsa IDs
+ """
+ return grabfile(os.path.join(os.sep, settings["ROOT"], CACHE_PATH.lstrip(os.sep), "glsa"))
+
+
# TODO: use the textwrap module instead
def wrap(text, width, caption=""):
"""
@@ -553,8 +565,7 @@ class Glsa:
@rtype: Boolean
@returns: True if the GLSA was applied, False if not
"""
- aList = grabfile(os.path.join(os.sep, self.config["ROOT"], CACHE_PATH.lstrip(os.sep), "glsa"))
- return (self.nr in aList)
+ return (self.nr in get_applied_glsas())
def inject(self):
"""