0.5.15cnc6-alt4

- apt-shell fixes from Mouse (#4306).
This commit is contained in:
Дмитрий Левин 2004-06-07 15:28:59 +00:00
parent 68f3ce87c1
commit d952729a63
2 changed files with 62 additions and 1 deletions

View File

@ -0,0 +1,56 @@
--- apt-0.5.15cnc6/cmdline/apt-shell.cc.orig 2004-06-07 18:53:30 +0400
+++ apt-0.5.15cnc6/cmdline/apt-shell.cc 2004-06-07 19:13:44 +0400
@@ -1285,10 +1285,24 @@
if (Cache[Pkg].CandidateVer == 0 && Pkg->ProvidesList != 0)
{
vector<pkgCache::Package *> GoodSolutions;
+ unsigned long Size = 0;
for (pkgCache::PrvIterator Prv = Pkg.ProvidesList();
Prv.end() == false; Prv++)
- {
- pkgCache::PkgIterator PrvPkg = Prv.OwnerPkg();
+ Size++;
+ SPtrArray<pkgCache::Package *> PList = new pkgCache::Package *[Size];
+ pkgCache::Package **PEnd = PList;
+ for (pkgCache::PrvIterator Prv = Pkg.ProvidesList(); Prv.end() == false; Prv++)
+ *PEnd++ = Prv.OwnerPkg();
+ Fix.MakeScores();
+ qsort(PList,PEnd - PList,sizeof(*PList),&(Fix.ScoreSort));
+
+ for (unsigned int p=0; p<Size; ++p)
+ {
+ bool instVirtual = _config->FindB("APT::Install::Virtual", false);
+ pkgCache::PkgIterator PrvPkg = pkgCache::PkgIterator(*Pkg.Cache(), PList[p]);
+ pkgCache::PrvIterator Prv = Pkg.ProvidesList();
+ for (; Prv.end() == false && Prv.OwnerPkg() != PrvPkg; Prv++)
+ ;
// Check if it's a different version of a package already
// considered as a good solution.
bool AlreadySeen = false;
@@ -1310,6 +1324,8 @@
// the user might try to install something he already has
// without being aware.
GoodSolutions.push_back(PrvPkg);
+ if (instVirtual)
+ break;
continue;
}
pkgCache::VerIterator PrvPkgCandVer =
@@ -1324,13 +1340,15 @@
{
// Yes, it is. This is a good solution.
GoodSolutions.push_back(PrvPkg);
+ if (instVirtual)
+ break;
continue;
}
}
vector<string> GoodSolutionNames;
- for (unsigned int i = 0; i != GoodSolutionNames.size(); i++)
+ for (unsigned int i = 0; i != GoodSolutions.size(); i++)
{
- pkgCache::PkgIterator GoodPkg(Cache, GoodSolutions[0]);
+ pkgCache::PkgIterator GoodPkg(Cache, GoodSolutions[i]);
GoodSolutionNames.push_back(GoodPkg.Name());
}
#ifdef WITH_LUA

View File

@ -2,7 +2,7 @@
Name: apt
Version: 0.5.15cnc6
Release: alt3
Release: alt4
Summary: Debian's Advanced Packaging Tool with RPM support
Summary(ru_RU.CP1251): Debian APT - Óñîâåðøåíñòâîâàííîå ñðåäñòâî óïðàâëåíèÿ ïàêåòàìè ñ ïîääåðæêîé RPM
@ -42,6 +42,7 @@ Patch29: apt-0.5.15cnc5-alt-findrepos.patch
Patch30: apt-0.5.15cnc5-alt-gettext.patch
Patch31: apt-0.5.15cnc6-alt-rpm-order.patch
Patch32: apt-0.5.15cnc6-alt-pkgcachegen.patch
Patch33: apt-0.5.15cnc6-alt-apt-shell.patch
# Normally not applied, but useful.
Patch101: apt-0.5.4cnc9-alt-getsrc-debug.patch
@ -223,6 +224,7 @@ This package contains method 'rsync' for APT.
%patch30 -p1
%patch31 -p1
%patch32 -p1
%patch33 -p1
# Use system-wide lua5
pushd lua
@ -334,6 +336,9 @@ fi
# Probably %%doc with README.rsync?
%changelog
* Mon Jun 07 2004 Dmitry V. Levin <ldv@altlinux.org> 0.5.15cnc6-alt4
- apt-shell fixes from Mouse (#4306).
* Sat May 15 2004 Dmitry V. Levin <ldv@altlinux.org> 0.5.15cnc6-alt3
- apt-pkg/pkgcachegen.cc:
Remove old sources cache file before creating new one.