// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: apt-get.cc,v 1.101 2001/02/21 04:25:20 jgg Exp $
+// $Id: apt-get.cc,v 1.106 2001/04/28 01:18:37 doogie Exp $
/* ######################################################################
apt-get - Cover for dpkg
{
out << ' ';
pkgCache::VerIterator Ver = Cache[Targ].InstVerIter(Cache);
+ if (Now == true)
+ Ver = Targ.CurrentVer();
+
if (Ver.end() == false)
{
if (Now == true)
Added[P->ID] = true;
char S[300];
- sprintf(S,_("%s (due to %s) "),P.Name(),I.Name());
+ snprintf(S,sizeof(S),_("%s (due to %s) "),P.Name(),I.Name());
List += S;
}
}
"of sources.list\n"),Pkg.Name());
string List;
- SPtrArray<bool> Seen = new bool[Cache.Head().PackageFileCount];
- memset(Seen,0,Cache.Head().PackageFileCount*sizeof(*Seen));
+ SPtrArray<bool> Seen = new bool[Cache.Head().PackageCount];
+ memset(Seen,0,Cache.Head().PackageCount*sizeof(*Seen));
pkgCache::DepIterator Dep = Pkg.RevDependsList();
for (; Dep.end() == false; Dep++)
{
if (_config->FindB("APT::Get::ReInstall",false) == true)
{
if (Pkg->CurrentVer == 0 || Pkg.CurrentVer().Downloadable() == false)
- ioprintf(c1out,_("Sorry, re-installation of %s is not possible, it cannot be downloaded."),
+ ioprintf(c1out,_("Sorry, re-installation of %s is not possible, it cannot be downloaded.\n"),
Pkg.Name());
else
Cache.SetReInstall(Pkg,true);
if ((*D).Type == pkgSrcRecords::Parser::BuildConflict ||
(*D).Type == pkgSrcRecords::Parser::BuildConflictIndep)
{
- /* conflict; need to remove if we have an installed version
- that satisfies the version criteria */
+ /*
+ * conflict; need to remove if we have an installed version
+ * that satisfies the version criterial
+ */
if (IV.end() == false &&
Cache->VS().CheckDep(IV.VerStr(),(*D).Op,(*D).Version.c_str()) == true)
TryToInstall(Pkg,Cache,Fix,true,false,ExpectedInst);
}
else
{
- /* depends; need to install or upgrade if we don't have the
- package installed or if the version does not satisfy the
- build dep. This is complicated by the fact that if we
- depend on a version lower than what we already have
- installed it is not clear what should be done; in practice
- this case should be rare though and right now nothing
- is done about it :-( */
- if (IV.end() == true ||
- Cache->VS().CheckDep(IV.VerStr(),(*D).Op,(*D).Version.c_str()) == false)
- TryToInstall(Pkg,Cache,Fix,false,false,ExpectedInst);
+ /*
+ * If this is a virtual package, we need to check the list of
+ * packages that provide it and see if any of those are
+ * installed
+ */
+ pkgCache::PrvIterator Prv = Pkg.ProvidesList();
+ for (; Prv.end() != true; Prv++)
+ if ((*Cache)[Prv.OwnerPkg()].InstVerIter(*Cache).end() == false)
+ break;
+
+ if (Prv.end() == true)
+ {
+ /*
+ * depends; need to install or upgrade if we don't have the
+ * package installed or if the version does not satisfy the
+ * build dep. This is complicated by the fact that if we
+ * depend on a version lower than what we already have
+ * installed it is not clear what should be done; in practice
+ * this case should be rare though and right now nothing
+ * is done about it :-(
+ */
+ if (IV.end() == true ||
+ Cache->VS().CheckDep(IV.VerStr(),(*D).Op,(*D).Version.c_str()) == false)
+ TryToInstall(Pkg,Cache,Fix,false,false,ExpectedInst);
+ }
}
}