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