Setup patch to keep test version if test version installed

2015-01-25 Thread Corinna Vinschen
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 -   2.64
+++ package_meta.cc 25 Jan 2015 17:16:30 -
@@ -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 -  2.42
+++ package_meta.h  25 Jan 2015 17:16:30 -
@@ -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


pgpNhRMTUeBO4.pgp
Description: PGP signature


Re: [HEADSUP] Dropping libopenssl098 from distro

2015-01-25 Thread Reini Urban
On 01/14/2015 03:19 PM, Ken Brown wrote:
 On 1/14/2015 12:46 PM, Achim Gratz wrote:
 Corinna Vinschen writes:
 Clisp is not yet ported to 64bit and it has problems under 32bit as
 well
 (temporary file generation) that also affect Maxima from ports.

 If it's a problem with the Cygwin DLL, it would be nice to get a
 bug report and, preferredly, an STC, so we have a chance to fix this.

 AFAIK it's the same problem that produced the same symptoms in sqlite:
 using a non-Cygwin API.  So no, I don't think the Cygwin DLL is to
 blame.

 Apart from that, I was only talking about the 32 bitr version anyway.
 It requires the wrong libopenssl and needs a simple rebuild for now.

 One of the things holding a port off is libsigsegv, IIRC.

 This is a bit annoying.  Libsigsegv should be optional, not required.

 I have no idea whether that's possible for clisp.
 
 It is.  There's a configure option --ignore-absence-of-libsigsegv. 
 But there are more serious problems, affecting both the 32-bit and
 64-bit versions.  (So even just rebuilding clisp for 32-bit Cygwin will
 take some work.)  The problem is that lisp.exe, which is built and used
 in the course of trying to build clisp.exe, crashes with a SEGV shortly
 after it's started.
 
 My reason for looking at this was that clisp is needed for building
 xindy, an optional component of TeX Live.  I did successfully build
 clisp in the 32-bit case four years ago, but I can't any more.  My guess
 (untested) is that this is because the location of the heap has changed
 since then, and maybe the source code makes unwarranted assumptions
 about memory layout.
 
 It's a shame that Reini isn't available to help with this.

64bit is not yet possible, yes.
on 32bit, just use 2.48, which should work ok.
but the build system is tricky.

2.49 never really worked. I've tried a few times to fix modules support.
Most of my fixes are upstream, but the last released version was not
fixable anymore. A gnulib problem.




Re: Setup patch to keep test version if test version installed

2015-01-25 Thread Achim Gratz
Corinna Vinschen writes:
 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.

I'd say that's good enough for now.

 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.h25 Jul 2013 12:03:49 -  2.42
 +++ package_meta.h25 Jan 2015 17:16:30 -
 @@ -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

I'd prefer to re-arrange the tests to something along the lines of

--8---cut here---start-8---
  if (exp)
{
   if ( (t == TRUST_TEST) ||
(curr  installed) )
--8---cut here---end---8---


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


Re: Setup patch to keep test version if test version installed

2015-01-25 Thread David Stacey

On 25/01/15 17:20, Corinna Vinschen wrote:

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.


This sounds like a great idea - providing that the logic to compare two 
version numbers is sufficiently clever. Looking at operator() in 
package_version.cc, it appears as though this is performing simple 
string comparison on the version numbers. This would fail in a number of 
cases. A real example from setup.ini:


package: at-spi2-atk
curr: 2.10.2-1
prev: 2.8.1-1

A simple string comparison would prefer prev over curr!

In your patch, maybe it could be better to call 
packageversion::compareVersions() rather than use operator(). I'm not 
terribly familiar with the setup code, so please excuse me if I'm 
mistaken, got lost in the code, or am completely barking up the wrong tree.


Dave.