Package: apt
Version: 0.5.14
Author: Guillem Jover <guillem@hadrons.org>
Status: rejected
Debbug: 217014
Description:
 Add architecture filter support to apt-ftparchive.


Index: apt-ftparchive.cc
===================================================================
RCS file: /cvs/deity/apt/ftparchive/apt-ftparchive.cc,v
retrieving revision 1.8
diff -u -r1.8 apt-ftparchive.cc
--- apt-ftparchive.cc	18 Jul 2003 15:28:58 -0000	1.8
+++ apt-ftparchive.cc	22 Oct 2003 02:31:04 -0000
@@ -72,6 +72,7 @@
    string CntCompress;
    string SrcCompress;
    string PathPrefix;
+   string Architecture;
    unsigned int DeLinkLimit;
    mode_t Permissions;
    
@@ -168,6 +169,8 @@
    Packages.DirStrip = ArchiveDir;
    Packages.InternalPrefix = flCombine(ArchiveDir,InternalPrefix);
 
+   Packages.Architecture = Architecture;
+
    Packages.Stats.DeLinkBytes = Stats.DeLinkBytes;
    Packages.DeLinkLimit = DeLinkLimit;
 
@@ -472,6 +475,7 @@
 	    
 	    Itm.BinOverride = SubstVar(Block.Find("BinOverride"),Vars);
 	    Itm.InternalPrefix = SubstVar(Block.Find("InternalPrefix",DIPrfx.c_str()),Vars);
+	    Itm.Architecture = Arch;
 
 	    if (stringcasecmp(Arch,"source") == 0)
 	    {
Index: writer.cc
===================================================================
RCS file: /cvs/deity/apt/ftparchive/writer.cc,v
retrieving revision 1.7
diff -u -r1.7 writer.cc
--- writer.cc	10 Feb 2003 07:34:41 -0000	1.7
+++ writer.cc	22 Oct 2003 02:31:05 -0000
@@ -348,8 +348,18 @@
    if (Delink(FileName,OriginalPath,Stats.DeLinkBytes,St) == false)
       return false;
    
-   // Lookup the overide information
    pkgTagSection &Tags = Db.Control.Section;
+
+   // Test for a valid Architecture
+   if (Architecture.empty() == false)
+   {
+      string PackageArchitecture = Tags.FindS("Architecture");
+
+      if (PackageArchitecture != Architecture && PackageArchitecture != "all")
+	  return false;
+   }
+
+   // Lookup the override information
    string Package = Tags.FindS("Package");
    Override::Item Tmp;
    Override::Item *OverItem = Over.GetItem(Package);
Index: writer.h
===================================================================
RCS file: /cvs/deity/apt/ftparchive/writer.h,v
retrieving revision 1.4
diff -u -r1.4 writer.h
--- writer.h	26 Jun 2001 02:50:27 -0000	1.4
+++ writer.h	22 Oct 2003 02:31:05 -0000
@@ -87,6 +87,7 @@
    // General options
    string PathPrefix;
    string DirStrip;
+   string Architecture;
    FILE *Output;
    struct CacheDB::Stats &Stats;
    
