]> git.saurik.com Git - apt.git/blobdiff - test/scratch.cc
Fixed sparc compile warning
[apt.git] / test / scratch.cc
index 53681db16e030e668f758ea72df999defcff1d60..dc02e059a3d275f7b9b50899c9c363ff4bf4e16a 100644 (file)
@@ -1,38 +1,21 @@
-#include <apt-pkg/acquire-item.h>
-#include <apt-pkg/init.h>
-#include <apt-pkg/error.h>
+#include <apt-pkg/tagfile.h>
+
 #include <signal.h>
-#include <strutl.h>
+#include <stdio.h>
 
 int main(int argc,char *argv[])
 {
-   signal(SIGPIPE,SIG_IGN);
-
-/*   URI Foo(argv[1]);
-   cout << Foo.Access << '\'' << endl;
-   cout << Foo.Host << '\'' << endl;
-   cout << Foo.Path << '\'' << endl;
-   cout << Foo.User << '\'' << endl;
-   cout << Foo.Password << '\'' << endl;
-   cout << Foo.Port << endl;
-   
-   return 0;*/
-
-   pkgInitialize(*_config);
-   
-   pkgSourceList List;
-   pkgAcquire Fetcher;
-   List.ReadMainList();
+   FileFd F(argv[1],FileFd::ReadOnly);
+   pkgTagFile Reader(F);
    
-   pkgSourceList::const_iterator I;
-   for (I = List.begin(); I != List.end(); I++)
+   pkgTagSection Sect;
+   while (Reader.Step(Sect) == true)
    {
-      new pkgAcqIndex(&Fetcher,I);
-      if (_error->PendingError() == true)
-        break;
-   }
-
-   Fetcher.Run();
+      Sect.FindS("Package");
+      Sect.FindS("Section");
+      Sect.FindS("Version");
+      Sect.FindI("Size");
+   };
    
-   _error->DumpErrors();
+   return 0;
 }