[calm - Cygwin server-side packaging maintenance script] branch master, updated. 20230209-117-g8653d5f
Jon Turney
jturney@sourceware.org
Thu Jul 11 15:25:54 GMT 2024
https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/calm.git;h=8653d5f97598f7e797af2854adac6ed68c51c6f3
commit 8653d5f97598f7e797af2854adac6ed68c51c6f3
Author: Jon Turney <jon.turney@dronecode.org.uk>
Date: Thu Jul 11 16:07:21 2024 +0100
Handle errors from repology API slightly better
https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/calm.git;h=90325bbb90df47234f779571c5f7d22179662614
commit 90325bbb90df47234f779571c5f7d22179662614
Author: Jon Turney <jon.turney@dronecode.org.uk>
Date: Fri Jun 21 15:28:12 2024 +0100
Fix mail intactive maintainers tool
Also a few tweaks to text
Diff:
---
calm/mail-inactive-maintainers.py | 7 +++----
calm/repology.py | 11 ++++++++++-
2 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/calm/mail-inactive-maintainers.py b/calm/mail-inactive-maintainers.py
index bb62fbd..fe01b50 100644
--- a/calm/mail-inactive-maintainers.py
+++ b/calm/mail-inactive-maintainers.py
@@ -36,10 +36,9 @@ from . import utils
MAINTAINER_ACTIVITY_THRESHOLD_YEARS = 10
template = '''
-
Hi {},
-As a part of keeping cygwin secure, your package maintainer account has been
+As a part of keeping Cygwin secure, your package maintainer account has been
found to be long inactive, and will soon be disabled, and your packages moved to
'ORPHANED' status.
@@ -83,12 +82,12 @@ def main(args):
pkg_list = [packages[arch][p].orig_name for p in a.pkgs]
hdr = {}
- hdr['To'] = a.email
+ hdr['To'] = ','.join(a.email)
hdr['From'] = 'cygwin-no-reply@cygwin.com'
hdr['Envelope-From'] = common_constants.ALWAYS_BCC # we want to see bounces
hdr['Reply-To'] = 'cygwin-apps@cygwin.com'
hdr['Bcc'] = common_constants.ALWAYS_BCC
- hdr['Subject'] = 'cygwin package maintainer account for %s' % a.name
+ hdr['Subject'] = 'upcoming removal of cygwin package maintainer account for %s' % a.name
hdr['X-Calm-Inactive-Maintainer'] = '1'
msg = template.format(a.name, pkg2html.tsformat(last_activity), '\n'.join(pkg_list))
diff --git a/calm/repology.py b/calm/repology.py
index bb2595b..487daca 100644
--- a/calm/repology.py
+++ b/calm/repology.py
@@ -29,6 +29,7 @@
import json
import logging
import time
+import urllib.error
import urllib.request
from collections import namedtuple
@@ -62,7 +63,15 @@ def repology_fetch_versions():
url = url + last_pn + '/'
url += '?inrepo=cygwin'
- r = urllib.request.urlopen(url)
+ request = urllib.request.Request(url)
+ request.add_header('User-Agent', 'CygwinUpstreamVersionFetch/1.0 +http://cygwin.com/')
+
+ try:
+ r = urllib.request.urlopen(request)
+ except urllib.error.URLError as e:
+ logging.error("consulting repology for upstream versions failed: %s" % (e.reason))
+ return {}
+
j = json.loads(r.read().decode('utf-8'))
for pn in sorted(j.keys()):
More information about the Cygwin-apps-cvs
mailing list