public inbox for cygwin-apps@cygwin.com
 help / color / mirror / Atom feed
* [setup] package re-/de-installation from CLI
@ 2013-07-22 18:03 Achim Gratz
  2013-07-24 11:51 ` Corinna Vinschen
  0 siblings, 1 reply; 26+ messages in thread
From: Achim Gratz @ 2013-07-22 18:03 UTC (permalink / raw)
  To: cygwin-apps


Since the patch from February doesn't apply anymore, I've pulled the
patch up to apply to the current CVS head:

http://repo.or.cz/w/cygwin-setup.git/patch/858289a3ebe90989e3eca123018aff84ad5f2d50

I've not split the patch into three parts, let me know if you prefer me
to do that again.


Remark:

The short option names would be somewhat easier to memorize if I could
use -p instead of -X:

-p / -P: remove / install packages
-c / -C: remove / install category

but then the -p/--proxy-url short option would need to be renamed (-x?).


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

SD adaptations for KORG EX-800 and Poly-800MkII V0.9:
http://Synth.Stromeko.net/Downloads.html#KorgSDada

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [setup] package re-/de-installation from CLI
  2013-07-22 18:03 [setup] package re-/de-installation from CLI Achim Gratz
@ 2013-07-24 11:51 ` Corinna Vinschen
  2013-07-24 20:45   ` [PATCH 0/4 setup] " Achim Gratz
                     ` (4 more replies)
  0 siblings, 5 replies; 26+ messages in thread
From: Corinna Vinschen @ 2013-07-24 11:51 UTC (permalink / raw)
  To: cygwin-apps

On Jul 22 20:02, Achim Gratz wrote:
> 
> Since the patch from February doesn't apply anymore, I've pulled the
> patch up to apply to the current CVS head:
> 
> http://repo.or.cz/w/cygwin-setup.git/patch/858289a3ebe90989e3eca123018aff84ad5f2d50
> 
> I've not split the patch into three parts, let me know if you prefer me
> to do that again.

I think that would make sense.  I'm, not too sure what exactly you're
doing in this patch.  It looks a bit intrusive for adding two options.
Also, your ChangeLog is incorrectly formatted.  Have a look into the
existing ChangeLog, please.

Can you please attach the patches to your mail then?


Thanks,
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 0/4 setup] package re-/de-installation from CLI
  2013-07-24 11:51 ` Corinna Vinschen
@ 2013-07-24 20:45   ` Achim Gratz
  2013-07-24 20:53     ` [PATCH 1/4 " Achim Gratz
                       ` (5 more replies)
  2013-07-24 20:51   ` [PATCH 2/4 " Achim Gratz
                     ` (3 subsequent siblings)
  4 siblings, 6 replies; 26+ messages in thread
From: Achim Gratz @ 2013-07-24 20:45 UTC (permalink / raw)
  To: cygwin-apps

Corinna Vinschen writes:
> I think that would make sense.  I'm, not too sure what exactly you're
> doing in this patch.

I hope it is a bit more clear now, otherwise just ask (or consult the
thread from February).

> It looks a bit intrusive for adding two options.

Four, actually.  I've split out the last two again into the last patch
of the series since Chris only really said he wanted the first two.  The
rest of the apparent intrusiveness really comes about because the
function that does the work has been re-implemented to use a
higher-level interface to the package DB.  There were lots of corner
cases and latent bugs with using the low-level interfaces that would
have needed cleanup otherwise.

> Also, your ChangeLog is incorrectly formatted.  Have a look into the
> existing ChangeLog, please.

I hope I matched it better this time.

> Can you please attach the patches to your mail then?

See the follow-ups.


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

Wavetables for the Waldorf Blofeld:
http://Synth.Stromeko.net/Downloads.html#BlofeldUserWavetables

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 3/4 setup] package re-/de-installation from CLI
  2013-07-24 11:51 ` Corinna Vinschen
                     ` (2 preceding siblings ...)
  2013-07-24 20:51   ` [PATCH 4/4 " Achim Gratz
@ 2013-07-24 20:51   ` Achim Gratz
  2013-07-24 20:51   ` [PATCH 1/4 " Achim Gratz
  4 siblings, 0 replies; 26+ messages in thread
From: Achim Gratz @ 2013-07-24 20:51 UTC (permalink / raw)
  To: Achim Gratz; +Cc: cygwin-apps

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: 0003-Remove-unused-method-packagedb-addCommandLinePackage.patch --]
[-- Type: text/x-patch, Size: 1440 bytes --]

From 54eeaaa766876613b39353271c91502c9cd76d52 Mon Sep 17 00:00:00 2001
From: Achim Gratz <Stromeko@Stromeko.DE>
Date: Wed, 24 Jul 2013 22:04:30 +0200
Subject: [PATCH 3/4] Remove unused method packagedb::addCommandLinePackages

	* package_db.h (packagedb::addCommandLinePackages): Remove declaration.
	* package_db.cc (packagedb::addCommandLinePackages): Remove unused method.
---
 package_db.cc | 17 -----------------
 package_db.h  |  1 -
 2 files changed, 18 deletions(-)

diff --git a/package_db.cc b/package_db.cc
index 1da931c..3578033 100644
--- a/package_db.cc
+++ b/package_db.cc
@@ -422,23 +422,6 @@ packagedb::fillMissingCategory ()
     }
 }
 
-bool
-packagedb::addCommandLinePackages ()
-{
-  bool bReturn = false;
-
-  for (packagedb::packagecollection::iterator i = packages.begin(); i != packages.end(); i++)
-    {
-      if (i->second->isManuallyWanted())
-        {
-          i->second->addToCategoryBase();
-          bReturn = true;
-        }
-    }
-
-  return bReturn;
-}
-
 void
 packagedb::defaultTrust (trusts trust)
 {
diff --git a/package_db.h b/package_db.h
index 63753aa..bc828a1 100644
--- a/package_db.h
+++ b/package_db.h
@@ -70,7 +70,6 @@ public:
   PackageDBConnectedIterator connectedBegin();
   PackageDBConnectedIterator connectedEnd();
   void fillMissingCategory();
-  bool addCommandLinePackages();
   void defaultTrust (trusts trust);
   void markUnVisited();
   void setExistence();
-- 
1.8.3.1


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



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

Factory and User Sound Singles for Waldorf Q+, Q and microQ:
http://Synth.Stromeko.net/Downloads.html#WaldorfSounds

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 2/4 setup] package re-/de-installation from CLI
  2013-07-24 11:51 ` Corinna Vinschen
  2013-07-24 20:45   ` [PATCH 0/4 setup] " Achim Gratz
@ 2013-07-24 20:51   ` Achim Gratz
  2013-07-24 20:51   ` [PATCH 4/4 " Achim Gratz
                     ` (2 subsequent siblings)
  4 siblings, 0 replies; 26+ messages in thread
From: Achim Gratz @ 2013-07-24 20:51 UTC (permalink / raw)
  To: Achim Gratz; +Cc: cygwin-apps

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: 0002-Allow-deletion-of-packages-and-categories-from-CLI-r.patch --]
[-- Type: text/x-patch, Size: 7994 bytes --]

From baab3c913d87a06b62dd14c442a15dc8c2aa9361 Mon Sep 17 00:00:00 2001
From: Achim Gratz <Stromeko@Stromeko.DE>
Date: Wed, 24 Jul 2013 22:00:36 +0200
Subject: [PATCH 2/4] Allow deletion of packages and categories from CLI,
 re-implement install from CLI

	* choose.h (hasManualSelections): Declare new variable.
	* choose.cc (OnInit): Re-implement package handling depending on
	  options given on CLI using package actions instead of
	  package_meta low-level functions.  When no CLI package or
	  category options have been given, upgrade installed packages.
	  Do not check for updates when packages are to be added or
	  removed from the CLI, but this behaviour can be requested with
	  --upgrade-also.  A package that is requested to be removed and
	  also added at the same time gets re-installed or upgraded (when
	  version curr != installed).  Uninstalled packages in categories
	  "Base" or "Misc" are always selected for installation; installed
	  packages in these categories are not eligible for deletion and
	  will be reinstalled or upgraded instead.
	* package_meta.h (ismanuallyDeleted): Declare new method.
	* package_meta.cc (DeletePackageOption): Add new CLI option
	  -x/--remove-packages, packages listed here are considered
	  candidates for deletion.
	  (DeleteCategoryOption): Add new CLI option
	  -c/--remove-categories, packages belonging to categories listed
	  here are considered candidates for deletion.
	  (hasManualSelections): Additional boolean to record if any
	  manual installations or deletions have been requested.
	  (packagemeta::isManuallyDeleted): Implement along the same lines
	  as isManuallyWanted, but for deletion candidates.
---
 choose.cc       | 43 ++++++++++++++++++++-----------------------
 choose.h        |  1 +
 package_meta.cc | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 package_meta.h  |  2 ++
 4 files changed, 78 insertions(+), 23 deletions(-)

diff --git a/choose.cc b/choose.cc
index 4e0bcd4..fd75790 100644
--- a/choose.cc
+++ b/choose.cc
@@ -239,31 +239,28 @@ ChooserPage::OnInit ()
   packagedb db;
   db.setExistence ();
   db.fillMissingCategory ();
-  bool bCommandLineAddedPackages = db.addCommandLinePackages();
 
-  // in unattended mode, if packages were selected on the command line using the --packages
-  // or --categories options, just install those selected packages and don't upgrade all others
-  // (we always install all packages in the Base or Misc categories; packages selected on the
-  // command line are added to the Base category)
-  if ((unattended_mode == unattended) && bCommandLineAddedPackages)
-    {
-      for (packagedb::packagecollection::iterator i = db.packages.begin ();
-           i != db.packages.end (); ++i)
-        {
-          packagemeta & pkg = *(i->second);
-          if (pkg.installed)
-	    pkg.desired = pkg.installed;
-          else if (pkg.categories.find ("Base") != pkg.categories.end ()
-                   || pkg.categories.find ("Misc") != pkg.categories.end ())
-            {
-              pkg.desired = pkg.trustp(TRUST_CURR);
-              pkg.desired.pick(TRUE, &pkg);
-            }
-        }
-    }
-  else
+  for (packagedb::packagecollection::iterator i = db.packages.begin ();
+       i != db.packages.end (); ++i)
     {
-      db.defaultTrust (TRUST_CURR);
+      packagemeta & pkg = *(i->second);
+      bool wanted    = pkg.isManuallyWanted();
+      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 install   =   wanted  && !deleted && !pkg.installed;
+      bool reinstall =  (wanted  || basemisc ) && deleted;
+      bool uninstall = !(wanted  || basemisc ) && deleted;
+      if (install)
+	pkg.set_action( packagemeta::Install_action, pkg.curr );
+      else if (reinstall)
+	pkg.set_action( packagemeta::Reinstall_action, pkg.curr );
+      else if (uninstall)
+	pkg.set_action( packagemeta::Uninstall_action, packageversion() );
+      else
+	pkg.set_action( packagemeta::Default_action, ((upgrade && current) ? pkg.curr : pkg.installed) );
     }
 
   ClearBusy ();
diff --git a/choose.h b/choose.h
index b24aefc..9dc5882 100644
--- a/choose.h
+++ b/choose.h
@@ -21,6 +21,7 @@
 #include "package_meta.h"
 #include "PickView.h"
 
+extern bool hasManualSelections;
 
 class ChooserPage:public PropertyPage
 {
diff --git a/package_meta.cc b/package_meta.cc
index ee4cb45..ed7a9bf 100644
--- a/package_meta.cc
+++ b/package_meta.cc
@@ -51,8 +51,11 @@ using namespace std;
 
 using namespace std;
 
+static StringArrayOption DeletePackageOption ('x', "remove-packages", "Specify packages to uninstall");
+static StringArrayOption DeleteCategoryOption ('c', "remove-categories", "Specify categories to uninstall");
 static StringArrayOption PackageOption ('P', "packages", "Specify packages to install");
 static StringArrayOption CategoryOption ('C', "categories", "Specify entire categories to install");
+bool hasManualSelections = 0;
 
 /*****************/
 
@@ -275,7 +278,9 @@ bool packagemeta::isManuallyWanted() const
 {
   static bool parsed_yet = false;
   static std::set<string> parsed_names;
+  hasManualSelections |= parsed_names.size ();
   static std::set<string> parsed_categories;
+  hasManualSelections |= parsed_categories.size ();
   bool bReturn = false;
 
   /* First time through, we parse all the names out from the 
@@ -319,6 +324,56 @@ bool packagemeta::isManuallyWanted() const
   return bReturn;
 }
 
+bool packagemeta::isManuallyDeleted() const
+{
+  static bool parsed_yet = false;
+  static std::set<string> parsed_delete;
+  hasManualSelections |= parsed_delete.size ();
+  static std::set<string> parsed_delete_categories;
+  hasManualSelections |= parsed_delete_categories.size ();
+  bool bReturn = false;
+
+  /* First time through, we parse all the names out from the
+    option string and store them away in an STL set.  */
+  if (!parsed_yet)
+  {
+    vector<string> delete_options   = DeletePackageOption;
+    vector<string> categories_options = DeleteCategoryOption;
+    for (vector<string>::iterator n = delete_options.begin ();
+		n != delete_options.end (); ++n)
+      {
+	parseNames (parsed_delete, *n);
+      }
+    for (vector<string>::iterator n = categories_options.begin ();
+		n != categories_options.end (); ++n)
+      {
+	parseNames (parsed_delete_categories, *n);
+      }
+    parsed_yet = true;
+  }
+
+  /* Once we've already parsed the option string, just do
+    a lookup in the cache of already-parsed names.  */
+  bReturn = parsed_delete.find(name) != parsed_delete.end();
+
+  /* If we didn't select the package manually, did we select any
+     of the categories it is in? */
+  if (!bReturn && parsed_delete_categories.size ())
+    {
+      std::set<std::string, casecompare_lt_op>::iterator curcat;
+      for (curcat = categories.begin (); curcat != categories.end (); curcat++)
+	if (parsed_delete_categories.find (*curcat) != parsed_delete_categories.end ())
+	  {
+	    log (LOG_PLAIN) << "Found category " << *curcat << " in package " << name << endLog;
+	    bReturn = true;
+	  }
+    }
+
+  if (bReturn)
+    log (LOG_PLAIN) << "Deleted manual package " << name << endLog;
+  return bReturn;
+}
+
 const std::string
 packagemeta::SDesc () const
 {
diff --git a/package_meta.h b/package_meta.h
index 64a77d9..2da4a65 100644
--- a/package_meta.h
+++ b/package_meta.h
@@ -106,6 +106,8 @@ public:
   std::string installed_from;
   /* true if package was selected on command-line. */
   bool isManuallyWanted() const;
+  /* true if package was deleted on command-line. */
+  bool isManuallyDeleted() const;
   /* SDesc is global in theory, across all package versions. 
      LDesc is not: it can be different per version */
   const std::string SDesc () const;
-- 
1.8.3.1


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


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

Samples for the Waldorf Blofeld:
http://Synth.Stromeko.net/Downloads.html#BlofeldSamplesExtra

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 1/4 setup] package re-/de-installation from CLI
  2013-07-24 11:51 ` Corinna Vinschen
                     ` (3 preceding siblings ...)
  2013-07-24 20:51   ` [PATCH 3/4 " Achim Gratz
@ 2013-07-24 20:51   ` Achim Gratz
  4 siblings, 0 replies; 26+ messages in thread
From: Achim Gratz @ 2013-07-24 20:51 UTC (permalink / raw)
  To: Achim Gratz; +Cc: cygwin-apps

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: 0001-Remove-detrimental-initialization.patch --]
[-- Type: text/x-patch, Size: 1035 bytes --]

From 1686e0beac98867bf1fe358a8fe9a9d8647d4a3a Mon Sep 17 00:00:00 2001
From: Achim Gratz <Stromeko@Stromeko.DE>
Date: Fri, 8 Feb 2013 20:58:20 +0100
Subject: [PATCH 1/4] Remove detrimental initialization

       * choose.cc (createListview): Remove superflous and detrimental
         default trust setting.  This has already been set correctly
         in OnInit.
---
 choose.cc | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/choose.cc b/choose.cc
index 6d5f3b7..4e0bcd4 100644
--- a/choose.cc
+++ b/choose.cc
@@ -148,11 +148,6 @@ ChooserPage::createListview ()
     log (LOG_BABBLE) << "Failed to set View button caption %ld" <<
 	 GetLastError () << endLog;
 
-  for (packagedb::packagecollection::iterator i = db.packages.begin(); i != db.packages.end(); i++)
-    {
-      i->second->set_requirements(chooser->deftrust);
-    }
-
   /* FIXME: do we need to init the desired fields ? */
   static int ta[] = { IDC_CHOOSE_KEEP, IDC_CHOOSE_CURR, IDC_CHOOSE_EXP, 0 };
   rbset (GetHWND (), ta, IDC_CHOOSE_CURR);
-- 
1.8.3.1


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


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

Waldorf MIDI Implementation & additional documentation:
http://Synth.Stromeko.net/Downloads.html#WaldorfDocs

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 4/4 setup] package re-/de-installation from CLI
  2013-07-24 11:51 ` Corinna Vinschen
  2013-07-24 20:45   ` [PATCH 0/4 setup] " Achim Gratz
  2013-07-24 20:51   ` [PATCH 2/4 " Achim Gratz
@ 2013-07-24 20:51   ` Achim Gratz
  2013-07-24 20:51   ` [PATCH 3/4 " Achim Gratz
  2013-07-24 20:51   ` [PATCH 1/4 " Achim Gratz
  4 siblings, 0 replies; 26+ messages in thread
From: Achim Gratz @ 2013-07-24 20:51 UTC (permalink / raw)
  To: Achim Gratz; +Cc: cygwin-apps

[-- 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

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 2/4 setup] package re-/de-installation from CLI
  2013-07-24 20:45   ` [PATCH 0/4 setup] " Achim Gratz
  2013-07-24 20:53     ` [PATCH 1/4 " Achim Gratz
@ 2013-07-24 20:53     ` Achim Gratz
  2013-07-25 12:04       ` Corinna Vinschen
  2013-07-24 20:54     ` [PATCH 4/4 " Achim Gratz
                       ` (3 subsequent siblings)
  5 siblings, 1 reply; 26+ messages in thread
From: Achim Gratz @ 2013-07-24 20:53 UTC (permalink / raw)
  To: cygwin-apps

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: 0002-Allow-deletion-of-packages-and-categories-from-CLI-r.patch --]
[-- Type: text/x-patch, Size: 7994 bytes --]

From baab3c913d87a06b62dd14c442a15dc8c2aa9361 Mon Sep 17 00:00:00 2001
From: Achim Gratz <Stromeko@Stromeko.DE>
Date: Wed, 24 Jul 2013 22:00:36 +0200
Subject: [PATCH 2/4] Allow deletion of packages and categories from CLI,
 re-implement install from CLI

	* choose.h (hasManualSelections): Declare new variable.
	* choose.cc (OnInit): Re-implement package handling depending on
	  options given on CLI using package actions instead of
	  package_meta low-level functions.  When no CLI package or
	  category options have been given, upgrade installed packages.
	  Do not check for updates when packages are to be added or
	  removed from the CLI, but this behaviour can be requested with
	  --upgrade-also.  A package that is requested to be removed and
	  also added at the same time gets re-installed or upgraded (when
	  version curr != installed).  Uninstalled packages in categories
	  "Base" or "Misc" are always selected for installation; installed
	  packages in these categories are not eligible for deletion and
	  will be reinstalled or upgraded instead.
	* package_meta.h (ismanuallyDeleted): Declare new method.
	* package_meta.cc (DeletePackageOption): Add new CLI option
	  -x/--remove-packages, packages listed here are considered
	  candidates for deletion.
	  (DeleteCategoryOption): Add new CLI option
	  -c/--remove-categories, packages belonging to categories listed
	  here are considered candidates for deletion.
	  (hasManualSelections): Additional boolean to record if any
	  manual installations or deletions have been requested.
	  (packagemeta::isManuallyDeleted): Implement along the same lines
	  as isManuallyWanted, but for deletion candidates.
---
 choose.cc       | 43 ++++++++++++++++++++-----------------------
 choose.h        |  1 +
 package_meta.cc | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 package_meta.h  |  2 ++
 4 files changed, 78 insertions(+), 23 deletions(-)

diff --git a/choose.cc b/choose.cc
index 4e0bcd4..fd75790 100644
--- a/choose.cc
+++ b/choose.cc
@@ -239,31 +239,28 @@ ChooserPage::OnInit ()
   packagedb db;
   db.setExistence ();
   db.fillMissingCategory ();
-  bool bCommandLineAddedPackages = db.addCommandLinePackages();
 
-  // in unattended mode, if packages were selected on the command line using the --packages
-  // or --categories options, just install those selected packages and don't upgrade all others
-  // (we always install all packages in the Base or Misc categories; packages selected on the
-  // command line are added to the Base category)
-  if ((unattended_mode == unattended) && bCommandLineAddedPackages)
-    {
-      for (packagedb::packagecollection::iterator i = db.packages.begin ();
-           i != db.packages.end (); ++i)
-        {
-          packagemeta & pkg = *(i->second);
-          if (pkg.installed)
-	    pkg.desired = pkg.installed;
-          else if (pkg.categories.find ("Base") != pkg.categories.end ()
-                   || pkg.categories.find ("Misc") != pkg.categories.end ())
-            {
-              pkg.desired = pkg.trustp(TRUST_CURR);
-              pkg.desired.pick(TRUE, &pkg);
-            }
-        }
-    }
-  else
+  for (packagedb::packagecollection::iterator i = db.packages.begin ();
+       i != db.packages.end (); ++i)
     {
-      db.defaultTrust (TRUST_CURR);
+      packagemeta & pkg = *(i->second);
+      bool wanted    = pkg.isManuallyWanted();
+      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 install   =   wanted  && !deleted && !pkg.installed;
+      bool reinstall =  (wanted  || basemisc ) && deleted;
+      bool uninstall = !(wanted  || basemisc ) && deleted;
+      if (install)
+	pkg.set_action( packagemeta::Install_action, pkg.curr );
+      else if (reinstall)
+	pkg.set_action( packagemeta::Reinstall_action, pkg.curr );
+      else if (uninstall)
+	pkg.set_action( packagemeta::Uninstall_action, packageversion() );
+      else
+	pkg.set_action( packagemeta::Default_action, ((upgrade && current) ? pkg.curr : pkg.installed) );
     }
 
   ClearBusy ();
diff --git a/choose.h b/choose.h
index b24aefc..9dc5882 100644
--- a/choose.h
+++ b/choose.h
@@ -21,6 +21,7 @@
 #include "package_meta.h"
 #include "PickView.h"
 
+extern bool hasManualSelections;
 
 class ChooserPage:public PropertyPage
 {
diff --git a/package_meta.cc b/package_meta.cc
index ee4cb45..ed7a9bf 100644
--- a/package_meta.cc
+++ b/package_meta.cc
@@ -51,8 +51,11 @@ using namespace std;
 
 using namespace std;
 
+static StringArrayOption DeletePackageOption ('x', "remove-packages", "Specify packages to uninstall");
+static StringArrayOption DeleteCategoryOption ('c', "remove-categories", "Specify categories to uninstall");
 static StringArrayOption PackageOption ('P', "packages", "Specify packages to install");
 static StringArrayOption CategoryOption ('C', "categories", "Specify entire categories to install");
+bool hasManualSelections = 0;
 
 /*****************/
 
@@ -275,7 +278,9 @@ bool packagemeta::isManuallyWanted() const
 {
   static bool parsed_yet = false;
   static std::set<string> parsed_names;
+  hasManualSelections |= parsed_names.size ();
   static std::set<string> parsed_categories;
+  hasManualSelections |= parsed_categories.size ();
   bool bReturn = false;
 
   /* First time through, we parse all the names out from the 
@@ -319,6 +324,56 @@ bool packagemeta::isManuallyWanted() const
   return bReturn;
 }
 
+bool packagemeta::isManuallyDeleted() const
+{
+  static bool parsed_yet = false;
+  static std::set<string> parsed_delete;
+  hasManualSelections |= parsed_delete.size ();
+  static std::set<string> parsed_delete_categories;
+  hasManualSelections |= parsed_delete_categories.size ();
+  bool bReturn = false;
+
+  /* First time through, we parse all the names out from the
+    option string and store them away in an STL set.  */
+  if (!parsed_yet)
+  {
+    vector<string> delete_options   = DeletePackageOption;
+    vector<string> categories_options = DeleteCategoryOption;
+    for (vector<string>::iterator n = delete_options.begin ();
+		n != delete_options.end (); ++n)
+      {
+	parseNames (parsed_delete, *n);
+      }
+    for (vector<string>::iterator n = categories_options.begin ();
+		n != categories_options.end (); ++n)
+      {
+	parseNames (parsed_delete_categories, *n);
+      }
+    parsed_yet = true;
+  }
+
+  /* Once we've already parsed the option string, just do
+    a lookup in the cache of already-parsed names.  */
+  bReturn = parsed_delete.find(name) != parsed_delete.end();
+
+  /* If we didn't select the package manually, did we select any
+     of the categories it is in? */
+  if (!bReturn && parsed_delete_categories.size ())
+    {
+      std::set<std::string, casecompare_lt_op>::iterator curcat;
+      for (curcat = categories.begin (); curcat != categories.end (); curcat++)
+	if (parsed_delete_categories.find (*curcat) != parsed_delete_categories.end ())
+	  {
+	    log (LOG_PLAIN) << "Found category " << *curcat << " in package " << name << endLog;
+	    bReturn = true;
+	  }
+    }
+
+  if (bReturn)
+    log (LOG_PLAIN) << "Deleted manual package " << name << endLog;
+  return bReturn;
+}
+
 const std::string
 packagemeta::SDesc () const
 {
diff --git a/package_meta.h b/package_meta.h
index 64a77d9..2da4a65 100644
--- a/package_meta.h
+++ b/package_meta.h
@@ -106,6 +106,8 @@ public:
   std::string installed_from;
   /* true if package was selected on command-line. */
   bool isManuallyWanted() const;
+  /* true if package was deleted on command-line. */
+  bool isManuallyDeleted() const;
   /* SDesc is global in theory, across all package versions. 
      LDesc is not: it can be different per version */
   const std::string SDesc () const;
-- 
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

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 1/4 setup] package re-/de-installation from CLI
  2013-07-24 20:45   ` [PATCH 0/4 setup] " Achim Gratz
@ 2013-07-24 20:53     ` Achim Gratz
  2013-07-25  9:48       ` Corinna Vinschen
  2013-10-07 15:03       ` Jon TURNEY
  2013-07-24 20:53     ` [PATCH 2/4 " Achim Gratz
                       ` (4 subsequent siblings)
  5 siblings, 2 replies; 26+ messages in thread
From: Achim Gratz @ 2013-07-24 20:53 UTC (permalink / raw)
  To: cygwin-apps

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: 0001-Remove-detrimental-initialization.patch --]
[-- Type: text/x-patch, Size: 1035 bytes --]

From 1686e0beac98867bf1fe358a8fe9a9d8647d4a3a Mon Sep 17 00:00:00 2001
From: Achim Gratz <Stromeko@Stromeko.DE>
Date: Fri, 8 Feb 2013 20:58:20 +0100
Subject: [PATCH 1/4] Remove detrimental initialization

       * choose.cc (createListview): Remove superflous and detrimental
         default trust setting.  This has already been set correctly
         in OnInit.
---
 choose.cc | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/choose.cc b/choose.cc
index 6d5f3b7..4e0bcd4 100644
--- a/choose.cc
+++ b/choose.cc
@@ -148,11 +148,6 @@ ChooserPage::createListview ()
     log (LOG_BABBLE) << "Failed to set View button caption %ld" <<
 	 GetLastError () << endLog;
 
-  for (packagedb::packagecollection::iterator i = db.packages.begin(); i != db.packages.end(); i++)
-    {
-      i->second->set_requirements(chooser->deftrust);
-    }
-
   /* FIXME: do we need to init the desired fields ? */
   static int ta[] = { IDC_CHOOSE_KEEP, IDC_CHOOSE_CURR, IDC_CHOOSE_EXP, 0 };
   rbset (GetHWND (), ta, IDC_CHOOSE_CURR);
-- 
1.8.3.1


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


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

Factory and User Sound Singles for Waldorf Q+, Q and microQ:
http://Synth.Stromeko.net/Downloads.html#WaldorfSounds

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 4/4 setup] package re-/de-installation from CLI
  2013-07-24 20:45   ` [PATCH 0/4 setup] " Achim Gratz
  2013-07-24 20:53     ` [PATCH 1/4 " Achim Gratz
  2013-07-24 20:53     ` [PATCH 2/4 " Achim Gratz
@ 2013-07-24 20:54     ` Achim Gratz
  2013-07-26 12:04       ` Corinna Vinschen
  2013-07-24 20:54     ` [PATCH 3/4 " Achim Gratz
                       ` (2 subsequent siblings)
  5 siblings, 1 reply; 26+ messages in thread
From: Achim Gratz @ 2013-07-24 20:54 UTC (permalink / raw)
  To: cygwin-apps

[-- 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: 180 bytes --]


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

SD adaptation for Waldorf Blofeld V1.15B11:
http://Synth.Stromeko.net/Downloads.html#WaldorfSDada

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 3/4 setup] package re-/de-installation from CLI
  2013-07-24 20:45   ` [PATCH 0/4 setup] " Achim Gratz
                       ` (2 preceding siblings ...)
  2013-07-24 20:54     ` [PATCH 4/4 " Achim Gratz
@ 2013-07-24 20:54     ` Achim Gratz
  2013-07-25 12:06       ` Corinna Vinschen
  2013-07-24 20:58     ` [PATCH 0/4 " Achim Gratz
  2013-07-25  0:03     ` Christopher Faylor
  5 siblings, 1 reply; 26+ messages in thread
From: Achim Gratz @ 2013-07-24 20:54 UTC (permalink / raw)
  To: cygwin-apps

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: 0003-Remove-unused-method-packagedb-addCommandLinePackage.patch --]
[-- Type: text/x-patch, Size: 1440 bytes --]

From 54eeaaa766876613b39353271c91502c9cd76d52 Mon Sep 17 00:00:00 2001
From: Achim Gratz <Stromeko@Stromeko.DE>
Date: Wed, 24 Jul 2013 22:04:30 +0200
Subject: [PATCH 3/4] Remove unused method packagedb::addCommandLinePackages

	* package_db.h (packagedb::addCommandLinePackages): Remove declaration.
	* package_db.cc (packagedb::addCommandLinePackages): Remove unused method.
---
 package_db.cc | 17 -----------------
 package_db.h  |  1 -
 2 files changed, 18 deletions(-)

diff --git a/package_db.cc b/package_db.cc
index 1da931c..3578033 100644
--- a/package_db.cc
+++ b/package_db.cc
@@ -422,23 +422,6 @@ packagedb::fillMissingCategory ()
     }
 }
 
-bool
-packagedb::addCommandLinePackages ()
-{
-  bool bReturn = false;
-
-  for (packagedb::packagecollection::iterator i = packages.begin(); i != packages.end(); i++)
-    {
-      if (i->second->isManuallyWanted())
-        {
-          i->second->addToCategoryBase();
-          bReturn = true;
-        }
-    }
-
-  return bReturn;
-}
-
 void
 packagedb::defaultTrust (trusts trust)
 {
diff --git a/package_db.h b/package_db.h
index 63753aa..bc828a1 100644
--- a/package_db.h
+++ b/package_db.h
@@ -70,7 +70,6 @@ public:
   PackageDBConnectedIterator connectedBegin();
   PackageDBConnectedIterator connectedEnd();
   void fillMissingCategory();
-  bool addCommandLinePackages();
   void defaultTrust (trusts trust);
   void markUnVisited();
   void setExistence();
-- 
1.8.3.1


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


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

Waldorf MIDI Implementation & additional documentation:
http://Synth.Stromeko.net/Downloads.html#WaldorfDocs

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 0/4 setup] package re-/de-installation from CLI
  2013-07-24 20:45   ` [PATCH 0/4 setup] " Achim Gratz
                       ` (3 preceding siblings ...)
  2013-07-24 20:54     ` [PATCH 3/4 " Achim Gratz
@ 2013-07-24 20:58     ` Achim Gratz
  2013-07-25  0:03     ` Christopher Faylor
  5 siblings, 0 replies; 26+ messages in thread
From: Achim Gratz @ 2013-07-24 20:58 UTC (permalink / raw)
  To: cygwin-apps

Achim Gratz writes:
> See the follow-ups.

Sorry for the double posts.  I got an error from my mailer, but then it
seems to have delivered the messages anyway while I re-sent the patches.

:-(


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

SD adaptation for Waldorf rackAttack V1.04R1:
http://Synth.Stromeko.net/Downloads.html#WaldorfSDada

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 0/4 setup] package re-/de-installation from CLI
  2013-07-24 20:45   ` [PATCH 0/4 setup] " Achim Gratz
                       ` (4 preceding siblings ...)
  2013-07-24 20:58     ` [PATCH 0/4 " Achim Gratz
@ 2013-07-25  0:03     ` Christopher Faylor
  2013-07-25  5:29       ` Achim Gratz
  5 siblings, 1 reply; 26+ messages in thread
From: Christopher Faylor @ 2013-07-25  0:03 UTC (permalink / raw)
  To: cygwin-apps

On Wed, Jul 24, 2013 at 10:41:01PM +0200, Achim Gratz wrote:
>Corinna Vinschen writes:
>> I think that would make sense.  I'm, not too sure what exactly you're
>> doing in this patch.
>
>I hope it is a bit more clear now, otherwise just ask (or consult the
>thread from February).

Are these all self-contained patches or are they interdependent?

cgf

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 0/4 setup] package re-/de-installation from CLI
  2013-07-25  0:03     ` Christopher Faylor
@ 2013-07-25  5:29       ` Achim Gratz
  2013-07-25 15:18         ` Christopher Faylor
  0 siblings, 1 reply; 26+ messages in thread
From: Achim Gratz @ 2013-07-25  5:29 UTC (permalink / raw)
  To: cygwin-apps

Christopher Faylor writes:
> Are these all self-contained patches or are they interdependent?

They constitute a series, that's why I originally offered them as a
single patch.  The split was done for (hopefully) more clarity and
separating the last part.  The fourth patch could be trivially split to
add each of the two options seperately, which would then be independent
of each other, but dependent on the second patch being present.

Of the latter two options "--upgrade-also" was briefly the default
behaviour of setup.exe, but then changed to the current default after
some discussion on the Cygwin ML.  Of course this then incensed some
folks who preferred the interim default.  Since with those other changes
it is now painless offer the choice, I thought it should be implemented.

The --delete-orphans option (suggestions for a better name are welcome)
is useful to bring an installation to a known state after it has
languished for some time or when it had been installed in a different
state before.  In essence it deletes all those packages that it finds
installed, but would not be present in a fresh install with the same
options.  I use this to get rid of manually installed packages on my
test machines or to downsize a production installation (from developer
install to user install, for instance) without having to completely nuke
it and then do a reinstall.


Regards,
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

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 1/4 setup] package re-/de-installation from CLI
  2013-07-24 20:53     ` [PATCH 1/4 " Achim Gratz
@ 2013-07-25  9:48       ` Corinna Vinschen
  2013-10-07 15:03       ` Jon TURNEY
  1 sibling, 0 replies; 26+ messages in thread
From: Corinna Vinschen @ 2013-07-25  9:48 UTC (permalink / raw)
  To: cygwin-apps

On Jul 24 22:53, Achim Gratz wrote:
> >From 1686e0beac98867bf1fe358a8fe9a9d8647d4a3a Mon Sep 17 00:00:00 2001
> From: Achim Gratz <Stromeko@Stromeko.DE>
> Date: Fri, 8 Feb 2013 20:58:20 +0100
> Subject: [PATCH 1/4] Remove detrimental initialization
> 
>        * choose.cc (createListview): Remove superflous and detrimental
>          default trust setting.  This has already been set correctly
>          in OnInit.

Thanks, applied... with fixed ChangeLog entry.  Here's how it's supposed
to look:

        * choose.cc (ChooserPage::createListview): Remove superflous and
        detrimental default trust setting.  This has already been set correctly
        in OnInit.

Note the full class::method name and The indentation in followup lines.


Thanks,
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 2/4 setup] package re-/de-installation from CLI
  2013-07-24 20:53     ` [PATCH 2/4 " Achim Gratz
@ 2013-07-25 12:04       ` Corinna Vinschen
  0 siblings, 0 replies; 26+ messages in thread
From: Corinna Vinschen @ 2013-07-25 12:04 UTC (permalink / raw)
  To: cygwin-apps

On Jul 24 22:53, Achim Gratz wrote:
> >From baab3c913d87a06b62dd14c442a15dc8c2aa9361 Mon Sep 17 00:00:00 2001
> From: Achim Gratz <...>
> Date: Wed, 24 Jul 2013 22:00:36 +0200
> Subject: [PATCH 2/4] Allow deletion of packages and categories from CLI,
>  re-implement install from CLI
> 
> 	* choose.h (hasManualSelections): Declare new variable.
> 	* choose.cc (OnInit): Re-implement package handling depending on
> 	  options given on CLI using package actions instead of
> 	  package_meta low-level functions.  When no CLI package or
> 	  category options have been given, upgrade installed packages.
> 	  Do not check for updates when packages are to be added or
> 	  removed from the CLI, but this behaviour can be requested with
> 	  --upgrade-also.  A package that is requested to be removed and
> 	  also added at the same time gets re-installed or upgraded (when
> 	  version curr != installed).  Uninstalled packages in categories
> 	  "Base" or "Misc" are always selected for installation; installed
> 	  packages in these categories are not eligible for deletion and
> 	  will be reinstalled or upgraded instead.
> 	* package_meta.h (ismanuallyDeleted): Declare new method.
> 	* package_meta.cc (DeletePackageOption): Add new CLI option
> 	  -x/--remove-packages, packages listed here are considered
> 	  candidates for deletion.
> 	  (DeleteCategoryOption): Add new CLI option
> 	  -c/--remove-categories, packages belonging to categories listed
> 	  here are considered candidates for deletion.
> 	  (hasManualSelections): Additional boolean to record if any
> 	  manual installations or deletions have been requested.
> 	  (packagemeta::isManuallyDeleted): Implement along the same lines
> 	  as isManuallyWanted, but for deletion candidates.

Applied.


Thanks,
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 3/4 setup] package re-/de-installation from CLI
  2013-07-24 20:54     ` [PATCH 3/4 " Achim Gratz
@ 2013-07-25 12:06       ` Corinna Vinschen
  2013-07-25 19:52         ` Achim Gratz
  0 siblings, 1 reply; 26+ messages in thread
From: Corinna Vinschen @ 2013-07-25 12:06 UTC (permalink / raw)
  To: cygwin-apps

On Jul 24 22:54, Achim Gratz wrote:
> >From 54eeaaa766876613b39353271c91502c9cd76d52 Mon Sep 17 00:00:00 2001
> From: Achim Gratz <...>
> Date: Wed, 24 Jul 2013 22:04:30 +0200
> Subject: [PATCH 3/4] Remove unused method packagedb::addCommandLinePackages
> 
> 	* package_db.h (packagedb::addCommandLinePackages): Remove declaration.
> 	* package_db.cc (packagedb::addCommandLinePackages): Remove unused method.

Applied.


Thanks,
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 0/4 setup] package re-/de-installation from CLI
  2013-07-25  5:29       ` Achim Gratz
@ 2013-07-25 15:18         ` Christopher Faylor
  2013-07-25 19:44           ` Achim Gratz
  0 siblings, 1 reply; 26+ messages in thread
From: Christopher Faylor @ 2013-07-25 15:18 UTC (permalink / raw)
  To: cygwin-apps

On Thu, Jul 25, 2013 at 07:28:46AM +0200, Achim Gratz wrote:
>Christopher Faylor writes:
>> Are these all self-contained patches or are they interdependent?
>
>They constitute a series, that's why I originally offered them as a
>single patch.

That doesn't answer my question.  I wasn't asking you to re-describe
what the patches do.  I was asking if each patch could be viewed as
a standalone change.  If the patches are a series, that would seem to
imply that each patch relies on a previous patch.

However, given the fact that Corinna has accepted some, but not all, of
the patches so far, the answer would seem to be that some of the
patches, at least, are self-contained.

cgf

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 0/4 setup] package re-/de-installation from CLI
  2013-07-25 15:18         ` Christopher Faylor
@ 2013-07-25 19:44           ` Achim Gratz
  0 siblings, 0 replies; 26+ messages in thread
From: Achim Gratz @ 2013-07-25 19:44 UTC (permalink / raw)
  To: cygwin-apps

Christopher Faylor writes:
> On Thu, Jul 25, 2013 at 07:28:46AM +0200, Achim Gratz wrote:
>>Christopher Faylor writes:
>>> Are these all self-contained patches or are they interdependent?
>>
>>They constitute a series, that's why I originally offered them as a
>>single patch.
>
> That doesn't answer my question.  I wasn't asking you to re-describe
> what the patches do.  I was asking if each patch could be viewed as
> a standalone change.  If the patches are a series, that would seem to
> imply that each patch relies on a previous patch.

I thought I had answered that in the first paragraph and you could have
just TL;DR; the other two.

> However, given the fact that Corinna has accepted some, but not all, of
> the patches so far, the answer would seem to be that some of the
> patches, at least, are self-contained.

Yes, you can leave off patches from the end of the series.

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

Waldorf MIDI Implementation & additional documentation:
http://Synth.Stromeko.net/Downloads.html#WaldorfDocs

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 3/4 setup] package re-/de-installation from CLI
  2013-07-25 12:06       ` Corinna Vinschen
@ 2013-07-25 19:52         ` Achim Gratz
  0 siblings, 0 replies; 26+ messages in thread
From: Achim Gratz @ 2013-07-25 19:52 UTC (permalink / raw)
  To: cygwin-apps

Corinna Vinschen writes:
> Applied.

Thanks and sorry about the formatting error in the Changelog.


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

DIY Stuff:
http://Synth.Stromeko.net/DIY.html

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 4/4 setup] package re-/de-installation from CLI
  2013-07-24 20:54     ` [PATCH 4/4 " Achim Gratz
@ 2013-07-26 12:04       ` Corinna Vinschen
  0 siblings, 0 replies; 26+ messages in thread
From: Corinna Vinschen @ 2013-07-26 12:04 UTC (permalink / raw)
  To: cygwin-apps

On Jul 24 22:54, Achim Gratz wrote:
> >From 8d0ee8f914e0af9b6af90909e95a0cd6c3f60215 Mon Sep 17 00:00:00 2001
> From: Achim Gratz <...>
> 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.

Patch applied.


Thanks,
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 1/4 setup] package re-/de-installation from CLI
  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:00         ` Achim Gratz
  1 sibling, 2 replies; 26+ messages in thread
From: Jon TURNEY @ 2013-10-07 15:03 UTC (permalink / raw)
  To: cygwin-apps; +Cc: Achim Gratz

[-- Attachment #1: Type: text/plain, Size: 1280 bytes --]

On 24/07/2013 21:53, Achim Gratz wrote:
> From 1686e0beac98867bf1fe358a8fe9a9d8647d4a3a Mon Sep 17 00:00:00 2001
> From: Achim Gratz <Stromeko-GL6zORMxvAD+tKtrA809HA@public.gmane.org>
> Date: Fri, 8 Feb 2013 20:58:20 +0100
> Subject: [PATCH 1/4] Remove detrimental initialization
> 
>        * choose.cc (createListview): Remove superflous and detrimental
>          default trust setting.  This has already been set correctly
>          in OnInit.
> ---
>  choose.cc | 5 -----
>  1 file changed, 5 deletions(-)
> 
> diff --git a/choose.cc b/choose.cc
> index 6d5f3b7..4e0bcd4 100644
> --- a/choose.cc
> +++ b/choose.cc
> @@ -148,11 +148,6 @@ ChooserPage::createListview ()
>      log (LOG_BABBLE) << "Failed to set View button caption %ld" <<
>  	 GetLastError () << endLog;
>  
> -  for (packagedb::packagecollection::iterator i = db.packages.begin(); i != db.packages.end(); i++)
> -    {
> -      i->second->set_requirements(chooser->deftrust);
> -    }
> -

There have been a few reports that setup no longer installs the dependencies
of explicitly specified packages in unattended mode, and this seems to be the
culprit.

A small patch to fix this is attached.

(I note with amazement that setup has two dependency solvers: one in
PrereqChecker, and one in packageversion)


[-- Attachment #2: 0001-Fix-selecting-of-package-dependencies-in-unattended-.patch --]
[-- Type: text/plain, Size: 1018 bytes --]

From 29da1520437fc3edfe9b53b7e07441af91d2b1ad Mon Sep 17 00:00:00 2001
From: Jon TURNEY <jon.turney@dronecode.org.uk>
Date: Mon, 7 Oct 2013 15:07:35 +0100
Subject: [PATCH setup] Fix selecting of package dependencies in unattended
 mode

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
---
 prereq.cc | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/prereq.cc b/prereq.cc
index 675bdfe..a46ca7e 100644
--- a/prereq.cc
+++ b/prereq.cc
@@ -150,9 +150,10 @@ PrereqPage::OnUnattended ()
   if (unattended_mode == chooseronly)
     return -1;
 
-  // in unattended mode, carry on to download/install
-  // (this can only happen if there some kind of problem with dependencies, as all required dependencies
-  //  should be selected automatically by the chooser page in unattended mode, so we should never get here)
+  // in unattended mode, add the missing requirements, then carry on to download/install
+  PrereqChecker p;
+  p.selectMissing ();
+
   return whatNext();
 }
 
-- 
1.8.3.4


^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 1/4 setup] package re-/de-installation from CLI
  2013-10-07 15:03       ` Jon TURNEY
@ 2013-10-07 16:21         ` Christopher Faylor
  2013-10-07 18:08           ` Jon TURNEY
  2013-10-07 18:00         ` Achim Gratz
  1 sibling, 1 reply; 26+ messages in thread
From: Christopher Faylor @ 2013-10-07 16:21 UTC (permalink / raw)
  To: cygwin-apps

On Mon, Oct 07, 2013 at 04:02:47PM +0100, Jon TURNEY wrote:
>On 24/07/2013 21:53, Achim Gratz wrote:
>> From 1686e0beac98867bf1fe358a8fe9a9d8647d4a3a Mon Sep 17 00:00:00 2001
>> From: Achim Gratz <Stromeko-GL6zORMxvAD+tKtrA809HA@public.gmane.org>
>> Date: Fri, 8 Feb 2013 20:58:20 +0100
>> Subject: [PATCH 1/4] Remove detrimental initialization
>> 
>>        * choose.cc (createListview): Remove superflous and detrimental
>>          default trust setting.  This has already been set correctly
>>          in OnInit.
>> ---
>>  choose.cc | 5 -----
>>  1 file changed, 5 deletions(-)
>> 
>> diff --git a/choose.cc b/choose.cc
>> index 6d5f3b7..4e0bcd4 100644
>> --- a/choose.cc
>> +++ b/choose.cc
>> @@ -148,11 +148,6 @@ ChooserPage::createListview ()
>>      log (LOG_BABBLE) << "Failed to set View button caption %ld" <<
>>  	 GetLastError () << endLog;
>>  
>> -  for (packagedb::packagecollection::iterator i = db.packages.begin(); i != db.packages.end(); i++)
>> -    {
>> -      i->second->set_requirements(chooser->deftrust);
>> -    }
>> -
>
>There have been a few reports that setup no longer installs the dependencies
>of explicitly specified packages in unattended mode, and this seems to be the
>culprit.
>
>A small patch to fix this is attached.

Thanks for finding this.  Please check it in and I'll roll out a new version
of setup.exe.

>(I note with amazement that setup has two dependency solvers: one in
>PrereqChecker, and one in packageversion)

Sigh.  I didn't know that.  Have I mentioned...?  Yes.  Nevermind.  I'm
pretty sure I have.

cgf

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 1/4 setup] package re-/de-installation from CLI
  2013-10-07 15:03       ` Jon TURNEY
  2013-10-07 16:21         ` Christopher Faylor
@ 2013-10-07 18:00         ` Achim Gratz
  1 sibling, 0 replies; 26+ messages in thread
From: Achim Gratz @ 2013-10-07 18:00 UTC (permalink / raw)
  To: cygwin-apps

Jon TURNEY writes:
> There have been a few reports that setup no longer installs the dependencies
> of explicitly specified packages in unattended mode, and this seems to be the
> culprit.

IIRC, when this was last discussed some people wanted the dependencies
to be followed and some didn't ("just install the package").  But I
guess it makes sense that in unattended mode it acts like it was going
through the chooser page by default.

> A small patch to fix this is attached.

Thanks.  Since you've found a different implementation, this hopefully
doesn't re-introduce the bug that using the back button in some places
will cause all packages to be re-installed.

> (I note with amazement that setup has two dependency solvers: one in
> PrereqChecker, and one in packageversion)

Heh.  There is quite some code in there that isn't really used.


Regards,
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

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 1/4 setup] package re-/de-installation from CLI
  2013-10-07 16:21         ` Christopher Faylor
@ 2013-10-07 18:08           ` Jon TURNEY
  2013-10-10 20:05             ` Achim Gratz
  0 siblings, 1 reply; 26+ messages in thread
From: Jon TURNEY @ 2013-10-07 18:08 UTC (permalink / raw)
  To: cygwin-apps

On 07/10/2013 17:21, Christopher Faylor wrote:
> On Mon, Oct 07, 2013 at 04:02:47PM +0100, Jon TURNEY wrote:
>> On 24/07/2013 21:53, Achim Gratz wrote:
>>> From 1686e0beac98867bf1fe358a8fe9a9d8647d4a3a Mon Sep 17 00:00:00 2001
>>> From: Achim Gratz <Stromeko-GL6zORMxvAD+tKtrA809HA-XMD5yJDbdMReXY1tMh2IBg@public.gmane.org>
>>> Date: Fri, 8 Feb 2013 20:58:20 +0100
>>> Subject: [PATCH 1/4] Remove detrimental initialization
>>>
>>>        * choose.cc (createListview): Remove superflous and detrimental
>>>          default trust setting.  This has already been set correctly
>>>          in OnInit.
>>> ---
>>>  choose.cc | 5 -----
>>>  1 file changed, 5 deletions(-)
>>>
>>> diff --git a/choose.cc b/choose.cc
>>> index 6d5f3b7..4e0bcd4 100644
>>> --- a/choose.cc
>>> +++ b/choose.cc
>>> @@ -148,11 +148,6 @@ ChooserPage::createListview ()
>>>      log (LOG_BABBLE) << "Failed to set View button caption %ld" <<
>>>  	 GetLastError () << endLog;
>>>  
>>> -  for (packagedb::packagecollection::iterator i = db.packages.begin(); i != db.packages.end(); i++)
>>> -    {
>>> -      i->second->set_requirements(chooser->deftrust);
>>> -    }
>>> -
>>
>> There have been a few reports that setup no longer installs the dependencies
>> of explicitly specified packages in unattended mode, and this seems to be the
>> culprit.
>>
>> A small patch to fix this is attached.
> 
> Thanks for finding this.  Please check it in and I'll roll out a new version
> of setup.exe.

Checked in (with ChangeLog entry I forgot to put in the email)

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH 1/4 setup] package re-/de-installation from CLI
  2013-10-07 18:08           ` Jon TURNEY
@ 2013-10-10 20:05             ` Achim Gratz
  0 siblings, 0 replies; 26+ messages in thread
From: Achim Gratz @ 2013-10-10 20:05 UTC (permalink / raw)
  To: cygwin-apps

Jon TURNEY writes:
>> Thanks for finding this.  Please check it in and I'll roll out a new
>> version of setup.exe.
>
> Checked in (with ChangeLog entry I forgot to put in the email)

I've tested this today, all seems to be well.


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

SD adaptations for Waldorf Q V3.00R3 and Q+ V3.54R2:
http://Synth.Stromeko.net/Downloads.html#WaldorfSDada

^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2013-10-10 20:05 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-22 18:03 [setup] package re-/de-installation from CLI 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   ` [PATCH 4/4 " Achim Gratz
2013-07-24 20:51   ` [PATCH 3/4 " Achim Gratz
2013-07-24 20:51   ` [PATCH 1/4 " Achim Gratz

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).