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