]> git.saurik.com Git - apt.git/blob - test/scratch.cc
Fixed doc reference
[apt.git] / test / scratch.cc
1 #include <apt-pkg/acquire-item.h>
2 #include <apt-pkg/init.h>
3 #include <apt-pkg/error.h>
4 #include <signal.h>
5 #include <strutl.h>
6
7 int main(int argc,char *argv[])
8 {
9 signal(SIGPIPE,SIG_IGN);
10
11 URI Foo(argv[1]);
12 cout << Foo.Access << '\'' << endl;
13 cout << Foo.Host << '\'' << endl;
14 cout << Foo.Path << '\'' << endl;
15 cout << Foo.User << '\'' << endl;
16 cout << Foo.Password << '\'' << endl;
17 cout << Foo.Port << endl;
18
19 return 0;
20
21 pkgInitialize(*_config);
22
23 pkgSourceList List;
24 pkgAcquire Fetcher;
25 List.ReadMainList();
26
27 pkgSourceList::const_iterator I;
28 for (I = List.begin(); I != List.end(); I++)
29 {
30 new pkgAcqIndex(&Fetcher,I);
31 if (_error->PendingError() == true)
32 break;
33 }
34
35 Fetcher.Run();
36
37 _error->DumpErrors();
38 }