--- package-data-downloader 2016-09-08 19:02:44.913386772 -0500 +++ /usr/lib/update-notifier/package-data-downloader 2016-09-08 16:06:12.440284134 -0500 @@ -203,28 +203,33 @@ stampfile = os.path.join(STAMPDIR, relfile) file = os.path.join(DATADIR, relfile) try: - hook_date = os.stat(file).st_mtime - stamp_date = os.stat(stampfile).st_mtime - if hook_date < stamp_date: - continue + if not os.path.exists(NOTIFIER_FILE) and not os.path.exists(NOTIFIER_PERMANENT_FILE): + hook_date = os.stat(file).st_mtime + stamp_date = os.stat(stampfile).st_mtime + if hook_date < stamp_date: + continue + elif os.path.exists(stampfile): + os.unlink(stampfile) + except Exception as e: if not isinstance(e, OSError): traceback.print_exc(file=sys.stderr) + print("%s: processing..." % (relfile)) hook = debian.deb822.Deb822() files = [] sums = [] for para in hook.iter_paragraphs(open(file)): - if 'script' in para: + if 'Script' in para: if not files: record_failure(relfile) break - command = [para['script']] + command = [para['Script']] - if 'should-download' in para: + if 'Should-Download' in para: db = debconf.DebconfCommunicator('update-notifier') try: - should = db.get(para['should-download']) + should = db.get(para['Should-Download']) if should == "false": # Do nothing with this file. break @@ -268,8 +273,8 @@ # Not in a 'script' stanza, so we should have some urls try: - files.append(para['url']) - sums.append(para['sha256']) + files.append(para['Url']) + sums.append(para['Sha256']) except Exception as e: if not isinstance(e, KeyError): traceback.print_exc(file=sys.stderr) @@ -291,6 +296,8 @@ new_failures = True if new_failures: trigger_update_notifier(previous_failures, permanent=True) + if not previous_failures and os.path.exists(NOTIFIER_PERMANENT_FILE): + os.unlink(NOTIFIER_PERMANENT_FILE) # Filter out new failure reports for permanently-failed packages our_failures = [x for x in failures if x not in previous_failures] @@ -299,6 +306,8 @@ for failure in our_failures: mark_hook_failed(failure) trigger_update_notifier(our_failures) + elif os.path.exists(NOTIFIER_FILE): + os.unlink(NOTIFIER_FILE) if __name__ == "__main__":