[calm - Cygwin server-side packaging maintenance script] branch master, updated. 20210408-14-gfd03d0e

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=fd03d0e762498b21ed7ac53b09feae2372faadb0

commit fd03d0e762498b21ed7ac53b09feae2372faadb0
Author: Jon Turney <[email protected]>
Date:   Mon May 17 14:57:22 2021 +0100

    Fix a crash when all versions of a package are getting removed
    
    > Traceback (most recent call last):
    >   File "/sourceware1/cygwin-staging/calm/calm/calm.py", line 578, in do_daemon
    >     state.packages = process_uploads(args, state)
    >   File "/sourceware1/cygwin-staging/calm/calm/calm.py", line 190, in process_uploads
    >     if not package.validate_packages(args, merged_packages[arch]):
    >   File "/sourceware1/cygwin-staging/calm/calm/package.py", line 844, in validate_packages
    >     if any(['_obsolete' in packages[install_p].version_hints[vr].get('category', '') for vr in packages[install_p].version_hints]):
    > KeyError: 'amd'


Diff:
---
 calm/package.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/calm/package.py b/calm/package.py
index 9c47f47..1e5b0f1 100755
--- a/calm/package.py
+++ b/calm/package.py
@@ -840,6 +840,10 @@ def validate_packages(args, packages):
         versions = defaultdict(list)
 
         for install_p in packages[source_p].is_used_by:
+            # ignore package which are getting removed
+            if install_p not in packages:
+                continue
+
             # ignore obsolete packages
             if any(['_obsolete' in packages[install_p].version_hints[vr].get('category', '') for vr in packages[install_p].version_hints]):
                 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.