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

wahwah at users.sourceforge.net wahwah at users.sourceforge.net
Tue Mar 29 10:29:08 CEST 2011


Revision: 14007
          http://gar.svn.sourceforge.net/gar/?rev=14007&view=rev
Author:   wahwah
Date:     2011-03-29 08:29:08 +0000 (Tue, 29 Mar 2011)

Log Message:
-----------
checkpkg: Fixed a bug in GetDependencies

It's better to have one return statement - at least it always returns a tuple.

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-29 08:27:33 UTC (rev 14006)
+++ csw/mgar/gar/v2/lib/python/package.py	2011-03-29 08:29:08 UTC (rev 14007)
@@ -353,20 +353,19 @@
     depends = []
     i_depends = []
     depend_file_path = os.path.join(self.directory, "install", "depend")
-    if not os.path.exists(depend_file_path):
-      return depends
-    with open(depend_file_path, "r") as fd:
-      for line in fd:
-        fields = re.split(c.WS_RE, line)
-        if len(fields) < 2:
-          logging.warning("Bad depends line: %s", repr(line))
-        if fields[0] == "P":
-          pkgname = fields[1]
-          pkg_desc = " ".join(fields[1:])
-          depends.append((pkgname, pkg_desc))
-        if fields[0] == "I":
-          pkgname = fields[1]
-          i_depends.append(pkgname)
+    if os.path.exists(depend_file_path):
+      with open(depend_file_path, "r") as fd:
+        for line in fd:
+          fields = re.split(c.WS_RE, line)
+          if len(fields) < 2:
+            logging.warning("Bad depends line: %s", repr(line))
+          if fields[0] == "P":
+            pkgname = fields[1]
+            pkg_desc = " ".join(fields[1:])
+            depends.append((pkgname, pkg_desc))
+          if fields[0] == "I":
+            pkgname = fields[1]
+            i_depends.append(pkgname)
     return depends, i_depends
 
   def GetObsoletedBy(self):


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