diff --git a/apt-0.5.15cnc6-alt-apt-get-TryToInstall.patch b/apt-0.5.15cnc6-alt-apt-get-TryToInstall.patch deleted file mode 100644 index 384d41c..0000000 --- a/apt-0.5.15cnc6-alt-apt-get-TryToInstall.patch +++ /dev/null @@ -1,47 +0,0 @@ -diff -upk.orig apt-0.5.15cnc6.orig/cmdline/apt-get.cc apt-0.5.15cnc6/cmdline/apt-get.cc ---- apt-0.5.15cnc6.orig/cmdline/apt-get.cc 2005-05-18 20:49:15 +0400 -+++ apt-0.5.15cnc6/cmdline/apt-get.cc 2005-05-18 20:57:53 +0400 -@@ -1277,13 +1277,19 @@ bool TryToInstall(pkgCache::PkgIterator - } - } - vector GoodSolutionNames; -- for (unsigned int i = 0; i != GoodSolutions.size(); i++) -+ unsigned int GoodSolutionsInstalled = 0, GoodSolutionInstallNumber = 0; -+ for (unsigned int i = 0; i < GoodSolutions.size(); i++) - { - pkgCache::PkgIterator GoodPkg(Cache, GoodSolutions[i]); - GoodSolutionNames.push_back(GoodPkg.Name()); -+ if (GoodPkg.CurrentVer().end() == false) -+ { -+ GoodSolutionsInstalled++; -+ GoodSolutionInstallNumber = i; -+ } - } - #ifdef WITH_LUA -- if (GoodSolutions.size() > 1) -+ if (GoodSolutions.size() > 1 && !(Remove && GoodSolutionsInstalled == 1)) - { - vector VS; - _lua->SetDepCache(&Cache); -@@ -1308,7 +1314,8 @@ bool TryToInstall(pkgCache::PkgIterator - _lua->ResetCaches(); - } - #endif -- if (GoodSolutions.size() == 1) -+ if (GoodSolutions.size() == 1 || -+ ((GoodSolutions.size() > 1) && Remove && GoodSolutionsInstalled == 1)) - { - pkgCache::PkgIterator GoodPkg(Cache, GoodSolutions[0]); - ioprintf(c1out,_("Selecting %s for '%s'\n"), -@@ -1336,7 +1343,10 @@ bool TryToInstall(pkgCache::PkgIterator - c1out << " " << GoodSolutionNames[i] - << " " << Cache[GoodPkg].CandVersion << endl; - } -- c1out << _("You should explicitly select one to install.") << endl; -+ if (Remove) -+ c1out << _("You should explicitly select one to remove.") << endl; -+ else -+ c1out << _("You should explicitly select one to install.") << endl; - _error->Error(_("Package %s is a virtual package with multiple " - "good providers.\n"), Pkg.Name()); - return false; diff --git a/apt/cmdline/apt-get.cc b/apt/cmdline/apt-get.cc index 749f2f1..95c4bcc 100644 --- a/apt/cmdline/apt-get.cc +++ b/apt/cmdline/apt-get.cc @@ -1277,13 +1277,19 @@ bool TryToInstall(pkgCache::PkgIterator Pkg,pkgDepCache &Cache, } } vector GoodSolutionNames; - for (unsigned int i = 0; i != GoodSolutions.size(); i++) + unsigned int GoodSolutionsInstalled = 0, GoodSolutionInstallNumber = 0; + for (unsigned int i = 0; i < GoodSolutions.size(); i++) { pkgCache::PkgIterator GoodPkg(Cache, GoodSolutions[i]); GoodSolutionNames.push_back(GoodPkg.Name()); + if (GoodPkg.CurrentVer().end() == false) + { + GoodSolutionsInstalled++; + GoodSolutionInstallNumber = i; + } } #ifdef WITH_LUA - if (GoodSolutions.size() > 1) + if (GoodSolutions.size() > 1 && !(Remove && GoodSolutionsInstalled == 1)) { vector VS; _lua->SetDepCache(&Cache); @@ -1308,7 +1314,8 @@ bool TryToInstall(pkgCache::PkgIterator Pkg,pkgDepCache &Cache, _lua->ResetCaches(); } #endif - if (GoodSolutions.size() == 1) + if (GoodSolutions.size() == 1 || + ((GoodSolutions.size() > 1) && Remove && GoodSolutionsInstalled == 1)) { pkgCache::PkgIterator GoodPkg(Cache, GoodSolutions[0]); ioprintf(c1out,_("Selecting %s for '%s'\n"), @@ -1336,7 +1343,10 @@ bool TryToInstall(pkgCache::PkgIterator Pkg,pkgDepCache &Cache, c1out << " " << GoodSolutionNames[i] << " " << Cache[GoodPkg].CandVersion << endl; } - c1out << _("You should explicitly select one to install.") << endl; + if (Remove) + c1out << _("You should explicitly select one to remove.") << endl; + else + c1out << _("You should explicitly select one to install.") << endl; _error->Error(_("Package %s is a virtual package with multiple " "good providers.\n"), Pkg.Name()); return false;