public inbox for cygwin-apps-cvs@sourceware.org
help / color / mirror / Atom feed
From: Jon TURNEY <jturney@sourceware.org>
To: cygwin-apps-cvs@sourceware.org
Subject: [calm - Cygwin server-side packaging maintenance script] branch master, updated. 20200611-6-g29fe160
Date: Sun, 19 Jul 2020 15:55:45 +0000 (GMT)	[thread overview]
Message-ID: <20200719155545.3F83C3858D34@sourceware.org> (raw)




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



                 reply	other threads:[~2020-07-19 15:55 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200719155545.3F83C3858D34@sourceware.org \
    --to=jturney@sourceware.org \
    --cc=cygwin-apps-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).