public inbox for cygwin-apps-cvs@sourceware.org
help / color / mirror / Atom feed
* [calm - Cygwin server-side packaging maintenance script] branch master, updated. 20200611-6-g29fe160
@ 2020-07-19 15:55 Jon TURNEY
  0 siblings, 0 replies; only message in thread
From: Jon TURNEY @ 2020-07-19 15:55 UTC (permalink / raw)
  To: cygwin-apps-cvs




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

commit 29fe160616b52c4a65b5d6056a6eff36bfb01561
Author: Jon Turney <jon.turney@dronecode.org.uk>
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



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-07-19 15:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-19 15:55 [calm - Cygwin server-side packaging maintenance script] branch master, updated. 20200611-6-g29fe160 Jon TURNEY

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).