[csw-devel] SF.net SVN: gar:[8727] csw/mgar/gar/v2

wahwah at users.sourceforge.net wahwah at users.sourceforge.net
Mon Feb 22 08:40:09 CET 2010


Revision: 8727
          http://gar.svn.sourceforge.net/gar/?rev=8727&view=rev
Author:   wahwah
Date:     2010-02-22 07:40:09 +0000 (Mon, 22 Feb 2010)

Log Message:
-----------
mGAR v2: checkpkg-libs, moving sql query assignment out of the loop, small correction to code comments

Modified Paths:
--------------
    csw/mgar/gar/v2/bin/checkpkg.d/checkpkg-libs.py
    csw/mgar/gar/v2/lib/python/checkpkg.py

Modified: csw/mgar/gar/v2/bin/checkpkg.d/checkpkg-libs.py
===================================================================
--- csw/mgar/gar/v2/bin/checkpkg.d/checkpkg-libs.py	2010-02-22 00:29:40 UTC (rev 8726)
+++ csw/mgar/gar/v2/bin/checkpkg.d/checkpkg-libs.py	2010-02-22 07:40:09 UTC (rev 8727)
@@ -81,7 +81,7 @@
   # This section is somewhat overlapping with checkpkg.AnalyzeDependencies(),
   # it has a different purpose: it reports the relationships between shared
   # libraries, binaries using them and packages providing them.  Ideally, the
-  # same bit of code with do checking and reporting.
+  # same bit of code would do both checking and reporting.
   #
   # TODO: Rewrite this using cheetah templates
   if debug and needed_sonames:

Modified: csw/mgar/gar/v2/lib/python/checkpkg.py
===================================================================
--- csw/mgar/gar/v2/lib/python/checkpkg.py	2010-02-22 00:29:40 UTC (rev 8726)
+++ csw/mgar/gar/v2/lib/python/checkpkg.py	2010-02-22 07:40:09 UTC (rev 8727)
@@ -236,6 +236,7 @@
     print "Processing %s" % SYSTEM_PKGMAP
     c = self.conn.cursor()
     count = itertools.count()
+    sql = "INSERT INTO systempkgmap (basename, path, line) VALUES (?, ?, ?);"
     for line in system_pkgmap_fd:
       i = count.next()
       if not i % 1000:
@@ -247,7 +248,6 @@
       fields = re.split(WS_RE, line)
       pkgmap_entry_path = fields[0].split("=")[0]
       pkgmap_entry_dir, pkgmap_entry_base_name = os.path.split(pkgmap_entry_path)
-      sql = "INSERT INTO systempkgmap (basename, path, line) VALUES (?, ?, ?);"
       c.execute(sql, (pkgmap_entry_base_name, pkgmap_entry_dir, line.strip()))
     print "\rAll lines of %s were processed." % SYSTEM_PKGMAP
     print "Creating the main database index."
@@ -405,7 +405,7 @@
   """This is one of the more obscure and more important pieces of code.
 
   I tried to make it simpler, but given that the operations here involve
-  whole sets of packages, it's not easy.
+  whole sets of packages, it's not easy to simplify.
   """
   so_dependencies = set()
   orphan_sonames = set()


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