IF YOU WOULD LIKE TO GET AN ACCOUNT, please write an
email to Administrator. User accounts are meant only to access repo
and report issues and/or generate pull requests.
This is a purpose-specific Git hosting for
BaseALT
projects. Thank you for your understanding!
Только зарегистрированные пользователи имеют доступ к сервису!
Для получения аккаунта, обратитесь к администратору.
This fixes two problems:
1) Wrong usage of ScoreSort condition. ScoreSort sorts descending,
not ascending. Thus, previous patch assigned wrong score for already
installed packages.
2) Explicit check for already installed packages. If any package
that satisfies versioned dependency is already installed, nothing
at all should be installed (even if better versions are available).
My previous versionmatch.patch was half-way wrong and/or incomplete.
The problem was that pkgCache::VerIterator::CompareVer() does not
do full-blown version comparison, but rather something strange
(see apt-pkg/pkgcache.cc).
I also noticed that, while TryToInstall() does use Fix.ScoreSort,
TryToChangeVer() does not, which is probably wrong.
The solution is as follows:
1) pkgVersionMatch::FindAll() does not sort versions any longer;
it does not have sufficient information, such as Cache and Fix,
to sort the versions.
2) TryToChangeVer() calls FindAll() instead of Find() and uses
Fix.ScoreSort to sort the versions. If Fix.ScoreSort returns 0,
it also tries Cache.VS().CmpVersion(), which is the right way to
reach rpmvercmp().
Also updated 'Selected version ... for ...' diagnostics.
(old result and message)
$ ~tmp/build/aptbox/apt-get --dry-run install python=2.4 2>&1 |grep ^Selected
Selected version 2.4.4-alt8 for python
$
The result was wrong, because I have a better version,
which is 2.4.4-alt8.1.
(new result and message)
$ ~tmp/build/aptbox/apt-get --dry-run install python=2.4 2>&1 |grep ^Selected
Selected version python-strict#2.4.4-alt8.1 for python=2.4
$
Update: also do not sort ascending and reverse the list, this is going
to break "stable sort" logic. Just sort descending.
Update2: actually make CmpVersion() primarily sort condition and
Fix.ScoreSort secondary sort condition. Fix.ScoreSort should not be
activated early, because e.g. for 'python-devel>=2.3' it is going to
select python2.3-dev, but I want python-dev#2.4.