X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/0a8a80e58374771acc225fe1e08ed8e0fe0016cc..13d87e2e0f84512bc139637635b1e5025fa82a6c:/test/scratch.cc diff --git a/test/scratch.cc b/test/scratch.cc index a8817bc41..c48f3f594 100644 --- a/test/scratch.cc +++ b/test/scratch.cc @@ -1,27 +1,83 @@ -#include -#include +#include +/*void basic_string,alloc>::Rep::release() +{ + cout << "Release " << (void *)this << ' ' << ref << endl; + if (--ref == 0) delete this; +} + +basic_string,alloc>::~basic_string() +{ + cout << "Destroy " << (void *)this << ',' << rep()->ref << endl; + rep ()->release (); +}*/ + + + +#include +#include + +#include +#include #include +#include + #include +#include +#include -int main() +struct Rep { - signal(SIGPIPE,SIG_IGN); - + size_t len, res, ref; + bool selfish; +}; + +int main(int argc,char *argv[]) +{ + pkgCacheFile Cache; + OpProgress Prog; pkgInitialize(*_config); + if (Cache.Open(Prog,false) == false) + { + _error->DumpErrors(); + return 0; + } - pkgSourceList List; - pkgAcquire Fetcher; - List.ReadMainList(); - - pkgSourceList::const_iterator I; - for (I = List.begin(); I != List.end(); I++) + pkgRecords rec(*Cache); + while (1) { - new pkgAcqIndex(&Fetcher,I); - if (_error->PendingError() == true) - break; + pkgCache::VerIterator V = (*Cache)[Cache->PkgBegin()].CandidateVerIter(*Cache); + pkgRecords::Parser &Parse = rec.Lookup(V.FileList()); + string Foo = Parse.ShortDesc(); + + cout << (reinterpret_cast(Foo.begin()) - 1)[0].ref << endl; + +// cout << Foo << endl; + +// cout << rec.Lookup(V.FileList()).ShortDesc() << endl; + malloc_stats(); } - - Fetcher.Run(); - _error->DumpErrors(); +#if 0 + URI U(argv[1]); + cout << U.Access << endl; + cout << U.User << endl; + cout << U.Password << endl; + cout << U.Host << endl; + cout << U.Path << endl; + cout << U.Port << endl; + +/* + FileFd F(argv[1],FileFd::ReadOnly); + pkgTagFile Reader(F); + + pkgTagSection Sect; + while (Reader.Step(Sect) == true) + { + Sect.FindS("Package"); + Sect.FindS("Section"); + Sect.FindS("Version"); + Sect.FindI("Size"); + };*/ +#endif + return 0; }