[calm - Cygwin server-side packaging maintenance script] branch master, updated. 20200328-2-g758465b

Jon TURNEY via Cygwin-apps-cvs <[email protected]>
Newsgroups gmane.os.cygwin.cvs.apps
Message-ID <[email protected]>


https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/calm.git;h=758465b6105cac90244153a3d3ded4e892579fc8

commit 758465b6105cac90244153a3d3ded4e892579fc8
Author: Jon Turney <[email protected]>
Date:   Sun Mar 29 14:26:41 2020 +0100

    Ignore .bak files in upload area that hint fixer might create

https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/calm.git;h=7da8ec944a3b75d1a24aa10163612bab1c685c37

commit 7da8ec944a3b75d1a24aa10163612bab1c685c37
Author: Jon Turney <[email protected]>
Date:   Tue Feb 18 14:32:19 2020 +0000

    Fix an exception when an external-source package is errored


Diff:
---
 calm/package.py | 11 ++++++-----
 calm/uploads.py |  7 ++++++-
 2 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/calm/package.py b/calm/package.py
index c57ad91..9697201 100755
--- a/calm/package.py
+++ b/calm/package.py
@@ -930,11 +930,12 @@ def validate_package_maintainers(args, packages):
         bv = packages[p].best_version
         if bv:
             es = packages[p].version_hints[bv].get('external-source', p)
-            es_pn = packages[es].orig_name
-            if es_pn not in all_packages and p not in all_packages:
-                if bv not in past_mistakes.maint_anomalies.get(p, []):
-                    logging.error("package '%s' is not obsolete, but has no maintainer" % (p))
-                    error = True
+            if es in packages:
+                es_pn = packages[es].orig_name
+                if es_pn not in all_packages and p not in all_packages:
+                    if bv not in past_mistakes.maint_anomalies.get(p, []):
+                        logging.error("package '%s' is not obsolete, but has no maintainer" % (p))
+                        error = True
 
     return error
 
diff --git a/calm/uploads.py b/calm/uploads.py
index 1794257..fe938fa 100644
--- a/calm/uploads.py
+++ b/calm/uploads.py
@@ -79,10 +79,15 @@ def scan(m, all_packages, arch, args):
     logging.debug("reminder-timestamp %d, interval %d, next reminder %d, current time %d" % (m.reminder_time, REMINDER_INTERVAL, m.reminder_time + REMINDER_INTERVAL, time.time()))
 
     # scan package directories
-    for (dirpath, subdirs, files) in os.walk(os.path.join(basedir, 'release')):
+    for (dirpath, _subdirs, files) in os.walk(os.path.join(basedir, 'release')):
         relpath = os.path.relpath(dirpath, m.homedir())
         removed_files = []
 
+        # filter out files we don't need to consider
+        for f in sorted(files):
+            if f.endswith('.bak'):
+                files.remove(f)
+
         # skip uninteresting directories
         if (not files) or (relpath == os.path.join(arch, 'release')):
             continue
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.