]> git.saurik.com Git - apt.git/blobdiff - cmdline/apt-get.cc
* New no_NO.po file from Tollef Fog Heen <tfheen@debian...
[apt.git] / cmdline / apt-get.cc
index 0cf723466d34a65e69810cb36e39a657f8058d44..05d70a7fedb0ad5730b8ae4da2c94c58163e4c29 100644 (file)
@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description                                                         /*{{{*/
-// $Id: apt-get.cc,v 1.143 2003/09/24 04:00:25 mdz Exp $
+// $Id: apt-get.cc,v 1.150 2003/12/24 22:53:10 mdz Exp $
 /* ######################################################################
    
    apt-get - Cover for dpkg
@@ -1557,38 +1557,24 @@ 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;
-                      SuggestsVersions += string(Cache[Start.TargetPkg()].CandVersion) + "\n";
+                      RecommendsVersions += string(Cache[Start.TargetPkg()].CandVersion) + "\n";
                     }
              if (Start == End)
                break;
@@ -2156,11 +2142,18 @@ bool DoBuildDep(CommandLine &CmdL)
                            break;
                  }
                  if (CV.end() == true)
+                  if (hasAlternatives)
+                  {
+                     continue;
+                  }
+                  else
+                  {
                       return _error->Error(_("%s dependency for %s cannot be satisfied "
                                              "because no available versions of package %s "
                                              "can satisfy version requirements"),
                                            Last->BuildDepType((*D).Type),Src.c_str(),
                                            (*D).Package.c_str());
+                  }
             }
             else
             {
@@ -2229,8 +2222,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)
@@ -2461,7 +2453,7 @@ int main(int argc,const char *argv[])
    }
    
    // Deal with stdout not being a tty
-   if (ttyname(STDOUT_FILENO) == 0 && _config->FindI("quiet",0) < 1)
+   if (!isatty(STDOUT_FILENO) && _config->FindI("quiet",0) < 1)
       _config->Set("quiet","1");
 
    // Setup the output streams