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 3/3] setup: implement CLI options


>From 4c4e8b0f0f80d73bd78e49ca92648b4180be99de Mon Sep 17 00:00:00 2001
From: Achim Gratz
Date: Tue, 12 Feb 2013 16:51:18 +0100
Subject: [PATCH 3/3] implement option -o/-clean-orphans to delete packages
 that are no longer available in the package source

	* choose.cc (CleanOrphansOption): Add option to indicate that
	packages which are no longer present in setup.ini are
	candidates for deletion.  This can be used when package
	sources have been switched or to clean up old installations
	that are missing several generations of package obsolescense.
	This option should be accompanied by an installation request
	for all desired categories or packages.
---
 setup/choose.cc | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/setup/choose.cc b/setup/choose.cc
index acae63b..d6a2eec 100755
--- a/setup/choose.cc
+++ b/setup/choose.cc
@@ -63,6 +63,8 @@ static const char *cvsid =
 
 #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;
@@ -250,7 +252,7 @@ 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 current   = pkg.curr || CleanOrphansOption;
       bool upgrade   =  wanted  || (!pkg.installed && basemisc) || UpgradeAlsoOption || !hasManualSelections;
       bool install   =   wanted  && !deleted && !pkg.installed;
       bool reinstall =  ((wanted  || basemisc ) && deleted) && pkg.installed.accessible ();
-- 
1.8.1.2


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

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

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