]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/edsp/edspindexfile.cc
populate the Architecture field for PackageFiles
[apt.git] / apt-pkg / edsp / edspindexfile.cc
index f5881e66362a9b95b0363f232642fa13bd74cd69..a2ec0a19bfcc4d2bdcea412ae7df6af3e54390ab 100644 (file)
@@ -6,22 +6,30 @@
    ##################################################################### */
                                                                        /*}}}*/
 // Include Files                                                       /*{{{*/
    ##################################################################### */
                                                                        /*}}}*/
 // Include Files                                                       /*{{{*/
+#include <config.h>
+
 #include <apt-pkg/edspindexfile.h>
 #include <apt-pkg/edsplistparser.h>
 #include <apt-pkg/edspindexfile.h>
 #include <apt-pkg/edsplistparser.h>
-#include <apt-pkg/sourcelist.h>
-#include <apt-pkg/configuration.h>
-#include <apt-pkg/progress.h>
 #include <apt-pkg/error.h>
 #include <apt-pkg/error.h>
-#include <apt-pkg/strutl.h>
-#include <apt-pkg/acquire-item.h>
+#include <apt-pkg/fileutl.h>
+#include <apt-pkg/progress.h>
+#include <apt-pkg/debindexfile.h>
+#include <apt-pkg/indexfile.h>
+#include <apt-pkg/mmap.h>
+#include <apt-pkg/pkgcache.h>
+#include <apt-pkg/cacheiterators.h>
+#include <apt-pkg/pkgcachegen.h>
+#include <apt-pkg/pkgrecords.h>
 
 
-#include <sys/stat.h>
+#include <stddef.h>
+#include <unistd.h>
+#include <string>
                                                                        /*}}}*/
 
 // edspIndex::edspIndex - Constructor                                  /*{{{*/
 // ---------------------------------------------------------------------
 /* */
                                                                        /*}}}*/
 
 // edspIndex::edspIndex - Constructor                                  /*{{{*/
 // ---------------------------------------------------------------------
 /* */
-edspIndex::edspIndex(string File) : debStatusIndex(File)
+edspIndex::edspIndex(std::string File) : debStatusIndex(File)
 {
 }
                                                                        /*}}}*/
 {
 }
                                                                        /*}}}*/
@@ -41,17 +49,14 @@ bool edspIndex::Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const
 
    if (Prog != NULL)
       Prog->SubProgress(0,File);
 
    if (Prog != NULL)
       Prog->SubProgress(0,File);
-   if (Gen.SelectFile(File,string(),*this) == false)
+   if (Gen.SelectFile(File, *this, "", "edsp") == false)
       return _error->Error("Problem with SelectFile %s",File.c_str());
 
    // Store the IMS information
    pkgCache::PkgFileIterator CFile = Gen.GetCurFile();
       return _error->Error("Problem with SelectFile %s",File.c_str());
 
    // Store the IMS information
    pkgCache::PkgFileIterator CFile = Gen.GetCurFile();
-   struct stat St;
-   if (fstat(Pkg.Fd(),&St) != 0)
-      return _error->Errno("fstat","Failed to stat");
-   CFile->Size = St.st_size;
-   CFile->mtime = St.st_mtime;
-   CFile->Archive = Gen.WriteUniqString("edsp::scenario");
+   pkgCacheGenerator::Dynamic<pkgCache::PkgFileIterator> DynFile(CFile);
+   CFile->Size = Pkg.FileSize();
+   CFile->mtime = Pkg.ModificationTime();
 
    if (Gen.MergeList(Parser) == false)
       return _error->Error("Problem with MergeList %s",File.c_str());
 
    if (Gen.MergeList(Parser) == false)
       return _error->Error("Problem with MergeList %s",File.c_str());
@@ -59,17 +64,17 @@ bool edspIndex::Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const
 }
                                                                        /*}}}*/
 // Index File types for APT                                            /*{{{*/
 }
                                                                        /*}}}*/
 // Index File types for APT                                            /*{{{*/
-class edspIFType: public pkgIndexFile::Type
+class APT_HIDDEN edspIFType: public pkgIndexFile::Type
 {
    public:
 {
    public:
-   virtual pkgRecords::Parser *CreatePkgParser(pkgCache::PkgFileIterator File) const
+   virtual pkgRecords::Parser *CreatePkgParser(pkgCache::PkgFileIterator) const
    {
       // we don't have a record parser for this type as the file is not presistent
       return NULL;
    };
    edspIFType() {Label = "EDSP scenario file";};
 };
    {
       // we don't have a record parser for this type as the file is not presistent
       return NULL;
    };
    edspIFType() {Label = "EDSP scenario file";};
 };
-static edspIFType _apt_Universe;
+APT_HIDDEN edspIFType _apt_Universe;
 
 const pkgIndexFile::Type *edspIndex::GetType() const
 {
 
 const pkgIndexFile::Type *edspIndex::GetType() const
 {