Просмотр исходного кода

Add --arch-only option for apt-get build-dep only only ...
Author: tausq
Date: 2001-11-04 17:09:18 GMT
Add --arch-only option for apt-get build-dep only only process
arch-dependent build-dependencies.

Small change to srcrecord class; bumped minor so number to 3.3

Arch Librarian лет назад: 22
Родитель
Сommit
45430cbf4c
7 измененных файлов с 21 добавлено и 11 удалено
  1. 5 2
      apt-pkg/deb/debsrcrecords.cc
  2. 2 2
      apt-pkg/deb/debsrcrecords.h
  3. 2 2
      apt-pkg/init.h
  4. 1 1
      apt-pkg/makefile
  5. 2 2
      apt-pkg/srcrecords.h
  6. 3 2
      cmdline/apt-get.cc
  7. 6 0
      doc/apt-get.8.sgml

+ 5 - 2
apt-pkg/deb/debsrcrecords.cc

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
 // Description								/*{{{*/
-// $Id: debsrcrecords.cc,v 1.4 2001/02/20 07:03:17 jgg Exp $
+// $Id: debsrcrecords.cc,v 1.5 2001/11/04 17:09:18 tausq Exp $
 /* ######################################################################
 /* ######################################################################
    
    
    Debian Source Package Records - Parser implementation for Debian style
    Debian Source Package Records - Parser implementation for Debian style
@@ -47,7 +47,7 @@ const char **debSrcRecordParser::Binaries()
    package/version records representing the build dependency. The returned 
    package/version records representing the build dependency. The returned 
    array need not be freed and will be reused by the next call to this 
    array need not be freed and will be reused by the next call to this 
    function */
    function */
-bool debSrcRecordParser::BuildDepends(vector<pkgSrcRecords::Parser::BuildDepRec> &BuildDeps)
+bool debSrcRecordParser::BuildDepends(vector<pkgSrcRecords::Parser::BuildDepRec> &BuildDeps, bool ArchOnly)
 {
 {
    unsigned int I;
    unsigned int I;
    const char *Start, *Stop;
    const char *Start, *Stop;
@@ -61,6 +61,9 @@ bool debSrcRecordParser::BuildDepends(vector<pkgSrcRecords::Parser::BuildDepRec>
 
 
    for (I = 0; I < 4; I++) 
    for (I = 0; I < 4; I++) 
    {
    {
+      if (ArchOnly && (I == 1 || I == 3))
+         continue;
+
       if (Sect.Find(fields[I], Start, Stop) == false)
       if (Sect.Find(fields[I], Start, Stop) == false)
          continue;
          continue;
       
       

+ 2 - 2
apt-pkg/deb/debsrcrecords.h

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
 // Description								/*{{{*/
-// $Id: debsrcrecords.h,v 1.6 2001/02/20 07:03:17 jgg Exp $
+// $Id: debsrcrecords.h,v 1.7 2001/11/04 17:09:18 tausq Exp $
 /* ######################################################################
 /* ######################################################################
    
    
    Debian Source Package Records - Parser implementation for Debian style
    Debian Source Package Records - Parser implementation for Debian style
@@ -39,7 +39,7 @@ class debSrcRecordParser : public pkgSrcRecords::Parser
    virtual string Maintainer() const {return Sect.FindS("Maintainer");};
    virtual string Maintainer() const {return Sect.FindS("Maintainer");};
    virtual string Section() const {return Sect.FindS("Section");};
    virtual string Section() const {return Sect.FindS("Section");};
    virtual const char **Binaries();
    virtual const char **Binaries();
-   virtual bool BuildDepends(vector<BuildDepRec> &BuildDeps);
+   virtual bool BuildDepends(vector<BuildDepRec> &BuildDeps, bool ArchOnly);
    virtual unsigned long Offset() {return iOffset;};
    virtual unsigned long Offset() {return iOffset;};
    virtual string AsStr() 
    virtual string AsStr() 
    {
    {

+ 2 - 2
apt-pkg/init.h

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
 // Description								/*{{{*/
-// $Id: init.h,v 1.8 2001/04/22 05:42:52 jgg Exp $
+// $Id: init.h,v 1.9 2001/11/04 17:09:18 tausq Exp $
 /* ######################################################################
 /* ######################################################################
 
 
    Init - Initialize the package library
    Init - Initialize the package library
@@ -18,7 +18,7 @@
 
 
 // See the makefile
 // See the makefile
 #define APT_PKG_MAJOR 3
 #define APT_PKG_MAJOR 3
-#define APT_PKG_MINOR 2
+#define APT_PKG_MINOR 3
 #define APT_PKG_RELEASE 0
 #define APT_PKG_RELEASE 0
     
     
 extern const char *pkgVersion;
 extern const char *pkgVersion;

+ 1 - 1
apt-pkg/makefile

@@ -12,7 +12,7 @@ include ../buildlib/defaults.mak
 # The library name, don't forget to update init.h
 # The library name, don't forget to update init.h
 LIBRARY=apt-pkg
 LIBRARY=apt-pkg
 LIBEXT=$(GLIBC_VER)$(LIBSTDCPP_VER)
 LIBEXT=$(GLIBC_VER)$(LIBSTDCPP_VER)
-MAJOR=3.2
+MAJOR=3.3
 MINOR=0
 MINOR=0
 SLIBS=$(PTHREADLIB)
 SLIBS=$(PTHREADLIB)
 
 

+ 2 - 2
apt-pkg/srcrecords.h

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
 // Description								/*{{{*/
-// $Id: srcrecords.h,v 1.7 2001/05/07 04:24:08 jgg Exp $
+// $Id: srcrecords.h,v 1.8 2001/11/04 17:09:18 tausq Exp $
 /* ######################################################################
 /* ######################################################################
    
    
    Source Package Records - Allows access to source package records
    Source Package Records - Allows access to source package records
@@ -72,7 +72,7 @@ class pkgSrcRecords
       virtual string Section() const = 0;
       virtual string Section() const = 0;
       virtual const char **Binaries() = 0;   // Ownership does not transfer
       virtual const char **Binaries() = 0;   // Ownership does not transfer
 
 
-      virtual bool BuildDepends(vector<BuildDepRec> &BuildDeps) = 0;
+      virtual bool BuildDepends(vector<BuildDepRec> &BuildDeps, bool ArchOnly) = 0;
       static const char *BuildDepType(unsigned char Type);
       static const char *BuildDepType(unsigned char Type);
 
 
       virtual bool Files(vector<pkgSrcRecords::File> &F) = 0;
       virtual bool Files(vector<pkgSrcRecords::File> &F) = 0;

+ 3 - 2
cmdline/apt-get.cc

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
 // Description								/*{{{*/
-// $Id: apt-get.cc,v 1.110 2001/10/02 03:16:28 tausq Exp $
+// $Id: apt-get.cc,v 1.111 2001/11/04 17:09:18 tausq Exp $
 /* ######################################################################
 /* ######################################################################
    
    
    apt-get - Cover for dpkg
    apt-get - Cover for dpkg
@@ -1860,7 +1860,7 @@ bool DoBuildDep(CommandLine &CmdL)
             
             
       // Process the build-dependencies
       // Process the build-dependencies
       vector<pkgSrcRecords::Parser::BuildDepRec> BuildDeps;
       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());
       	return _error->Error(_("Unable to get build-dependency information for %s"),Src.c_str());
    
    
       if (BuildDeps.size() == 0)
       if (BuildDeps.size() == 0)
@@ -2119,6 +2119,7 @@ int main(int argc,const char *argv[])
       {0,"trivial-only","APT::Get::Trivial-Only",0},
       {0,"trivial-only","APT::Get::Trivial-Only",0},
       {0,"remove","APT::Get::Remove",0},
       {0,"remove","APT::Get::Remove",0},
       {0,"only-source","APT::Get::Only-Source",0},
       {0,"only-source","APT::Get::Only-Source",0},
+      {0,"arch-only","APT::Get::Arch-Only",0},
       {'c',"config-file",0,CommandLine::ConfigFile},
       {'c',"config-file",0,CommandLine::ConfigFile},
       {'o',"option",0,CommandLine::ArbItem},
       {'o',"option",0,CommandLine::ArbItem},
       {0,0,0,0}};
       {0,0,0,0}};

+ 6 - 0
doc/apt-get.8.sgml

@@ -397,6 +397,12 @@
      <literal/APT::Get::Tar-Only/
      <literal/APT::Get::Tar-Only/
      </VarListEntry>
      </VarListEntry>
      
      
+     <VarListEntry><term><option/--arch-only/</>
+     <ListItem><Para>
+     Only process architecture-dependent build-dependencies.
+     Configuration Item: <literal/APT::Get::Arch-Only/ 
+     </VarListEntry>
+     
      &apt-commonoptions;
      &apt-commonoptions;
      
      
    </VariableList>
    </VariableList>