]> git.saurik.com Git - apt.git/blobdiff - cmdline/apt-get.cc
Minor update from Pierre Machard <pmachard@debian.org>
[apt.git] / cmdline / apt-get.cc
index 315352cbf45e085190674703e0b734f04460c8b4..3ac21347feaeeed5d7925844739d785f637f2efc 100644 (file)
@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description                                                         /*{{{*/
-// $Id: apt-get.cc,v 1.147 2003/12/20 23:39:54 mdz Exp $
+// $Id: apt-get.cc,v 1.152 2004/01/09 07:32:39 mdz Exp $
 /* ######################################################################
    
    apt-get - Cover for dpkg
@@ -418,7 +418,7 @@ void ShowKept(ostream &out,CacheFile &Cache)
       List += string(I.Name()) + " ";
       VersionsList += string(Cache[I].CurVersion) + " => " + Cache[I].CandVersion + "\n";
    }
-   ShowList(out,_("The following packages have been kept back"),List,VersionsList);
+   ShowList(out,_("The following packages have been kept back:"),List,VersionsList);
 }
                                                                        /*}}}*/
 // ShowUpgraded - Show upgraded packages                               /*{{{*/
@@ -439,7 +439,7 @@ void ShowUpgraded(ostream &out,CacheFile &Cache)
       List += string(I.Name()) + " ";
       VersionsList += string(Cache[I].CurVersion) + " => " + Cache[I].CandVersion + "\n";
    }
-   ShowList(out,_("The following packages will be upgraded"),List,VersionsList);
+   ShowList(out,_("The following packages will be upgraded:"),List,VersionsList);
 }
                                                                        /*}}}*/
 // ShowDowngraded - Show downgraded packages                           /*{{{*/
@@ -460,7 +460,7 @@ bool ShowDowngraded(ostream &out,CacheFile &Cache)
       List += string(I.Name()) + " ";
       VersionsList += string(Cache[I].CurVersion) + " => " + Cache[I].CandVersion + "\n";
    }
-   return ShowList(out,_("The following packages will be DOWNGRADED"),List,VersionsList);
+   return ShowList(out,_("The following packages will be DOWNGRADED:"),List,VersionsList);
 }
                                                                        /*}}}*/
 // ShowHold - Show held but changed packages                           /*{{{*/
@@ -1037,10 +1037,9 @@ bool TryToInstall(pkgCache::PkgIterator Pkg,pkgDepCache &Cache,
       else
       {
         ioprintf(c1out,
-        _("Package %s has no available version, but exists in the database.\n"
-          "This typically means that the package was mentioned in a dependency and\n"
-          "never uploaded, has been obsoleted or is not available with the contents\n"
-          "of sources.list\n"),Pkg.Name());
+        _("Package %s is not available, but is referred to by another package.\n"
+          "This may mean that the package is missing, has been obsoleted, or\n"
+           "is only available from another source\n"),Pkg.Name());
         
         string List;
         string VersionsList;
@@ -1557,36 +1556,22 @@ bool DoInstall(CommandLine &CmdL)
             
                 do
                   {
-                    if (Start->Type == pkgCache::Dep::Suggests) {
+                     /* Skip if package is  installed already, or is about to be */
+                     string target = string(Start.TargetPkg().Name()) + " ";
+                     if ((*Start.TargetPkg()).SelectedState == pkgCache::State::Install
+                         || Cache[Start.TargetPkg()].Install())
+                       break;
 
-                      /* A suggests relations, let's see if we have it 
-                         installed already */
+                     /* Skip if we already saw it */
+                     if (int(SuggestsList.find(target)) != -1 || int(RecommendsList.find(target)) != -1)
+                       break; 
 
-                      string target = string(Start.TargetPkg().Name()) + " ";
-                      if ((*Start.TargetPkg()).SelectedState == pkgCache::State::Install || Cache[Start.TargetPkg()].Install())
-                        break;
-                      /* Does another package suggest it as well?  If so,
-                         don't print it twice */
-                      if (int(SuggestsList.find(target)) > -1)
-                        break; 
+                    if (Start->Type == pkgCache::Dep::Suggests) {
                       SuggestsList += target;
                       SuggestsVersions += string(Cache[Start.TargetPkg()].CandVersion) + "\n";
                     }
                     
                     if (Start->Type == pkgCache::Dep::Recommends) {
-
-                      /* A recommends relation, let's see if we have it
-                         installed already */
-
-                      string target = string(Start.TargetPkg().Name()) + " ";
-                      if ((*Start.TargetPkg()).SelectedState == pkgCache::State::Install || Cache[Start.TargetPkg()].Install())
-                        break;
-                      
-                      /* Does another package recommend it as well?  If so,
-                         don't print it twice */
-
-                      if (int(RecommendsList.find(target)) > -1)
-                        break;
                       RecommendsList += target;
                       RecommendsVersions += string(Cache[Start.TargetPkg()].CandVersion) + "\n";
                     }
@@ -2236,8 +2221,7 @@ bool DoBuildDep(CommandLine &CmdL)
       
       // Now we check the state of the packages,
       if (Cache->BrokenCount() != 0)
-        return _error->Error(_("Some broken packages were found while trying to process build-dependencies for %s.\n"
-                               "You might want to run `apt-get -f install' to correct these."),*I);
+         return _error->Error(_("Build-dependencies for %s could not be satisfied."),*I);
    }
   
    if (InstallPackages(Cache, false, true) == false)