[calm - Cygwin server-side packaging maintenance script] branch master, updated. 20200611-6-g29fe160

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=29fe160616b52c4a65b5d6056a6eff36bfb01561

commit 29fe160616b52c4a65b5d6056a6eff36bfb01561
Author: Jon Turney <[email protected]>
Date:   Sun Jul 19 16:02:59 2020 +0100

    package.delete() also deletes empty packages
    
    Once a Package object no longer contains any files (archives or hints),
    it can be removed from the package set.
    
    (This fixes calm complaining when it wants to vault a stale package
    which had source, but no kept version does. Otherwise it complains that
    the source package has no versions)


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

diff --git a/calm/package.py b/calm/package.py
index a1fed9a..4151c21 100755
--- a/calm/package.py
+++ b/calm/package.py
@@ -1308,6 +1308,10 @@ def delete(packages, path, fn):
                     del packages[p].hints[h]
                     break
 
+        # if nothing remains, remove also from package set
+        if not packages[p].vermap and not packages[p].hints:
+            del packages[p]
+
 
 #
 # verify that the package path starts with a package in the list of packages
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.