summaryrefslogtreecommitdiff
path: root/cmdline/apt-get.cc
diff options
context:
space:
mode:
authorDavid Kalnischkies <kalnischkies@gmail.com>2012-02-18 20:44:31 +0100
committerDavid Kalnischkies <kalnischkies@gmail.com>2012-02-18 20:44:31 +0100
commit0c73b84b001028338c0862c045c0cc4e6b191fcb (patch)
tree0cfaa7624b6fb802f25090a3bd9456c999dc7b35 /cmdline/apt-get.cc
parentf55602cb0cd7403206752479b2ec11c6367e2f6d (diff)
* cmdline/apt-get.cc:
- if a package can't be removed as it is not installed, suggest to the user an (installed) multiarch silbing with 'Did you mean?'
Diffstat (limited to 'cmdline/apt-get.cc')
-rw-r--r--cmdline/apt-get.cc18
1 files changed, 17 insertions, 1 deletions
diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc
index 32ee46980..42a3929d6 100644
--- a/cmdline/apt-get.cc
+++ b/cmdline/apt-get.cc
@@ -904,7 +904,23 @@ struct TryToRemove {
if ((Pkg->CurrentVer == 0 && PurgePkgs == false) ||
(PurgePkgs == true && Pkg->CurrentState == pkgCache::State::NotInstalled))
{
- ioprintf(c1out,_("Package %s is not installed, so not removed\n"),Pkg.FullName(true).c_str());
+ pkgCache::GrpIterator Grp = Pkg.Group();
+ pkgCache::PkgIterator P = Grp.PackageList();
+ for (; P.end() != true; P = Grp.NextPkg(P))
+ {
+ if (P == Pkg)
+ continue;
+ if (P->CurrentVer != 0 || (PurgePkgs == true && P->CurrentState != pkgCache::State::NotInstalled))
+ {
+ // TRANSLATORS: Note, this is not an interactive question
+ ioprintf(c1out,_("Package '%s' is not installed, so not removed. Did you mean '%s'?\n"),
+ Pkg.FullName(true).c_str(), P.FullName(true).c_str());
+ break;
+ }
+ }
+ if (P.end() == true)
+ ioprintf(c1out,_("Package '%s' is not installed, so not removed\n"),Pkg.FullName(true).c_str());
+
// MarkInstall refuses to install packages on hold
Pkg->SelectedState = pkgCache::State::Hold;
}