show non-candidates as fallback for virtual packages (Closes: #578385)
authorDavid Kalnischkies <kalnischkies@gmail.com>
Sat, 24 Apr 2010 08:49:48 +0000 (10:49 +0200)
committerDavid Kalnischkies <kalnischkies@gmail.com>
Sat, 24 Apr 2010 08:49:48 +0000 (10:49 +0200)
cmdline/apt-get.cc
debian/changelog

index 9d67a82..672f64c 100644 (file)
@@ -1147,20 +1147,27 @@ bool TryToInstall(pkgCache::PkgIterator Pkg,pkgDepCache &Cache,
                  Pkg.FullName(true).c_str());
         
         pkgCache::PrvIterator I = Pkg.ProvidesList();
+        unsigned short provider = 0;
         for (; I.end() == false; I++)
         {
            pkgCache::PkgIterator Pkg = I.OwnerPkg();
            
            if (Cache[Pkg].CandidateVerIter(Cache) == I.OwnerVer())
            {
+              c1out << "  " << Pkg.FullName(true) << " " << I.OwnerVer().VerStr();
               if (Cache[Pkg].Install() == true && Cache[Pkg].NewInstall() == false)
-                 c1out << "  " << Pkg.FullName(true) << " " << I.OwnerVer().VerStr() <<
-                 _(" [Installed]") << endl;
-              else
-                 c1out << "  " << Pkg.FullName(true) << " " << I.OwnerVer().VerStr() << endl;
-           }      
+                 c1out << _(" [Installed]");
+              c1out << endl;
+              ++provider;
+           }
         }
-        c1out << _("You should explicitly select one to install.") << endl;
+        // if we found no candidate which provide this package, show non-candidates
+        if (provider == 0)
+           for (I = Pkg.ProvidesList(); I.end() == false; I++)
+              c1out << "  " << I.OwnerPkg().FullName(true) << " " << I.OwnerVer().VerStr()
+               << _(" [Not candidate version]") << endl;
+        else
+           c1out << _("You should explicitly select one to install.") << endl;
       }
       else
       {
index 2e786c6..8adfca8 100644 (file)
@@ -19,6 +19,7 @@ apt (0.7.26~exp4) experimental; urgency=low
     - display MD5Sum in --print-uris if not forced to use another method
       instead of displaying the strongest available (Closes: #576420)
     - regex for package names executed on Grp- not PkgIterator
+    - show non-candidates as fallback for virtual packages (Closes: #578385)
   * apt-pkg/deb/dpkgpm.cc:
     - remove Chroot-Directory from files passed to install commands.
       Thanks to Kel Modderman for report & patch! (Closes: #577226)