// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: tagfile.cc,v 1.2 1998/07/04 05:57:39 jgg Exp $
+// $Id: tagfile.cc,v 1.6 1998/07/09 05:12:32 jgg Exp $
/* ######################################################################
Fast scanner for RFC-822 type header information
##################################################################### */
/*}}}*/
// Include Files /*{{{*/
+#ifdef __GNUG__
+#pragma implementation "pkglib/tagfile.h"
+#endif
+
#include <pkglib/tagfile.h>
#include <pkglib/error.h>
+#include <pkglib/init.h>
#include <string>
#include <stdio.h>
Buffer = new char[64*1024];
Start = End = Buffer + 64*1024;
Left = Fd.Size();
+ iOffset = 0;
Fill();
}
/*}}}*/
if (Tag.Scan(Start,End - Start) == false)
return _error->Error("Unable to parse package file");
}
- Start += Tag.Length();
+ Start += Tag.size();
+ iOffset += Tag.size();
+
return true;
}
/*}}}*/
int main(int argc,char *argv[])
{
+ pkglibInitialize(*_config);
+ cout << _config->Find("APT::arch") << endl;
+ cout << _config->FindDir("DIR::Etc::sourcelist") << endl;
+
{
- 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);
- }
+ for (int I = 1; I != argc; I++)
+ {
+ cout << "Merging in " << argv[I] << endl;
+ File F(argv[I],File::ReadOnly);
+ Gen.SelectFile(argv[I]);
+ debListParser Parser(F);
+ Gen.MergeList(Parser);
+ }
+ }
+/*
{
File CacheF("./cache",File::WriteExists);
- MMap Map(CacheF,MMap::Public);
+ MMap Map(CacheF,MMap::Public | MMap::ReadOnly);
pkgCache Cache(Map);
for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; I++)
{
cout << "Package: " << I.Name() << endl;
- }
+ for (pkgCache::VerIterator V = I.VersionList(); V.end() == false; V++)
+ {
+ cout << "Version: " << V.VerStr() << endl;
+ cout << "Size: " << V->Size << endl;
+ cout << "Installed-Size: " << V->InstalledSize << endl;
+ cout << "Section: " << V.Section() << endl;
+ cout << "Priority: " << Cache.Priority(V->Priority) << endl;
+
+ pkgCache::PrvIterator P = V.ProvidesList();
+ if (P.end() == false)
+ {
+ cout << "Provides: ";
+ for (; P.end() == false; P++)
+ cout << P.Name() << ", ";
+ cout << endl;
+ }
+ }
+ cout << endl;
+ }
}
-
+*/
#if 0
pkgTagSection I;
while (Test.Step(I) == true)