public inbox for cygwin-apps@cygwin.com
 help / color / mirror / Atom feed
From: Achim Gratz <Stromeko@nexgo.de>
To: Achim Gratz <Stromeko@nexgo.de>
Cc: cygwin-apps@cygwin.com
Subject: Re: [PATCH 4/4 setup] package re-/de-installation from CLI
Date: Wed, 24 Jul 2013 20:51:00 -0000	[thread overview]
Message-ID: <878v0vadge.fsf@Rainer.invalid> (raw)
In-Reply-To: <20130724115129.GT9689@calimero.vinschen.de>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: 0004-Implement-deletion-of-orphaned-packages-and-upgradin.patch --]
[-- Type: text/x-patch, Size: 2074 bytes --]

From 8d0ee8f914e0af9b6af90909e95a0cd6c3f60215 Mon Sep 17 00:00:00 2001
From: Achim Gratz <Stromeko@Stromeko.DE>
Date: Wed, 24 Jul 2013 22:14:19 +0200
Subject: [PATCH 4/4] Implement deletion of orphaned packages and upgrading
 while installing/removing

	* choose.cc (UpgradeAlsoOption): Add new CLI option
	  -g/--upgrade-also.
	  (CleanOrphansOption): Add new CLI option -o/--delete-orphans.
	  (OnInit): Implement -g/--upgrade-also, considers all installed
	  packages as candidates for upgrades (the default when no CLI
	  package or category options have been given) also when manual
	  additions or removals are requested at the same time.
	  Implement -o/--delete-orphans, considers installed packages
	  that do not exist anymore in the package repositories as
	  candidates for deletion.
---
 choose.cc | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/choose.cc b/choose.cc
index fd75790..0e05796 100644
--- a/choose.cc
+++ b/choose.cc
@@ -61,6 +61,10 @@ static const char *cvsid =
 
 #include "UserSettings.h"
 
+#include "getopt++/BoolOption.h"
+static BoolOption UpgradeAlsoOption (false, 'g', "upgrade-also", "also upgrade installed packages");
+static BoolOption CleanOrphansOption (false, 'o', "delete-orphans", "remove orphaned packages");
+
 using namespace std;
 
 extern ThreeBarProgressPage Progress;
@@ -248,8 +252,8 @@ ChooserPage::OnInit ()
       bool deleted   = pkg.isManuallyDeleted();
       bool basemisc  = (pkg.categories.find ("Base") != pkg.categories.end ()
 		     || pkg.categories.find ("Misc") != pkg.categories.end ());
-      bool current   = pkg.curr;
-      bool upgrade   =  wanted  || (!pkg.installed && basemisc) || !hasManualSelections;
+      bool current   = pkg.curr || CleanOrphansOption;
+      bool upgrade   =  wanted  || (!pkg.installed && basemisc) || UpgradeAlsoOption || !hasManualSelections;
       bool install   =   wanted  && !deleted && !pkg.installed;
       bool reinstall =  (wanted  || basemisc ) && deleted;
       bool uninstall = !(wanted  || basemisc ) && deleted;
-- 
1.8.3.1


[-- Attachment #2: Type: text/plain, Size: 192 bytes --]


Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Factory and User Sound Singles for Waldorf rackAttack:
http://Synth.Stromeko.net/Downloads.html#WaldorfSounds

  parent reply	other threads:[~2013-07-24 20:51 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-22 18:03 [setup] " Achim Gratz
2013-07-24 11:51 ` Corinna Vinschen
2013-07-24 20:45   ` [PATCH 0/4 setup] " Achim Gratz
2013-07-24 20:53     ` [PATCH 1/4 " Achim Gratz
2013-07-25  9:48       ` Corinna Vinschen
2013-10-07 15:03       ` Jon TURNEY
2013-10-07 16:21         ` Christopher Faylor
2013-10-07 18:08           ` Jon TURNEY
2013-10-10 20:05             ` Achim Gratz
2013-10-07 18:00         ` Achim Gratz
2013-07-24 20:53     ` [PATCH 2/4 " Achim Gratz
2013-07-25 12:04       ` Corinna Vinschen
2013-07-24 20:54     ` [PATCH 4/4 " Achim Gratz
2013-07-26 12:04       ` Corinna Vinschen
2013-07-24 20:54     ` [PATCH 3/4 " Achim Gratz
2013-07-25 12:06       ` Corinna Vinschen
2013-07-25 19:52         ` Achim Gratz
2013-07-24 20:58     ` [PATCH 0/4 " Achim Gratz
2013-07-25  0:03     ` Christopher Faylor
2013-07-25  5:29       ` Achim Gratz
2013-07-25 15:18         ` Christopher Faylor
2013-07-25 19:44           ` Achim Gratz
2013-07-24 20:51   ` [PATCH 2/4 " Achim Gratz
2013-07-24 20:51   ` Achim Gratz [this message]
2013-07-24 20:51   ` [PATCH 3/4 " Achim Gratz
2013-07-24 20:51   ` [PATCH 1/4 " Achim Gratz

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=878v0vadge.fsf@Rainer.invalid \
    --to=stromeko@nexgo.de \
    --cc=cygwin-apps@cygwin.com \
    /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).