X-Git-Url: http://git.hcoop.net/ntk/apt.git/blobdiff_plain/dc738e7ae6a9c14992279dc2c52f71b14ced53aa..a1e68c33ac15be454984b00d62c7fc331bd0b32b:/ftparchive/contents.cc diff --git a/ftparchive/contents.cc b/ftparchive/contents.cc index 4f2b1d16..bbc5a1e2 100644 --- a/ftparchive/contents.cc +++ b/ftparchive/contents.cc @@ -13,7 +13,7 @@ removing the massive sort time overhead. By breaking all the pathnames into components and storing them - separately a space savings is realized by not duplicating the string + separately a space saving is realized by not duplicating the string over and over again. Ultimately this saving is sacrificed to storage of the tree structure itself but the tree structure yields a speed gain in the sorting and processing. Ultimately it takes about 5 seconds to @@ -33,15 +33,18 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ -#include "contents.h" +#include -#include +#include #include #include #include #include #include -#include +#include + +#include +#include "contents.h" /*}}}*/ // GenContents::~GenContents - Free allocated memory /*{{{*/ @@ -305,17 +308,7 @@ void GenContents::DoPrint(FILE *Out,GenContents::Node *Top, char *Buf) bool ContentsExtract::Read(debDebFile &Deb) { Reset(); - - // Get the archive member and positition the file - const ARArchive::Member *Member = Deb.GotoMember("data.tar.gz"); - if (Member == 0) - return false; - - // Extract it. - ExtractTar Tar(Deb.GetFile(),Member->Size); - if (Tar.Go(*this) == false) - return false; - return true; + return Deb.ExtractArchive(*this); } /*}}}*/ // ContentsExtract::DoItem - Extract an item /*{{{*/ @@ -356,7 +349,7 @@ bool ContentsExtract::DoItem(Item &Itm,int &Fd) // ContentsExtract::TakeContents - Load the contents data /*{{{*/ // --------------------------------------------------------------------- /* */ -bool ContentsExtract::TakeContents(const void *NewData,unsigned long Length) +bool ContentsExtract::TakeContents(const void *NewData,unsigned long long Length) { if (Length == 0) { @@ -387,7 +380,7 @@ bool ContentsExtract::TakeContents(const void *NewData,unsigned long Length) // ContentsExtract::Add - Read the contents data into the sorter /*{{{*/ // --------------------------------------------------------------------- /* */ -void ContentsExtract::Add(GenContents &Contents,string Package) +void ContentsExtract::Add(GenContents &Contents,std::string const &Package) { const char *Start = Data; char *Pkg = Contents.Mystrdup(Package.c_str());