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