diff options
Diffstat (limited to 'tsp/scripts')
-rwxr-xr-x | tsp/scripts/crawler.py | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/tsp/scripts/crawler.py b/tsp/scripts/crawler.py index 4cc1669..bbc6704 100755 --- a/tsp/scripts/crawler.py +++ b/tsp/scripts/crawler.py @@ -70,17 +70,23 @@ def get_modified_paths(discovered, timestamp): logging.info("Previous timestamp: %s", stamp) for url in discovered: logging.debug("Check for MD5SUMS change: %s", url) - for md5sums_url in [url + 'images/arm-wayland/common-wayland-3parts-armv7l-odroidu3/MD5SUMS',\ - url + 'images/x86_64-wayland/common-wayland-efi-x86_64/MD5SUMS',\ - url + 'images/ia32-wayland/common-wayland-efi-i586/MD5SUMS']: + md5sums_urls = [url + 'images/arm-wayland/common-wayland-3parts-armv7l-odroidu3/MD5SUMS',\ + url + 'images/x86_64-wayland/common-wayland-efi-x86_64/MD5SUMS',\ + url + 'images/ia32-wayland/common-wayland-efi-i586/MD5SUMS'] + change = False + for md5sums_url in md5sums_urls: try: u = urllib2.urlopen(urllib2.Request(md5sums_url, headers={"If-Modified-Since": stamp})) except urllib2.HTTPError as e: - pass + if e.code == 404: + logging.debug("MD5SUMS missing: %s", md5sums_url) + break else: - logging.info("MD5SUMS changed: %s", url) - ret.add(url) - break + logging.debug("MD5SUMS changed: %s", md5sums_url) + change = True + if change: + logging.info("Add to dispatch: %s", url) + ret.add(url) with open(timestamp, 'w') as f: f.write(str_time) return ret |