tweaks in sfascan
authorThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Wed, 2 Nov 2011 14:16:12 +0000 (15:16 +0100)
committerThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Wed, 2 Nov 2011 14:16:12 +0000 (15:16 +0100)
sfa/client/Makefile
sfa/client/sfascan.py

index af366fc..061e1b2 100644 (file)
@@ -1,5 +1,6 @@
 # recompute the SFA graphs from different locations
 
+## use -vv for the full story
 SFASCAN = ./sfascan.py -v
 
 # AMs, at least MyPLC AMs, are boring
@@ -40,8 +41,8 @@ BUNDLES-LR += http://www.planet-lab.jp:12347/@auto-plj-sa
 BUNDLES-LR += http://www.emanicslab.org:12345/@auto-elc-reg 
 BUNDLES-LR += http://www.emanicslab.org:12347/@auto-elc-sa
 
-#EXTENSIONS := png svg
-EXTENSIONS := png
+EXTENSIONS := png svg
+#EXTENSIONS := png
 
 ####################
 ALL += $(foreach bundle,$(BUNDLES),$(word 2,$(subst @, ,$(bundle))))
@@ -89,8 +90,9 @@ $(foreach bundle,$(BUNDLES),$(eval $(call bundle_version_target,$(bundle))))
 
 ####################
 clean:
-       rm -f auto-*.{out,version}
+       rm -f .auto*
        $(foreach extension,$(EXTENSIONS),rm -rf auto-*.$(extension);)
+       $(SFASCAN) -c
 
 DATE=$(shell date '+%Y-%m-%d')
 PUBEXTENSIONS=png
index 0fa5762..f252378 100755 (executable)
@@ -52,7 +52,7 @@ class VersionCache:
         except:
             logger.debug("Cannot load version cache, restarting from scratch")
             self.url2version = {}
-        logger.debug("loaded version cache with %d entries"%(len(self.url2version)))
+        logger.debug("loaded version cache with %d entries %s"%(len(self.url2version),self.url2version.keys()))
 
     def save (self):
         try:
@@ -63,8 +63,8 @@ class VersionCache:
             logger.log_exc ("Cannot save version cache into %s"%self.filename)
     def clean (self):
         try:
-            os.unlink(self.filename)
-            logger.info("Cleaned up version cache %s"%self.filename)
+            retcod=os.unlink(self.filename)
+            logger.info("Cleaned up version cache %s, retcod=%d"%(self.filename,retcod))
         except:
             logger.info ("Could not unlink version cache %s"%self.filename)
 
@@ -131,8 +131,9 @@ class Interface:
         if self.probed:
             return self._version
         ### otherwise let's look in the cache file
+        logger.debug("searching in version cache %s"%self.url())
         cached_version = VersionCache().get(self.url())
-        if cached_version:
+        if cached_version is not None:
             logger.info("Retrieved version info from cache")
             return cached_version
         ### otherwise let's do the hard work