reorder includes: add <config.h> if needed and include it at first
[ntk/apt.git] / apt-pkg / deb / debsrcrecords.cc
index 21336e1..c9c2026 100644 (file)
@@ -9,11 +9,14 @@
    ##################################################################### */
                                                                        /*}}}*/
 // Include Files                                                       /*{{{*/
+#include <config.h>
+
 #include <apt-pkg/deblistparser.h>
 #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>
 
 using std::max;
                                                                        /*}}}*/
@@ -111,7 +114,9 @@ bool debSrcRecordParser::Files(vector<pkgSrcRecords::File> &List)
    string Base = Sect.FindS("Directory");
    if (Base.empty() == false && Base[Base.length()-1] != '/')
       Base += '/';
-   
+
+   std::vector<std::string> const compExts = APT::Configuration::getCompressorExtensions();
+
    // Iterate over the entire list grabbing each triplet
    const char *C = Files.c_str();
    while (*C != 0)
@@ -144,7 +149,8 @@ bool debSrcRecordParser::Files(vector<pkgSrcRecords::File> &List)
         }
         F.Type = string(F.Path,Tmp+1,Pos-Tmp);
         
-        if (F.Type == "gz" || F.Type == "bz2" || F.Type == "lzma" || F.Type == "tar")
+        if (std::find(compExts.begin(), compExts.end(), std::string(".").append(F.Type)) != compExts.end() ||
+            F.Type == "tar")
         {
            Pos = Tmp-1;
            continue;