]> git.saurik.com Git - apt.git/blobdiff - cmdline/apt-get.cc
Add --arch-only option for apt-get build-dep only only ...
[apt.git] / cmdline / apt-get.cc
index 592834485b84109985fa2098e70740d5597666a7..76945b805c32f9e4f9e8365d816f44e56da1f72f 100644 (file)
@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description                                                         /*{{{*/
-// $Id: apt-get.cc,v 1.109 2001/07/01 22:59:04 jgg Exp $
+// $Id: apt-get.cc,v 1.111 2001/11/04 17:09:18 tausq Exp $
 /* ######################################################################
    
    apt-get - Cover for dpkg
@@ -1860,7 +1860,7 @@ bool DoBuildDep(CommandLine &CmdL)
             
       // Process the build-dependencies
       vector<pkgSrcRecords::Parser::BuildDepRec> BuildDeps;
-      if (Last->BuildDepends(BuildDeps) == false)
+      if (Last->BuildDepends(BuildDeps, _config->FindB("APT::Get::Arch-Only",false)) == false)
        return _error->Error(_("Unable to get build-dependency information for %s"),Src.c_str());
    
       if (BuildDeps.size() == 0)
@@ -1877,8 +1877,15 @@ bool DoBuildDep(CommandLine &CmdL)
       {
         pkgCache::PkgIterator Pkg = Cache->FindPkg((*D).Package);
         if (Pkg.end() == true)
+         {
+           /* for a build-conflict; ignore unknown packages */
+           if ((*D).Type == pkgSrcRecords::Parser::BuildConflict || 
+               (*D).Type == pkgSrcRecords::Parser::BuildConflictIndep)
+               continue;
+
            return _error->Error(_("%s dependency on %s cannot be satisfied because the package %s cannot be found"),
                                 Last->BuildDepType((*D).Type),Src.c_str(),(*D).Package.c_str());
+         }
         pkgCache::VerIterator IV = (*Cache)[Pkg].InstVerIter(*Cache);
         
         if ((*D).Type == pkgSrcRecords::Parser::BuildConflict || 
@@ -2112,6 +2119,7 @@ int main(int argc,const char *argv[])
       {0,"trivial-only","APT::Get::Trivial-Only",0},
       {0,"remove","APT::Get::Remove",0},
       {0,"only-source","APT::Get::Only-Source",0},
+      {0,"arch-only","APT::Get::Arch-Only",0},
       {'c',"config-file",0,CommandLine::ConfigFile},
       {'o',"option",0,CommandLine::ArbItem},
       {0,0,0,0}};