summaryrefslogtreecommitdiff
path: root/test/scratch.cc
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2011-11-10 16:56:21 +0100
committerMichael Vogt <michael.vogt@ubuntu.com>2011-11-10 16:56:21 +0100
commit7cb543fb742a837c4931513674febaec5e4c1401 (patch)
treeddefe5b9329907818aa6eb3b593f555b29ccb869 /test/scratch.cc
parentf6cb0880a4b5d31e398cceb2e2577b6b82f4fffb (diff)
parent71ecaad29d8066a494f516efc5efd80860653fe2 (diff)
merged from lp:~mvo/apt/mvo (that has all the changes from debian-experimental2) and resolved a bunch of conflicts
Diffstat (limited to 'test/scratch.cc')
-rw-r--r--test/scratch.cc105
1 files changed, 0 insertions, 105 deletions
diff --git a/test/scratch.cc b/test/scratch.cc
deleted file mode 100644
index d638c7097..000000000
--- a/test/scratch.cc
+++ /dev/null
@@ -1,105 +0,0 @@
-#include <apt-pkg/dpkgdb.h>
-#include <apt-pkg/debfile.h>
-#include <apt-pkg/error.h>
-#include <apt-pkg/configuration.h>
-#include <apt-pkg/progress.h>
-#include <apt-pkg/extract.h>
-#include <apt-pkg/init.h>
-#include <apt-pkg/fileutl.h>
-
-using namespace std;
-
-int main(int argc,char *argv[])
-{
- pkgInitConfig(*_config);
- pkgInitSystem(*_config,_system);
-
-// cout << flNoLink(argv[1]) << endl;
-
-// #if 0
-/* DynamicMMap *FileMap = new DynamicMMap(MMap::Public);
- pkgFLCache *FList = new pkgFLCache(*FileMap);
-
- char *Name = "/tmp/test";
- pkgFLCache::PkgIterator Pkg(*FList,0);
- pkgFLCache::NodeIterator Node = FList->GetNode(Name,Name+strlen(Name),Pkg.Offset(),true,false);
- cout << (pkgFLCache::Node *)Node << endl;
- Node = FList->GetNode(Name,Name+strlen(Name),Pkg.Offset(),true,false);
- cout << (pkgFLCache::Node *)Node << endl;
-*/
-// #if 0
- _config->Set("Dir::State::status","/tmp/testing/status");
-
- debDpkgDB Db;
-
- {
- OpTextProgress Prog;
-
- if (Db.ReadyPkgCache(Prog) == false)
- cerr << "Error!" << endl;
- Prog.Done();
-
- if (Db.ReadyFileList(Prog) == false)
- cerr << "Error!" << endl;
- }
-
- if (_error->PendingError() == true)
- {
- _error->DumpErrors();
- return 0;
- }
-
-/* Db.GetFLCache().BeginDiverLoad();
- pkgFLCache::PkgIterator Pkg(Db.GetFLCache(),0);
- if (Db.GetFLCache().AddDiversion(Pkg,"/usr/include/linux/kerneld.h","/usr/bin/nslookup") == false)
- cerr << "Error!" << endl;
-
- const char *Tmp = "/usr/include/linux/kerneld.h";
- pkgFLCache::NodeIterator Nde = Db.GetFLCache().GetNode(Tmp,Tmp+strlen(Tmp),0,false,false);
- map_ptrloc Loc = Nde->File;
-
- for (; Nde.end() == false && Nde->File == Loc; Nde++)
- cout << Nde->Flags << ',' << Nde->Pointer << ',' << Nde.File() << endl;
- Db.GetFLCache().FinishDiverLoad();*/
-
-/* unsigned int I = 0;
- pkgFLCache &Fl = Db.GetFLCache();
- while (I < Fl.HeaderP->HashSize)
- {
- cout << I << endl;
- pkgFLCache::NodeIterator Node(Fl,Fl.NodeP + Fl.HeaderP->FileHash + I++);
- if (Node->Pointer == 0)
- continue;
- for (; Node.end() == false; Node++)
- {
- cout << Node.DirN() << '/' << Node.File();
- if (Node->Flags == pkgFLCache::Node::Diversion)
- cout << " (div)";
- if (Node->Flags == pkgFLCache::Node::ConfFile)
- cout << " (conf)";
- cout << endl;
- }
- }*/
-
- for (int I = 1; I < argc; I++)
- {
- FileFd F(argv[I],FileFd::ReadOnly);
- debDebFile Deb(F);
-
- if (Deb.ExtractControl(Db) == false)
- cerr << "Error!" << endl;
- cout << argv[I] << endl;
-
- pkgCache::VerIterator Ver = Deb.MergeControl(Db);
- if (Ver.end() == true)
- cerr << "Failed" << endl;
- else
- cout << Ver.ParentPkg().Name() << ' ' << Ver.VerStr() << endl;
-
- pkgExtract Extract(Db.GetFLCache(),Ver);
- Deb.ExtractArchive(Extract);
- }
-// #endif
-//#endif
- _error->DumpErrors();
-}