]> git.saurik.com Git - apt.git/blobdiff - test/testextract.cc
Defaults is a vector of Pin not of PkgPin
[apt.git] / test / testextract.cc
index 41a197068f589d0d8f00807b77abf63ca5ab9cec..b790df618f7b27871125b0c0a687280989f4edbb 100644 (file)
@@ -1,4 +1,3 @@
-#define APT_COMPATIBILITY 1
 #include <apt-pkg/dpkgdb.h>
 #include <apt-pkg/debfile.h>
 #include <apt-pkg/error.h>
@@ -11,6 +10,8 @@
 #include <stdio.h>
 #include <stdlib.h>
 
+using namespace std;
+
 bool Go(int argc,char *argv[])
 {
    // Init the database
@@ -70,9 +71,12 @@ bool Go(int argc,char *argv[])
               Itm.Type = pkgDirStream::Item::Directory;
 
            int Fd;
-           if (Extract.DoItem(Itm,Fd) == false)
+           if (Extract.DoItem(Itm,Fd) == false) {
+              fclose(F);
               return false;
-        }       
+           }
+        }
+        fclose(F);
       }
       else
         if (Deb.ExtractArchive(Extract) == false)
@@ -83,7 +87,8 @@ bool Go(int argc,char *argv[])
 
 int main(int argc,char *argv[])
 {
-   pkgInitialize(*_config);
+   pkgInitConfig(*_config);
+   pkgInitSystem(*_config,_system);
    _config->Set("Dir::State::status","/tmp/testing/status");
 
    Go(argc,argv);