Apply apt-0.5.15lorg2-alt-apt-get-TryToInstall-PrvPkgCandVer.patch

Added in commit 9eacf5f:
0.5.15lorg2-alt6

- apt-get: Fixed virtual packages handling (Alexey Tourbin).
- apt-get: Implemented simple-output option (Stanislav Ievlev).
This commit is contained in:
Gleb Fotengauer-Malinovskiy 2014-05-16 21:04:22 +04:00
parent b99eba002f
commit ec12f06c4b
2 changed files with 10 additions and 94 deletions

View File

@ -1,88 +0,0 @@
Date: Tue, 10 Oct 2006 04:40:28 +0400
From: Alexey Tourbin <at@altlinux.ru>
To: ALT Devel discussion list <devel@lists.altlinux.org>
Message-ID: <20061010004028.GH23308@localhost.localdomain>
Mail-Followup-To: ALT Devel discussion list <devel@lists.altlinux.org>
References: <20061009223236.GG23308@localhost.localdomain>
<20061009224152.GC18762@basalt.office.altlinux.org>
In-Reply-To: <20061009224152.GC18762@basalt.office.altlinux.org>
Subject: Re: [devel] apt virtual packages
List-Id: ALT Devel discussion list <devel.lists.altlinux.org>
On Tue, Oct 10, 2006 at 02:41:52AM +0400, Dmitry V. Levin wrote:
> > íÏÖÎÏ ËÏÎÅÞÎÏ × ÂÁÇÚÉÌÌÕ ÎÁÐÉÓÁÔØ ÉÌÉ ÓÁÍÏÍÕ
> > × ÁÐÔÅ ËÏ×ÙÒÑÔØÓÑ, ÎÏ ÍÏÖÅÔ ÂÙÔØ ÕÖÅ ËÔÏ-ÔÏ ÚÎÁÅÔ?
>
> ñ ÂÕÄÕ ÐÒÉÚÎÁÔÅÌÅÎ ÔÏÍÕ, ËÔÏ ÒÅÛÉÔ ÜÔÕ ÚÁÄÁÞÕ (Ô.Å. ÚÁÆÉËÓÉÔ apt).
ñ ×ÒÏÄÅ ÂÙ ÚÁÆÉËÓÉÌ, ÈÏÔÑ ÍÅÎÑ ÇÌÏÖÕÔ ÓÏÍÎÅÎÉÑ.
--- apt-0.5.15lorg2/cmdline/apt-get.cc.orig 2006-10-10 15:13:17 +0000
+++ apt-0.5.15lorg2/cmdline/apt-get.cc 2006-10-10 15:24:40 +0000
@@ -1275,14 +1275,18 @@ bool TryToInstall(pkgCache::PkgIterator
continue;
}
// Is the provides pointing to the candidate version?
- if (PrvPkgCandVer == Prv.OwnerVer())
+ bool good = false;
+ for (; PrvPkgCandVer.end() == false; ++PrvPkgCandVer)
{
- // Yes, it is. This is a good solution.
- GoodSolutions.push_back(PrvPkg);
- if (instVirtual)
- break;
- continue;
+ if (PrvPkgCandVer == Prv.OwnerVer())
+ {
+ // Yes, it is. This is a good solution.
+ good = true;
+ GoodSolutions.push_back(PrvPkg);
+ }
}
+ if (good && instVirtual)
+ break;
}
vector<string> GoodSolutionNames;
unsigned int GoodSolutionsInstalled = 0, GoodSolutionInstallNumber = 0;
End of patch
÷ÏÔ ÐÏÌÎÏÓÔØÀ ÒÅÌÅ×ÁÎÔÎÙÊ ËÕÓÏË ËÏÄÁ (ÉÓÐÒÁ×ÌÅÎÎÙÊ).
1270 pkgCache::VerIterator PrvPkgCandVer =
1271 Cache[PrvPkg].CandidateVerIter(Cache);
1272 if (PrvPkgCandVer.end() == true)
1273 {
1274 // Packages without a candidate version are not good solutions.
1275 continue;
1276 }
1277 // Is the provides pointing to the candidate version?
1278 bool good = false;
1279 for (; PrvPkgCandVer.end() == false; ++PrvPkgCandVer)
1280 {
1281 if (PrvPkgCandVer == Prv.OwnerVer())
1282 {
1283 // Yes, it is. This is a good solution.
1284 good = true;
1285 GoodSolutions.push_back(PrvPkg);
1286 }
1287 }
1288 if (good && instVirtual)
1289 break;
1290 }
úÄÅÓØ PrvPkg -- ÜÔÏ ÒÅÁÌØÎÙÊ ÐÁËÅÔ, ËÏÔÏÒÙÊ ÐÒÏ×ÁÊÄÉÔ ×ÉÒÔÕÁÌØÎÕÀ
ÚÁ×ÉÓÉÍÏÓÔØ. íÙ ÐÒÏ×ÅÒÑÅÍ, ÅÓÔØ ÌÉ Õ ÒÅÁÌØÎÏÇÏ ÐÁËÅÔÁ "×ÅÒÓÉÑ".
(þÔÏ ÔÁËÏÅ "×ÅÒÓÉÑ"? ñ ÐÌÏÈÏ ÐÏÎÉÍÁÀ ×ÎÕÔÒÅÎÎÉÅ ÓÔÒÕËÔÕÒÙ ÁÐÔÁ, ÐÏÜÔÏÍÕ
É ÇÌÏÖÕÔ ÓÏÍÎÅÎÉÑ.) åÓÌÉ ÒÅÁÌØÎÙÊ ÐÁËÅÔ ÂÅÚ ×ÅÒÓÉÉ, ÔÏÇÄÁ ÏÎ ÎÅ ÔÑÎÅÔ
ÎÁ ÕÓÔÁÎÏ×ËÕ ÞÅÒÅÚ ×ÉÒÔÕÁÌØÎÕÀ ÚÁ×ÉÓÉÍÏÓÔØ. äÁÌÅÅ, × ÏÒÉÇÉÎÁÌØÎÏÍ ËÏÄÅ
ÐÒÏ×ÅÒÑÅÔÓÑ ÎÅÞÔÏ ÓÔÒÁÎÎÏÅ, ÞÔÏ Ñ ÎÅ ÍÏÇÕ ÄÏ ËÏÎÃÁ ÓÆÏÒÍÕÌÉÒÏ×ÁÔØ.
if (PrvPkgCandVer == Prv.OwnerVer())
óÍÙÓÌÅ × ÔÏÍ, ÞÔÏ ×ÅÒÓÉÑ PrvPkgCandVer, ÎÁÊÄÅÎÎÁÑ ÞÅÒÅÚ reverse lookup,
ÄÏÌÖÎÁ ÓÏ×ÐÁÄÁÔØ Ó ÎÅÐÏÓÒÅÄÓÔ×ÅÎÎÏÊ ×ÅÒÓÉÅÊ Prv.OwnerVer(). ôÏÇÄÁ ÐÁËÅÔ
-- ÈÏÒÏÛÉÊ ËÁÎÄÉÄÁÔ. îÏ PrvPkgCandVer -- ÜÔÏ ÉÔÅÒÁÔÏÒ. ëÓÔÁÔÉ, ËÁÖÅÔÓÑ
Prv.OwnerVer ÜÔÏ ÔÏÖÅ ÉÔÅÒÁÔÏÒ. åÓÌÉ × ÒÅÐÏÚÉÔÁÒÉÉ ÏËÁÚÙ×ÁÅÔÓÑ Ä×Á
ÐÁËÅÔÁ Ó ÏÄÉÎÁËÏ×ÙÍ ÉÍÅÎÅÍ É ×ÅÒÓÉÅÊ, ÔÏ ÓÏ×ÐÁÄÅÎÉÅ ÓÒÁÚÕ ÖÅ ÎÅ
ÇÁÒÁÎÔÉÒÕÅÔÓÑ. ïÄÉÎ ÉÚ ÜÔÉÈ ÉÔÅÒÁÔÏÒÏ× ÎÕÖÎÏ "ÐÒÏËÒÕÔÉÔØ" É ÐÒÏ×ÅÒÑÔØ
ÕÓÌÏ×ÉÅ × ÃÉËÌÅ, ÞÔÏ Ñ É ÄÅÌÁÀ.

View File

@ -1275,15 +1275,19 @@ bool TryToInstall(pkgCache::PkgIterator Pkg,pkgDepCache &Cache,
continue; continue;
} }
// Is the provides pointing to the candidate version? // Is the provides pointing to the candidate version?
bool good = false;
for (; PrvPkgCandVer.end() == false; ++PrvPkgCandVer)
{
if (PrvPkgCandVer == Prv.OwnerVer()) if (PrvPkgCandVer == Prv.OwnerVer())
{ {
// Yes, it is. This is a good solution. // Yes, it is. This is a good solution.
good = true;
GoodSolutions.push_back(PrvPkg); GoodSolutions.push_back(PrvPkg);
if (instVirtual)
break;
continue;
} }
} }
if (good && instVirtual)
break;
}
vector<string> GoodSolutionNames; vector<string> GoodSolutionNames;
unsigned int GoodSolutionsInstalled = 0, GoodSolutionInstallNumber = 0; unsigned int GoodSolutionsInstalled = 0, GoodSolutionInstallNumber = 0;
for (unsigned int i = 0; i < GoodSolutions.size(); i++) for (unsigned int i = 0; i < GoodSolutions.size(); i++)