Репозиторий Sisyphus
Последнее обновление: 26 сентября 2018 | Пакетов: 18655 | Посещений: 12268145
en ru br
Репозитории ALT
S:0.5.15lorg2-alt58
5.1: 0.5.15lorg2-alt33.M50P.1
4.1: 0.5.15lorg2-alt20.M41.1
4.0: 0.5.15lorg2-alt18.M40.1
+updates:0.5.15lorg2-alt18
3.0: 0.5.15cnc6-alt16
www.altlinux.org/Changes

Группа :: Система/Настройка/Пакеты
Пакет: apt

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Патч: apt-0.5.15cnc6-alt-apt-get-TryToInstall.patch
Скачать


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<string> 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<string> 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;
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin