-
-#include <pkglib/pkgcachegen.h>
-#include <pkglib/deblistparser.h>
-
-int main(int argc,char *argv[])
-{
- {
- File F(argv[1],File::ReadOnly);
- File CacheF("./cache",File::WriteEmpty);
- DynamicMMap Map(CacheF,MMap::Public);
- pkgCacheGenerator Gen(Map);
- Gen.SelectFile(argv[1]);
-
- debListParser Parser(F);
- Gen.MergeList(Parser);
- }
-
- {
- File CacheF("./cache",File::WriteExists);
- MMap Map(CacheF,MMap::Public);
- pkgCache Cache(Map);
- for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; I++)
- {
- cout << "Package: " << I.Name() << endl;
- }
- }
-
-#if 0
- pkgTagSection I;
- while (Test.Step(I) == true)
- {
- const char *Start;
- const char *End;
- if (I.Find("Package",Start,End) == false)
- {
- cout << "Failed" << endl;
- continue;
- }
-
- cout << "Package: " << string(Start,End - Start) << endl;
-
-/* for (const char *I = Start; I < End; I++)
- {
- const char *Begin = I;
- bool Number = true;
- while (isspace(*I) == 0 && ispunct(*I) == 0 && I < End)
- {
- if (isalpha(*I) != 0)
- Number = false;
- I++;
- }
- if (Number == false)
- cout << string(Begin,I-Begin) << endl;
- while ((isspace(*I) != 0 || ispunct(*I) != 0) && I < End)
- I++;
- I--;
- } */
- }
-#endif
- _error->DumpErrors();
-}