summaryrefslogtreecommitdiff
path: root/test/scratch.cc
blob: 7cd43c55469b2d4746b9059b4ef88ff407b6863a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include <apt-pkg/acquire-item.h>
#include <apt-pkg/init.h>
#include <apt-pkg/error.h>
#include <signal.h>
#include <strutl.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();
   
   pkgSourceList::const_iterator I;
   for (I = List.begin(); I != List.end(); I++)
   {
      new pkgAcqIndex(&Fetcher,I);
      if (_error->PendingError() == true)
	 break;
   }

   Fetcher.Run();
   
   _error->DumpErrors();
}