50 lines
1.8 KiB
Diff
50 lines
1.8 KiB
Diff
--- apt-0.5.15lorg2/cmdline/apt-shell.cc.orig 2006-03-17 17:56:01 +0300
|
|
+++ apt-0.5.15lorg2/cmdline/apt-shell.cc 2006-03-17 17:56:02 +0300
|
|
@@ -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 =
|
|
@@ -4536,8 +4552,8 @@
|
|
largv[largc] = 0;
|
|
|
|
// Make our own copy of the configuration.
|
|
- delete _config;
|
|
- _config = new Configuration(GlobalConfig);
|
|
+ //delete _config;
|
|
+ //_config = new Configuration(GlobalConfig);
|
|
|
|
// Prepare the command line
|
|
CommandLine CmdL(CommandArgs(largv[1]),_config);
|