]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/deb/debsrcrecords.cc
create debIFTypeDscFile type
[apt.git] / apt-pkg / deb / debsrcrecords.cc
index ce55ccd1f03e298b8f9e1fba8a3130bc5e22f61b..8aad81e3cfd839d029f96efe0147d88e61e8e6d5 100644 (file)
 #include <apt-pkg/debsrcrecords.h>
 #include <apt-pkg/error.h>
 #include <apt-pkg/strutl.h>
-#include <apt-pkg/configuration.h>
 #include <apt-pkg/aptconfiguration.h>
+#include <apt-pkg/srcrecords.h>
+#include <apt-pkg/tagfile.h>
+#include <apt-pkg/gpgv.h>
 
-using std::max;
+#include <ctype.h>
+#include <stdlib.h>
+#include <string.h>
+#include <algorithm>
+#include <string>
+#include <vector>
                                                                        /*}}}*/
 
+using std::max;
 using std::string;
 
 // SrcRecordParser::Binaries - Return the binaries field               /*{{{*/
@@ -57,7 +65,7 @@ const char **debSrcRecordParser::Binaries()
    } while (*bin != '\0');
    StaticBinList.push_back(NULL);
 
-   return (const char **) &StaticBinList[0];
+   return &StaticBinList[0];
 }
                                                                        /*}}}*/
 // SrcRecordParser::BuildDepends - Return the Build-Depends information        /*{{{*/
@@ -90,7 +98,7 @@ bool debSrcRecordParser::BuildDepends(std::vector<pkgSrcRecords::Parser::BuildDe
       while (1)
       {
          Start = debListParser::ParseDepends(Start, Stop, 
-                    rec.Package,rec.Version,rec.Op,true, StripMultiArch);
+                    rec.Package,rec.Version,rec.Op,true,StripMultiArch,true);
         
          if (Start == 0) 
             return _error->Error("Problem parsing dependency: %s", fields[I]);
@@ -182,3 +190,21 @@ debSrcRecordParser::~debSrcRecordParser()
    delete[] Buffer;
 }
                                                                        /*}}}*/
+
+
+debDscRecordParser::debDscRecordParser(std::string const &DscFile, pkgIndexFile const *Index)
+   : debSrcRecordParser(DscFile, Index)
+{
+   // support clear signed files
+   if (OpenMaybeClearSignedFile(DscFile, Fd) == false)
+   {
+      _error->Error("Failed to open %s", DscFile.c_str());
+      return;
+   }
+
+   // re-init to ensure the updated Fd is used
+   Tags.Init(&Fd);
+   // read the first (and only) record
+   Step();
+
+}