From 6b43c61fa2388b25413b7a8052151543a906179d Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Wed, 2 Nov 2011 15:16:12 +0100 Subject: [PATCH] tweaks in sfascan --- sfa/client/Makefile | 8 +++++--- sfa/client/sfascan.py | 9 +++++---- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/sfa/client/Makefile b/sfa/client/Makefile index af366fcc..061e1b2e 100644 --- a/sfa/client/Makefile +++ b/sfa/client/Makefile @@ -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 diff --git a/sfa/client/sfascan.py b/sfa/client/sfascan.py index 0fa5762e..f252378b 100755 --- a/sfa/client/sfascan.py +++ b/sfa/client/sfascan.py @@ -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 -- 2.47.0