This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/comdev-people.git


The following commit(s) were added to refs/heads/main by this push:
     new eb5f855  Drop old .asc files
eb5f855 is described below

commit eb5f8557b2d2f10f1be96ee820780b2fab7ca5ed
Author: Sebb <s...@apache.org>
AuthorDate: Wed Jul 2 13:02:04 2025 +0100

    Drop old .asc files
---
 tools/pgp.py | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/tools/pgp.py b/tools/pgp.py
index 699f096..9ed2d02 100644
--- a/tools/pgp.py
+++ b/tools/pgp.py
@@ -120,6 +120,19 @@ if DOW == 4 and not noRefresh and not gpgLocal:
     log.write("Refreshing the pgp database\n")
     pgpfunc('--refresh') # does not seem to have useful status/stderr output
     print("...done")
+    
+# Drop any .asc files older than a couple of days
+# They are presumably for uids that no longer exist
+# Current files are recreated each time
+log.write("Scanning for outdated .asc files")
+now = time.time()
+for filename in os.listdir(COMMITTER_KEYS):
+    if filename.endswith('asc'):
+        filepath = os.path.join(COMMITTER_KEYS, filename)
+        if os.path.getmtime(filepath) < now - 2 * 86400:
+            if os.path.isfile(filepath):
+                log.write(f"Dropping old file {filename}\n")
+                os.remove(filepath)
 
 for uid, entry in people['people'].items():
     ascfile = os.path.join(COMMITTER_KEYS, uid + ".asc")

Reply via email to