X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=update-planet;h=843c4ce69003482aecbe4079c4a1002262f4db64;hb=591b42e1371c3887b56e0bd2c55a7bca663208fe;hp=86fc4a82beba6ce14ddf1cccf37a6163c24dffa5;hpb=52296aaabfab3fd89036e1acca23cd26d2a00173;p=planet-ucc.git diff --git a/update-planet b/update-planet index 86fc4a8..843c4ce 100755 --- a/update-planet +++ b/update-planet @@ -28,6 +28,7 @@ for feed in open('feedlist').readlines(): sys.stderr.write('DEBUG: update-planet: something went wrong retrieving feed\n') # step 2: process each feed +tainted = False blogs = [] for feed in feeds: # XMLParse2 takes two paramaters, a URL and a CacheObject @@ -36,11 +37,18 @@ for feed in feeds: blog.blogTitle = feed[0] blog.feedURL = feed[1] blogs.append(blog) + # check the old copy of the cache, vs the new copy + if not feed[2] or not feed[2].cache or not blog or not blog.cache or feed[2].cache != blog.cache: + tainted = True # write the cache back down to disk cache.storeBlog(blog) else: pass +if not tainted: + sys.stderr.write('PlanetUCC: no objects have changed in the cache, not updating\n') + sys.exit(1) + # step 3: sift the feeds xmlwriter = XMLWriter.XMLWriter(blogs)