// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: apt-cache.cc,v 1.30 1999/03/18 04:52:51 jgg Exp $
+// $Id: apt-cache.cc,v 1.33 1999/04/12 04:21:20 jgg Exp $
/* ######################################################################
apt-cache - Manages the cache files
return true;
}
/*}}}*/
-// GetCandidateVer - Returns the Candidate install version /*{{{*/
-// ---------------------------------------------------------------------
-/* This should really use the DepCache or something.. Copied from there.
- Allow current is required to filter out the status file when emitting
- an available file. */
-static pkgCache::VerIterator GetCandidateVer(pkgCache::PkgIterator Pkg,
- bool AllowCurrent = true)
-{
- /* Not source/not automatic versions cannot be a candidate version
- unless they are already installed */
- for (pkgCache::VerIterator I = Pkg.VersionList(); I.end() == false; I++)
- {
- if (Pkg.CurrentVer() == I && AllowCurrent == true)
- return I;
-
- for (pkgCache::VerFileIterator J = I.FileList(); J.end() == false; J++)
- if ((J.File()->Flags & pkgCache::Flag::NotSource) == 0 &&
- (J.File()->Flags & pkgCache::Flag::NotAutomatic) == 0)
- return I;
- }
-
- return pkgCache::VerIterator(*GCache,0);
-}
- /*}}}*/
// DumpAvail - Print out the available list /*{{{*/
// ---------------------------------------------------------------------
/* This is needed to make dpkg --merge happy */
for (pkgCache::PkgIterator P = Cache.PkgBegin(); P.end() == false; P++)
{
// Find the proper version to use. We should probably use the DepCache.
- pkgCache::VerIterator V = GetCandidateVer(P,false);
+ pkgCache::VerIterator V = Cache.GetCandidateVer(P,false);
if (V.end() == true || V.FileList().File() != I)
continue;
for (;I.end() != true; I++)
{
// We search against the install version as that makes the most sense..
- pkgCache::VerIterator V = GetCandidateVer(I);
+ pkgCache::VerIterator V = Cache.GetCandidateVer(I);
if (V.end() == true)
continue;
}
// Find the proper version to use. We should probably use the DepCache.
- pkgCache::VerIterator V = GetCandidateVer(Pkg);
+ pkgCache::VerIterator V = Cache.GetCandidateVer(Pkg);
if (V.end() == true || V.FileList().end() == true)
continue;
if (DisplayRecord(V) == false)
cout << " -q Disable progress indicator." << endl;
cout << " -i Show only important deps for the unmet command." << endl;
cout << " -c=? Read this configuration file" << endl;
- cout << " -o=? Set an arbitary configuration option, ie -o dir::cache=/tmp" << endl;
+ cout << " -o=? Set an arbitary configuration option, eg -o dir::cache=/tmp" << endl;
cout << "See the apt-cache(8) and apt.conf(5) manual pages for more information." << endl;
return 100;
}
CmdL.FileSize() == 0)
return ShowHelp(CmdL);
+ // Deal with stdout not being a tty
+ if (ttyname(STDOUT_FILENO) == 0 && _config->FindI("quiet",0) < 1)
+ _config->Set("quiet","1");
+
if (CmdL.DispatchArg(CmdsA,false) == false && _error->PendingError() == false)
{
// Open the cache file