]>
git.saurik.com Git - apt.git/blob - test/extract-control.cc
1 #include <apt-pkg/debfile.h>
2 #include <apt-pkg/error.h>
9 bool ExtractMember(const char *File
,const char *Member
)
11 FileFd
Fd(File
,FileFd::ReadOnly
);
13 if(_error
->PendingError() == true)
16 debDebFile::MemControlExtract
Extract(Member
);
17 if (Extract
.Read(Deb
) == false)
20 if (Extract
.Control
== 0)
23 write(STDOUT_FILENO
,Extract
.Control
,Extract
.Length
);
27 int main(int argc
, const char *argv
[])
31 cerr
<< "Need two arguments, a .deb and the control member" << endl
;
35 if (ExtractMember(argv
[1],argv
[2]) == false)