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

cgrzemba at users.sourceforge.net cgrzemba at users.sourceforge.net
Mon Apr 16 17:57:24 CEST 2012


Revision: 17711
          http://gar.svn.sourceforge.net/gar/?rev=17711&view=rev
Author:   cgrzemba
Date:     2012-04-16 15:57:23 +0000 (Mon, 16 Apr 2012)
Log Message:
-----------
works, but reports also standar libs

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

Modified: csw/mgar/gar/v2/lib/python/find_missing_bins.py
===================================================================
--- csw/mgar/gar/v2/lib/python/find_missing_bins.py	2012-04-16 06:17:52 UTC (rev 17710)
+++ csw/mgar/gar/v2/lib/python/find_missing_bins.py	2012-04-16 15:57:23 UTC (rev 17711)
@@ -21,6 +21,8 @@
 import subprocess
 
 catrel = 'unstable'
+cache_file_bins = 'bins-%s-%s-%s.json'
+cache_file_needed_bins = 'needed-bins-%s-%s-%s.json'
 
 class FindBins(object):
 
@@ -34,13 +36,13 @@
     key = (catrel, arch, osrel)
     if key in self.cached_catalogs_bins:
       return
-    fn_bins = "bins-%s-%s-%s.json" % key
+    fn_bins = cache_file_bins% key
     if os.path.exists(fn_bins):
       with open(fn_bins, "r") as fd:
         self.cached_catalogs_bins[key] = cjson.decode(fd.read())
-    fn_needed_bins = "needed-bins-%s-%s-%s.json" % key
+    fn_needed_bins = cache_file_needed_bins % key
     if os.path.exists(fn_needed_bins):
-      with open(fn, "r") as fd:
+      with open(fn_needed_bins, "r") as fd:
         self.cached_catalogs_needed_bins[key] = cjson.decode(fd.read())
       return
     catalog = self.rest_client.GetCatalog(*key)
@@ -102,13 +104,16 @@
       for arch in common_constants.PHYSICAL_ARCHITECTURES:
         bins = rd.getBins(catrel, arch, osrel)
         needed_bins = rd.getNeededBins(catrel, arch, osrel)
-        for pkg in bins:
-          print pkg, bins[pkg]
-        
-
-    print "found:"
-    pprint.pprint(needed_bins)
-
+        for pkg in needed_bins:
+          for nb in needed_bins[pkg]:
+            found = False
+            for npkg in bins:
+              if nb in bins[npkg]:
+		found = True
+                break
+            if found == False: 
+              print "%s not found, needed in pkg %s" % (nb,pkg)
+ 
 def main():
   parser = optparse.OptionParser()
   parser.add_option("--debug", dest="debug", action="store_true")

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