diff options
author | Arch Librarian <arch@canonical.com> | 2004-09-20 16:58:31 +0000 |
---|---|---|
committer | Arch Librarian <arch@canonical.com> | 2004-09-20 16:58:31 +0000 |
commit | c29652b05e32b71126ee37c3a013d17f4d2a6479 (patch) | |
tree | f7aec1b04b935946759f07973006403fdd0b6d99 /cmdline/apt-cache.cc | |
parent | 079a992d95a0a3adf7283a97ef44cc5021363476 (diff) |
apt-cache search searchs provide names too now. Closes:...
Author: jgg
Date: 2001-07-02 00:10:32 GMT
apt-cache search searchs provide names too now. Closes: #98695
Diffstat (limited to 'cmdline/apt-cache.cc')
-rw-r--r-- | cmdline/apt-cache.cc | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/cmdline/apt-cache.cc b/cmdline/apt-cache.cc index a11594f21..3f7811c70 100644 --- a/cmdline/apt-cache.cc +++ b/cmdline/apt-cache.cc @@ -1,6 +1,6 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: apt-cache.cc,v 1.51 2001/06/10 02:03:33 jgg Exp $ +// $Id: apt-cache.cc,v 1.52 2001/07/02 00:10:32 jgg Exp $ /* ###################################################################### apt-cache - Manages the cache files @@ -945,18 +945,34 @@ bool Search(CommandLine &CmdL) else VFList[P->ID].NameMatch = false; } - + // Doing names only, drop any that dont match.. if (NamesOnly == true && VFList[P->ID].NameMatch == false) continue; // Find the proper version to use. pkgCache::VerIterator V = Plcy.GetCandidateVer(P); - if (V.end() == true) + if (V.end() == false) + VFList[P->ID].Vf = V.FileList(); + } + + // Include all the packages that provide matching names too + for (pkgCache::PkgIterator P = Cache.PkgBegin(); P.end() == false; P++) + { + if (VFList[P->ID].NameMatch == false) continue; - VFList[P->ID].Vf = V.FileList(); + + for (pkgCache::PrvIterator Prv = P.ProvidesList() ; Prv.end() == false; Prv++) + { + pkgCache::VerIterator V = Plcy.GetCandidateVer(Prv.OwnerPkg()); + if (V.end() == false) + { + VFList[Prv.OwnerPkg()->ID].Vf = V.FileList(); + VFList[Prv.OwnerPkg()->ID].NameMatch = true; + } + } } - + LocalitySort(&VFList->Vf,Cache.HeaderP->PackageCount,sizeof(*VFList)); // Iterate over all the version records and check them |