[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: dpkg suggestion



On Thu, 27 Aug 1998, Jules Bean wrote:

> > > 	pkg-nodep
> > > 
> > >  Edward> 22:21:03 $ pkg-nodep > /dev/null
> > >  Edward> 22:21:29 $ 
> > >  Edward> it is a bit slow?

> It has been suggested many times before, and lots of people have agreed.

This check is about 20 lines of code using the APT library, something like

for (pkgCache::PkgIterator I = Cache.begin(); I.end() == false; I++)
{
   pkgCache::DepIterator Dep = I.RevDependsList();
   bool Used = false;
   for (; Dep.end() == false; Dep++)
     if (Dep->Type == pkgCache::Dep::Depends &&
         Dep.ParentPkg()->InstState != pkgCache::State::NotInstalled &&
         Dep.ParentPkg()->InstState != pkgCache::State::ConfigFiles)
       Used = true; 
   if (Used == false)
     cout << "Package " << I.Name() << " is not depended on by anything" << endl;
}

And that will run in very short time, probably less than a half second if
the database is already in ram, in the 3-5 second time range if it needs
to completely rebuild things.

I think I got parse time down to <2s on my 486/50 for the 3Meg database
set when the files are in ram.. The old apt is 7 times slower than the new
experimental one.

Jason


Reply to: