* [PATCH] Setup: completely specify source version when parsing setup.ini
@ 2007-01-16 10:11 Cesar Strauss
2007-02-17 14:57 ` Brian Dessent
0 siblings, 1 reply; 2+ messages in thread
From: Cesar Strauss @ 2007-01-16 10:11 UTC (permalink / raw)
To: cygwin-apps
Hi,
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
match.
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.
Regards,
Cesar
[1] IniDBBuilderPackage.cc
[2] PackageSpecification.h
[3] IniDBBuilderPackage.cc (IniDBBuilderPackage::buildPackageSource)
[4] package_version.cc (_packageversion::sourcePackage)
[5] package_meta.h (packagemeta::versions)
[6] package_version.cc (packageversion::operator <)
==============================================================================
ChangeLog:
2007-01-16 Cesar Strauss <cstrauss@cea.inpe.br>
* IniDBBuilderPackage.cc (IniDBBuilderPackage::buildPackageSource):
Initialize the version and operator fields of the newly created
PackageSpecification object, so setup can pick the correct source
version later on.
Index: IniDBBuilderPackage.cc
===================================================================
RCS file: /cvs/cygwin-apps/setup/IniDBBuilderPackage.cc,v
retrieving revision 2.21
diff -u -p -r2.21 IniDBBuilderPackage.cc
--- IniDBBuilderPackage.cc 16 Apr 2006 23:07:44 -0000 2.21
+++ IniDBBuilderPackage.cc 16 Jan 2007 02:33:06 -0000
@@ -159,7 +159,11 @@ IniDBBuilderPackage::buildPackageSource
cspv.source()->set_canonical (path.c_str());
cspv.source()->sites.push_back(site(parse_mirror));
+ /* 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: http://horde.org/imp/
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] Setup: completely specify source version when parsing setup.ini
2007-01-16 10:11 [PATCH] Setup: completely specify source version when parsing setup.ini Cesar Strauss
@ 2007-02-17 14:57 ` Brian Dessent
0 siblings, 0 replies; 2+ messages in thread
From: Brian Dessent @ 2007-02-17 14:57 UTC (permalink / raw)
To: Cesar Strauss; +Cc: cygwin-apps
Cesar Strauss wrote:
> 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:
Thanks for the excellent analysis and patch. I've applied your change
and uploaded a new snapshot (2.558). Sorry for the month delay!
Brian
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-02-17 14:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-16 10:11 [PATCH] Setup: completely specify source version when parsing setup.ini Cesar Strauss
2007-02-17 14:57 ` Brian Dessent
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).