Skip to content
Commits on Source (3)
......@@ -130,9 +130,13 @@ for entry in all_entries:
args.quiet or print("Claimed-Date: {}".format(format_date(entry['claimed-date'])))
if args.unclaim:
if entry['last-update'] > entry['claimed-date']:
date_to_format = datetime.utcfromtimestamp(entry['last-update'])
else:
date_to_format = datetime.utcfromtimestamp(entry['claimed-date'])
if datetime.utcnow() - date_to_format > unclaim_delta:
unclaim_pkgs.append(entry['pkg'])
args.quiet or print("Unclaimed: idle for more than {}: {}".format(unclaim_delta, datetime.utcnow() - date_to_format))
else:
args.quiet or print("Unclaimed-Since: {}".format(format_date(entry['claimed-date'])))
if entry['last-update'] > entry['claimed-date']:
......@@ -149,7 +153,7 @@ for entry in all_entries:
print("")
if args.unclaim:
args.quiet or print("Packages to unclaim: {}".format(", ".join(unclaim_pkgs)))
args.quiet or print("Editing file to unclaim: {}".format(", ".join(unclaim_pkgs)))
in_preamble = True
with open(dsa_dla_needed) as orig, open(dsa_dla_needed + '.new', 'w') as new:
for line in orig:
......