From 9c257550854273ff6defb1816cb210d51f64db03 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 22 Mar 2012 13:09:22 +0100 Subject: =?UTF-8?q?*=20apt-inst/database.{cc,h},=20apt-inst/deb/dpkgdb.{cc?= =?UTF-8?q?,h}:=20=20=20-=20drop=20instead=20of=20fix=20as=20it=20is=20onl?= =?UTF-8?q?y=20needed=20if=20you=20want=20to=20reimplement=20dpkg=20=20=20?= =?UTF-8?q?=20=20and=20comes=20straight=20from=20the=20beginning=20of=20la?= =?UTF-8?q?st=20decade=20(Closes:=20#663372)=20*=20apt-inst/deb/debfile.cc?= =?UTF-8?q?:=20=20=20-=20{Extract,Merge}Control()=20is=20another=20instanc?= =?UTF-8?q?e=20of=20"lets=20reimplement=20dpkg"=20=20=20=20=20so=20shot=20?= =?UTF-8?q?of=20this=20code=20before=20someone=20ends=20up=20using=20this?= =?UTF-8?q?=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/interactive-helper/makefile | 12 ++-- test/interactive-helper/testextract.cc | 104 --------------------------------- 2 files changed, 4 insertions(+), 112 deletions(-) delete mode 100644 test/interactive-helper/testextract.cc (limited to 'test') diff --git a/test/interactive-helper/makefile b/test/interactive-helper/makefile index b96139fda..10d1e44ec 100644 --- a/test/interactive-helper/makefile +++ b/test/interactive-helper/makefile @@ -11,28 +11,24 @@ SLIBS = SOURCE = mthdcat.cc include $(PROGRAM_H) -# Version compare tester -PROGRAM=testextract -SLIBS = -lapt-pkg -lapt-inst -LIB_MAKES = apt-pkg/makefile apt-inst/makefile -SOURCE = testextract.cc -include $(PROGRAM_H) - # Program for testing the tar/deb extractor PROGRAM=testdeb SLIBS = -lapt-pkg -lapt-inst +LIB_MAKES = apt-pkg/makefile apt-inst/makefile SOURCE = testdeb.cc include $(PROGRAM_H) # Program for testing tar extraction PROGRAM=extract-control SLIBS = -lapt-pkg -lapt-inst +LIB_MAKES = apt-pkg/makefile apt-inst/makefile SOURCE = extract-control.cc include $(PROGRAM_H) # Program for testing udevcdrom PROGRAM=test_udevcdrom -SLIBS = -lapt-pkg +SLIBS = -lapt-pkg +LIB_MAKES = apt-pkg/makefile SOURCE = test_udevcdrom.cc include $(PROGRAM_H) diff --git a/test/interactive-helper/testextract.cc b/test/interactive-helper/testextract.cc deleted file mode 100644 index 8dfe68fc9..000000000 --- a/test/interactive-helper/testextract.cc +++ /dev/null @@ -1,104 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -using namespace std; - -bool Go(int argc,char *argv[]) -{ - // Init the database - debDpkgDB Db; - { - OpTextProgress Prog; - - if (Db.ReadyPkgCache(Prog) == false) - return false; - Prog.Done(); - - if (Db.ReadyFileList(Prog) == false) - return false; - } - - for (int I = 1; I < argc; I++) - { - const char *Fake = 0; - for (unsigned J = 0; argv[I][J] != 0; J++) - { - if (argv[I][J] != ',') - continue; - Fake = argv[I] + J + 1; - argv[I][J] = 0; - } - - FileFd F(argv[I],FileFd::ReadOnly); - debDebFile Deb(F); - - if (_error->PendingError() == true) - return false; - - if (Deb.ExtractControl(Db) == false) - return false; - cout << argv[I] << endl; - - pkgCache::VerIterator Ver = Deb.MergeControl(Db); - if (Ver.end() == true) - return false; - - cout << Ver.ParentPkg().Name() << ' ' << Ver.VerStr() << endl; - - pkgExtract Extract(Db.GetFLCache(),Ver); - - if (Fake != 0) - { - pkgExtract::Item Itm; - memset(&Itm,0,sizeof(Itm)); - FILE *F = fopen(Fake,"r"); - while (feof(F) == 0) - { - char Line[300]; - if (fgets(Line,sizeof(Line),F) == NULL) - return false; - Itm.Name = _strstrip(Line); - Itm.Type = pkgDirStream::Item::File; - if (Line[strlen(Line)-1] == '/') - Itm.Type = pkgDirStream::Item::Directory; - - int Fd; - if (Extract.DoItem(Itm,Fd) == false) { - fclose(F); - return false; - } - } - fclose(F); - } - else - if (Deb.ExtractArchive(Extract) == false) - return false; - } - return true; -} - -int main(int argc,char *argv[]) -{ - pkgInitConfig(*_config); - pkgInitSystem(*_config,_system); - _config->Set("Dir::State::status","/tmp/testing/status"); - - Go(argc,argv); - - if (_error->PendingError() == true) - { - _error->DumpErrors(); - return 0; - } -} -- cgit v1.2.3