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]

Setup patch to keep test version if test version installed


Hi guys,

I need a bit of feedback.

One detail bugging me (and probably others as well) in Setup is this.
If I chose to install a test version of a package, and then start Setup
again, Setup will default to the current version of the package again.
If I'm just a bit careless, I'll overwrite my test version with the curr
version of this package.  And another Setup run will be required to fix
that...

So I was looking into Setup how to change the default behaviour to
something less annoying.  Unfortunately Setup is missing information,
especially if the installed package is a prev, curr, or test version.

But it has a version check mechanism.  And by commen sense, test
versions are always higher than curr versions.  So I came up with the
following change.

Instead of always defaulting to the curr version, Setup now checks if
the installed version of a package is higher than the curr version of
the package.  If so, and if a test version exists for this package, it
will choose the test version by default.  A welcome side effect of this
is, if the test version becomes the curr version, the installed version
will not be higher than curr, thus the curr version will be chosen
again.

Example:

  foo-1.22-1 is installed
  foo-1.23-1 is curr
  foo-1.24-1 is test
  ==> Setup chooses 1.23-1 as default.

User installs 1.24-1.  Next Setup run:

  foo-1.24-1 is installed
  foo-1.23-1 is curr
  foo-1.24-1 is test
  ==> Setup chooses 1.24-1 as default.

Maintainer releases a new test version:
 
  foo-1.24-1 is installed
  foo-1.23-1 is curr
  foo-1.24-2 is test
  ==> Setup chooses 1.24-2 as default.

Maintainer releases test version as curr version:

  foo-1.24-2 is installed
  foo-1.24-2 is curr
  ==> Setup chooses 1.24-2 as default.

Maintainer releases new test version:

  foo-1.24-2 is installed
  foo-1.24-2 is curr
  foo-1.25-1 is test
  ==> Setup chooses 1.24-2 as default.

Question:  Does that make sense?  From my local testing this behaviour
is much less annoying than the current behaviour, and the required code
changes are minimal.  The trustp function is used in other circumstances
as well, but the change won't kill these other usages at all.

Index: package_meta.cc
===================================================================
RCS file: /cvs/cygwin-apps/setup/package_meta.cc,v
retrieving revision 2.64
diff -u -p -r2.64 package_meta.cc
--- package_meta.cc	6 Dec 2014 13:38:54 -0000	2.64
+++ package_meta.cc	25 Jan 2015 17:16:30 -0000
@@ -570,7 +570,7 @@ packagemeta::set_action (_actions action
 	  || categories.find ("Base") != categories.end ()
 	  || categories.find ("Misc") != categories.end ())
 	{
-	  desired = default_version;
+	  desired = trustp (TRUST_CURR);
 	  if (desired)
 	    {
 	      desired.pick (desired != installed, this);
Index: package_meta.h
===================================================================
RCS file: /cvs/cygwin-apps/setup/package_meta.h,v
retrieving revision 2.42
diff -u -p -r2.42 package_meta.h
--- package_meta.h	25 Jul 2013 12:03:49 -0000	2.42
+++ package_meta.h	25 Jan 2015 17:16:30 -0000
@@ -94,6 +94,8 @@ public:
   {
     if (t == TRUST_TEST && exp)
       return exp;
+    else if (curr < installed && exp)
+      return exp;
     else if (curr)
       return curr;
     else


Thanks,
Corinna

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

Attachment: pgp3uBKHJOmgx.pgp
Description: PGP signature


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