From 0748d509f684e192e295302e77263719323f0d1a Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 11 Mar 2008 09:53:09 +0100 Subject: * cmdline/apt-get.cc: - fix incorrect help output for -f (LP: #57487) --- cmdline/apt-get.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmdline') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 11a8b2ef4..920e5e2ec 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -2635,7 +2635,7 @@ bool ShowHelp(CommandLine &CmdL) " -d Download only - do NOT install or unpack archives\n" " -s No-act. Perform ordering simulation\n" " -y Assume Yes to all queries and do not prompt\n" - " -f Attempt to continue if the integrity check fails\n" + " -f Attempt to correct a system with broken dependencies in place\n" " -m Attempt to continue if archives are unlocatable\n" " -u Show a list of upgraded packages as well\n" " -b Build the source package after fetching it\n" -- cgit v1.2.3 From 9dbe6ae43a5a78f68a4863650a5d23eb9051d0f7 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 11 Mar 2008 17:40:15 +0100 Subject: - run the problemResolver after a task was installed so that it can correct any missing dependencies --- cmdline/apt-get.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'cmdline') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 920e5e2ec..fe9416f1a 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -1506,10 +1506,13 @@ bool TryInstallTask(pkgDepCache &Cache, pkgProblemResolver &Fix, buf[end-start] = 0x0; if (regexec(&Pattern,buf,0,0,0) != 0) continue; - res &= TryToInstall(Pkg,Cache,Fix,Remove,false,ExpectedInst); + res &= TryToInstall(Pkg,Cache,Fix,Remove,true,ExpectedInst); found = true; } + // now let the problem resolver deal with any issues + Fix.Resolve(true); + if(!found) _error->Error(_("Couldn't find task %s"),taskname); -- cgit v1.2.3 From 85bd111a9b0778ba6e2b8950d369aeca192f9555 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 13 Mar 2008 23:19:10 +0100 Subject: cmdline/apt-get.cc: - install tasks in two passes, first without dependency auto-install, the with it. this ensure that we do not run in a situation were a task packages A dependens on B|C and C is part of the task but B gets installed too because of the greedy nature of apt --- cmdline/apt-get.cc | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) (limited to 'cmdline') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index fe9416f1a..3f9a5b248 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -1495,19 +1495,24 @@ bool TryInstallTask(pkgDepCache &Cache, pkgProblemResolver &Fix, bool found = false; bool res = true; - for (Pkg = Cache.PkgBegin(); Pkg.end() == false; Pkg++) + + // two runs, first ignore dependencies, second install any missing + for(int IgnoreBroken=1; IgnoreBroken >= 0; IgnoreBroken--) { - pkgCache::VerIterator ver = Cache[Pkg].CandidateVerIter(Cache); - if(ver.end()) - continue; - pkgRecords::Parser &parser = Recs.Lookup(ver.FileList()); - parser.GetRec(start,end); - strncpy(buf, start, end-start); - buf[end-start] = 0x0; - if (regexec(&Pattern,buf,0,0,0) != 0) - continue; - res &= TryToInstall(Pkg,Cache,Fix,Remove,true,ExpectedInst); - found = true; + for (Pkg = Cache.PkgBegin(); Pkg.end() == false; Pkg++) + { + pkgCache::VerIterator ver = Cache[Pkg].CandidateVerIter(Cache); + if(ver.end()) + continue; + pkgRecords::Parser &parser = Recs.Lookup(ver.FileList()); + parser.GetRec(start,end); + strncpy(buf, start, end-start); + buf[end-start] = 0x0; + if (regexec(&Pattern,buf,0,0,0) != 0) + continue; + res &= TryToInstall(Pkg,Cache,Fix,Remove,IgnoreBroken,ExpectedInst); + found = true; + } } // now let the problem resolver deal with any issues -- cgit v1.2.3