[csw-devel] SF.net SVN: gar:[13952] csw/mgar/gar/v2/lib/python/package.py

bdwalton at users.sourceforge.net bdwalton at users.sourceforge.net
Sun Mar 27 21:52:20 CEST 2011


Revision: 13952
          http://gar.svn.sourceforge.net/gar/?rev=13952&view=rev
Author:   bdwalton
Date:     2011-03-27 19:52:20 +0000 (Sun, 27 Mar 2011)

Log Message:
-----------
checkpkg/package.py: add third item to obsoletion dict in GetObsoletedBy to indicate presence of i obsolete so we can differntiate syntax_ok/[] which would be the value when no file is present

Modified Paths:
--------------
    csw/mgar/gar/v2/lib/python/package.py

Modified: csw/mgar/gar/v2/lib/python/package.py
===================================================================
--- csw/mgar/gar/v2/lib/python/package.py	2011-03-27 19:27:44 UTC (rev 13951)
+++ csw/mgar/gar/v2/lib/python/package.py	2011-03-27 19:52:20 UTC (rev 13952)
@@ -365,12 +365,16 @@
     http://wiki.opencsw.org/obsoleting-packages
 
     Returns:
-    A dictionary of "syntax_ok" and "obsoleted_by" where obsoleted_by
-    is a list of (pkgname, catalogname) tuples and syntax_ok is a
-    boolean.
 
+    A dictionary of "has_obsolete_info", "syntax_ok" and
+    "obsoleted_by" where obsoleted_by is a list of (pkgname,
+    catalogname) tuples and has_obsolete_info and syntax_ok are
+    booleans.
+
     If the package has not been obsoleted or the package predates the
-    implementation of this mechanism, obsoleted_by is an empty list.
+    implementation of this mechanism, obsoleted_by is an empty list
+    and has_obsolete_info will be False.
+
     If the package provides obsolescence information but the format of
     the information is invalid, syntax_ok will be False and the list
     may be empty.  It will always contain the valid entries.
@@ -381,7 +385,9 @@
     obsoleted_by_path = os.path.join(self.directory, "install", "obsolete")
 
     if not os.path.exists(obsoleted_by_path):
-      return { "syntax_ok": True, "obsoleted_by": obsoleted_by }
+      return { "syntax_ok": True,
+               "obsoleted_by": obsoleted_by,
+               "has_obsolete_info": False }
 
     with open(obsoleted_by_path, "r") as fd:
       for line in fd:
@@ -392,7 +398,9 @@
           continue
         pkgname, catalogname = fields[0:2]
         obsoleted_by.append((pkgname, catalogname))
-    return { "syntax_ok": obsoleted_syntax_ok, "obsoleted_by": obsoleted_by }
+    return { "syntax_ok": obsoleted_syntax_ok,
+             "obsoleted_by": obsoleted_by,
+             "has_obsolete_info": True }
 
   def CheckPkgpathExists(self):
     if not os.path.isdir(self.directory):


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.


More information about the devel mailing list