public inbox for cygwin-apps-cvs@sourceware.org
help / color / mirror / Atom feed
From: jturney@sourceware.org
To: cygwin-apps-cvs@sourceware.org
Subject: [setup - the official Cygwin setup program] branch master, updated. release_2.899
Date: Wed, 01 Jan 2020 14:55:00 -0000	[thread overview]
Message-ID: <20200101145501.125658.qmail@sourceware.org> (raw)




https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/setup.git;h=e435a212a6e85169616a67c08eab1d9a387c6cfc

commit e435a212a6e85169616a67c08eab1d9a387c6cfc
Author: Jon Turney <jon.turney@dronecode.org.uk>
Date:   Wed Jan 1 14:38:45 2020 +0000

    Fix cases where incorrect action is stored by set_action()
    
    set_action() with action = Install_action and desired = empty version
    when curr = empty version is equivalent to action = NoChange_Action.
    
    (This can occur if we are selecting a category for install on the
    command line, and that category happens to include a package which only
    has a test version, but no current version)
    
    (For completeness, also address the case of action = Install_action,
    desired = empty_version, where curr = some version is equivalent to
    action = Uninstall_action)


Diff:
---
 package_meta.cc |   49 +++++++++++++++++++++++++------------------------
 1 files changed, 25 insertions(+), 24 deletions(-)

diff --git a/package_meta.cc b/package_meta.cc
index 940f69a..1f6ab16 100644
--- a/package_meta.cc
+++ b/package_meta.cc
@@ -549,30 +549,31 @@ packagemeta::set_action (_actions action, packageversion const &default_version,
   else if (action == Install_action)
     {
       desired = default_version;
-      if (desired)
-	{
-	  if (desired != installed)
-	    if (desired.accessible ())
-	      {
-		/* Memorize the fact that the user picked to install this package at least once. */
-		if (useraction)
-		  user_picked = true;
-
-		pick (true);
-		srcpick (false);
-	      }
-	    else
-	      {
-		pick (false);
-		srcpick (true);
-	      }
-	  else
-	    {
-	      action = NoChange_action;
-	      pick (false);
-	      srcpick (false);
-	    }
-	}
+      if (desired != installed)
+        if (desired.accessible ())
+          {
+            /* Memorize the fact that the user picked to install this package at least once. */
+            if (useraction)
+              user_picked = true;
+
+            pick (true);
+            srcpick (false);
+
+            /* Install no version is Uninstall */
+            if (!desired)
+              action = Uninstall_action;
+          }
+        else
+          {
+            pick (false);
+            srcpick (true);
+          }
+      else
+        {
+          action = NoChange_action;
+          pick (false);
+          srcpick (false);
+        }
     }
   else if (action == Reinstall_action)
     {


                 reply	other threads:[~2020-01-01 14: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=20200101145501.125658.qmail@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).