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]

[PATCH] Setup: completely specify source version when parsing setup.ini


This patch fixes the following issue, present in the current
(2.510.2.2), snapshot (2.553) and CVS versions of setup.exe. The problem
is, when I download a source package, setup.exe will always choose the
version which is greater in text order, regardless of the version I
selected. For example:

When selecting libiconv-1.11-1 (source), I get libiconv-1.9.2-2.
When selecting atk-1.10.3-1 (source), I get atk-1.9.1-1.
When selecting gettext-0.14.5-1 (source), I get gettext-0.15-1.

In text (dictionary) order, "15" is greater than "14", but "9" is
greater than "11".

This is my analysis:

(note: numbers embedded in the text correspond to source references
given below)

As setup.ini is parsed [1], two lists of packages are built: binary and
source. To link the binary version to the corresponding source version,
a relationship class is used (PackageSpecification) [2]. It contains the
package name, version and a constraint ( = , > , < , <= , >= ).

However, when the relationship is created [3], only the name field is
being initialized. So, when the source list is searched for a
corresponding binary version [4], any source version with that name will

So, the end result is actually implementation dependent. In this
particular case, the source versions are stored in a std::set [5],
ordered by the version text [6], which gives the observed results.

A solution is to initialize the remaining fields of the
PackageSpecification (version and operator), so the source version is
completely specified. My patch does just that.


[2] PackageSpecification.h
[3] (IniDBBuilderPackage::buildPackageSource)
[4] (_packageversion::sourcePackage)
[5] package_meta.h (packagemeta::versions)
[6] (packageversion::operator <)

2007-01-16  Cesar Strauss  <>

	* (IniDBBuilderPackage::buildPackageSource):
	Initialize the version and operator fields of the newly created
	PackageSpecification object, so setup can pick the correct source
	version later on.

RCS file: /cvs/cygwin-apps/setup/,v
retrieving revision 2.21
diff -u -p -r2.21
---	16 Apr 2006 23:07:44 -0000	2.21
+++	16 Jan 2007 02:33:06 -0000
@@ -159,7 +159,11 @@ IniDBBuilderPackage::buildPackageSource 
     cspv.source()->set_canonical (path.c_str());
+  /* creates the relationship between binary and source packageversions */
   cbpv.setSourcePackageSpecification (PackageSpecification (cspv.Name()));
+  PackageSpecification &spec = cbpv.sourcePackageSpecification();
+  spec.setOperator (PackageSpecification::Equals);
+  spec.setVersion (cbpv.Canonical_version());
   // process_src (*cspv.source(), path);
   setSourceSize (*cspv.source(), size);

This mail sent through IMP:

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