summaryrefslogtreecommitdiff
path: root/ept/apt/apt.cc
diff options
context:
space:
mode:
Diffstat (limited to 'ept/apt/apt.cc')
-rw-r--r--ept/apt/apt.cc22
1 files changed, 14 insertions, 8 deletions
diff --git a/ept/apt/apt.cc b/ept/apt/apt.cc
index a7ef749..64a3bab 100644
--- a/ept/apt/apt.cc
+++ b/ept/apt/apt.cc
@@ -182,17 +182,20 @@ struct RecordIteratorImpl
FileFd file;
size_t lastOffset;
- RecordIteratorImpl(AptImplementation& apt) : _ref(0), apt(apt), vflist(0)
+ RecordIteratorImpl(AptImplementation& apt) : _ref(0), apt(apt)
{
+cerr << "RIImpl PC " << apt.cache().HeaderP->PackageCount + 1 << endl;
// We already have an estimate of how many versions we're about to find
vflist.reserve(apt.cache().HeaderP->PackageCount + 1);
// Populate the vector of versions to print
for (pkgCache::PkgIterator pi = apt.cache().PkgBegin(); !pi.end(); ++pi)
{
+cerr << "RIImpl HASPKG" << endl;
if (pi->VersionList == 0)
continue;
+cerr << "RIImpl HASVER" << endl;
/* Get the candidate version or fallback on the installed version,
* as usual */
pkgCache::VerIterator vi = apt.policy().GetCandidateVer(pi);
@@ -203,16 +206,19 @@ struct RecordIteratorImpl
vi = pi.CurrentVer();
}
+cerr << "RIImpl CHOSENVER" << endl;
// Choose a valid file that contains the record for this version
pkgCache::VerFileIterator vfi = vi.FileList();
for ( ; !vfi.end(); ++vfi)
if ((vfi.File()->Flags & pkgCache::Flag::NotSource) == 0)
break;
+cerr << "RIImpl ASKEDFILE" << endl;
// Handle packages whose candidate version is currently installed
// from outside the archives (like from a locally built .deb
if (vfi.end() == true)
{
+cerr << "RIImpl LOCALPKG" << endl;
for (pkgCache::VerIterator cur = pi.VersionList(); cur.end() != true; cur++)
{
for (vfi = cur.FileList(); vfi.end() == false; vfi++)
@@ -232,16 +238,16 @@ struct RecordIteratorImpl
vflist.push_back(vfi);
}
- //cerr << vflist.size() << " versions found" << endl;
+ cerr << vflist.size() << " versions found" << endl;
sort(vflist.begin(), vflist.end(), localityCompare);
- //for (size_t i = 0; i < vflist.size(); ++i)
- //{
- // pkgCache::PkgFileIterator fi(apt.cache(), vflist[i]->File + apt.cache().PkgFileP);
- // cerr << i << ": " << fi.FileName() << ":" << vflist[i]->Offset << "-" << vflist[i]->Size << endl;
- //}
- //cerr << "Done indexing." << endl;
+ for (size_t i = 0; i < vflist.size(); ++i)
+ {
+ pkgCache::PkgFileIterator fi(apt.cache(), vflist[i]->File + apt.cache().PkgFileP);
+ cerr << i << ": " << fi.FileName() << ":" << vflist[i]->Offset << "-" << vflist[i]->Size << endl;
+ }
+ cerr << "Done indexing." << endl;
}
~RecordIteratorImpl()