]>
git.saurik.com Git - apt.git/blob - test/interactive-helper/testdeb.cc
3 #include <apt-pkg/dirstream.h>
4 #include <apt-pkg/debfile.h>
5 #include <apt-pkg/error.h>
6 #include <apt-pkg/extracttar.h>
7 #include <apt-pkg/arfile.h>
8 #include <apt-pkg/fileutl.h>
13 class NullStream
: public pkgDirStream
16 virtual bool DoItem(Item
&/*Itm*/, int &/*Fd*/) APT_OVERRIDE
{return true;};
19 static bool Test(const char *File
)
21 FileFd
Fd(File
,FileFd::ReadOnly
);
24 if (_error
->PendingError() == true)
27 // Get the archive member and positition the file
28 const ARArchive::Member
*Member
= Deb
.GotoMember("data.tar.gz");
33 ExtractTar
Tar(Deb
.GetFile(),Member
->Size
, "gzip");
35 if (Tar
.Go(Dir
) == false)
41 int main(int argc
, const char *argv
[])
44 std::cout
<< "One parameter expected - given " << argc
<< std::endl
;