This is the mail archive of the cygwin-apps mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 2/3] setup: implement CLI options


>From 4343022ae575fc7836cf084797ba02fdc5f04d01 Mon Sep 17 00:00:00 2001
From: Achim Gratz
Date: Tue, 12 Feb 2013 16:42:57 +0100
Subject: [PATCH 2/3] additional option -g/--upgrade-also to upgrade installed
 packages in the presence of manual selections from the CLI

	* choose.cc (UpgradeAlsoOption): Add option -g/--upgrade-also
	to indicate that installed packages are candidates for
	upgrade, even when manual selection from the CLI are in
	effect.  This avoids having to run setup.exe two times, once
	to add any new packages and then again to perform any upgrades
	and instead performing the two tasks in a single run.
---
 setup/choose.cc | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/setup/choose.cc b/setup/choose.cc
index 0f260f7..acae63b 100755
--- a/setup/choose.cc
+++ b/setup/choose.cc
@@ -61,6 +61,8 @@ static const char *cvsid =
 
 #include "UserSettings.h"
 
+#include "getopt++/BoolOption.h"
+static BoolOption UpgradeAlsoOption (false, 'g', "upgrade-also", "also upgrade installed packages");
 using namespace std;
 
 extern ThreeBarProgressPage Progress;
@@ -249,7 +251,7 @@ ChooserPage::OnInit ()
       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 upgrade   =  wanted  || (!pkg.installed && basemisc) || UpgradeAlsoOption || !hasManualSelections;
       bool install   =   wanted  && !deleted && !pkg.installed;
       bool reinstall =  ((wanted  || basemisc ) && deleted) && pkg.installed.accessible ();
       bool uninstall = !(wanted  || basemisc ) && deleted;
-- 
1.8.1.2


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

SD adaptation for Waldorf microQ V2.22R2:
http://Synth.Stromeko.net/Downloads.html#WaldorfSDada

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]