scratch.cc 790 B

123456789101112131415161718192021222324252627282930313233343536373839
  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. int main(int argc,char *argv[])
  7. {
  8. signal(SIGPIPE,SIG_IGN);
  9. /* URI Foo(argv[1]);
  10. cout << Foo.Access << '\'' << endl;
  11. cout << Foo.Host << '\'' << endl;
  12. cout << Foo.Path << '\'' << endl;
  13. cout << Foo.User << '\'' << endl;
  14. cout << Foo.Password << '\'' << endl;
  15. cout << Foo.Port << endl;
  16. return 0;*/
  17. pkgInitialize(*_config);
  18. pkgSourceList List;
  19. pkgAcquire Fetcher;
  20. List.ReadMainList();
  21. pkgSourceList::const_iterator I;
  22. for (I = List.begin(); I != List.end(); I++)
  23. {
  24. new pkgAcqIndex(&Fetcher,I);
  25. if (_error->PendingError() == true)
  26. break;
  27. }
  28. Fetcher.Run();
  29. _error->DumpErrors();
  30. }