summaryrefslogtreecommitdiff
path: root/ftparchive
diff options
context:
space:
mode:
Diffstat (limited to 'ftparchive')
-rw-r--r--ftparchive/apt-ftparchive.cc2
-rw-r--r--ftparchive/contents.cc11
-rw-r--r--ftparchive/multicompress.cc8
-rw-r--r--ftparchive/multicompress.h6
-rw-r--r--ftparchive/writer.cc2
-rw-r--r--ftparchive/writer.h2
6 files changed, 19 insertions, 12 deletions
diff --git a/ftparchive/apt-ftparchive.cc b/ftparchive/apt-ftparchive.cc
index 64aa58f4c..62a5e7cc9 100644
--- a/ftparchive/apt-ftparchive.cc
+++ b/ftparchive/apt-ftparchive.cc
@@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: apt-ftparchive.cc,v 1.12 2004/01/02 21:48:13 mdz Exp $
+// $Id: apt-ftparchive.cc,v 1.8.2.3 2004/01/02 22:01:48 mdz Exp $
/* ######################################################################
apt-scanpackages - Efficient work-alike for dpkg-scanpackages
diff --git a/ftparchive/contents.cc b/ftparchive/contents.cc
index 4f2b1d163..e11c16ca2 100644
--- a/ftparchive/contents.cc
+++ b/ftparchive/contents.cc
@@ -308,11 +308,18 @@ bool ContentsExtract::Read(debDebFile &Deb)
// Get the archive member and positition the file
const ARArchive::Member *Member = Deb.GotoMember("data.tar.gz");
- if (Member == 0)
+ const char *Compressor = "gzip";
+ if (Member == 0) {
+ Member = Deb.GotoMember("data.tar.bz2");
+ Compressor = "bzip2";
+ }
+ if (Member == 0) {
+ _error->Error(_("Internal Error, could not locate member %s"),"data.tar.gz");
return false;
+ }
// Extract it.
- ExtractTar Tar(Deb.GetFile(),Member->Size);
+ ExtractTar Tar(Deb.GetFile(),Member->Size,Compressor);
if (Tar.Go(*this) == false)
return false;
return true;
diff --git a/ftparchive/multicompress.cc b/ftparchive/multicompress.cc
index fabd460f8..5073e98ac 100644
--- a/ftparchive/multicompress.cc
+++ b/ftparchive/multicompress.cc
@@ -271,7 +271,7 @@ bool MultiCompress::Finalize(unsigned long &OutSize)
/* This opens the compressor, either in compress mode or decompress
mode. FileFd is always the compressor input/output file,
OutFd is the created pipe, Input for Compress, Output for Decompress. */
-bool MultiCompress::OpenCompress(const CompType *Prog,int &Pid,int FileFd,
+bool MultiCompress::OpenCompress(const CompType *Prog,pid_t &Pid,int FileFd,
int &OutFd,bool Comp)
{
Pid = -1;
@@ -334,7 +334,7 @@ bool MultiCompress::OpenCompress(const CompType *Prog,int &Pid,int FileFd,
// MultiCompress::OpenOld - Open an old file /*{{{*/
// ---------------------------------------------------------------------
/* This opens one of the original output files, possibly decompressing it. */
-bool MultiCompress::OpenOld(int &Fd,int &Proc)
+bool MultiCompress::OpenOld(int &Fd,pid_t &Proc)
{
Files *Best = Outputs;
for (Files *I = Outputs; I != 0; I = I->Next)
@@ -356,7 +356,7 @@ bool MultiCompress::OpenOld(int &Fd,int &Proc)
// MultiCompress::CloseOld - Close the old file /*{{{*/
// ---------------------------------------------------------------------
/* */
-bool MultiCompress::CloseOld(int Fd,int Proc)
+bool MultiCompress::CloseOld(int Fd,pid_t Proc)
{
close(Fd);
if (Proc != -1)
@@ -439,7 +439,7 @@ bool MultiCompress::Child(int FD)
while (Missing == false)
{
int CompFd = -1;
- int Proc = -1;
+ pid_t Proc = -1;
if (OpenOld(CompFd,Proc) == false)
{
_error->Discard();
diff --git a/ftparchive/multicompress.h b/ftparchive/multicompress.h
index 212dec63d..444d8626f 100644
--- a/ftparchive/multicompress.h
+++ b/ftparchive/multicompress.h
@@ -55,7 +55,7 @@ class MultiCompress
mode_t Permissions;
static const CompType Compressors[];
- bool OpenCompress(const CompType *Prog,int &Pid,int FileFd,
+ bool OpenCompress(const CompType *Prog,pid_t &Pid,int FileFd,
int &OutFd,bool Comp);
bool Child(int Fd);
bool Start();
@@ -68,8 +68,8 @@ class MultiCompress
unsigned long UpdateMTime;
bool Finalize(unsigned long &OutSize);
- bool OpenOld(int &Fd,int &Proc);
- bool CloseOld(int Fd,int Proc);
+ bool OpenOld(int &Fd,pid_t &Proc);
+ bool CloseOld(int Fd,pid_t Proc);
static bool GetStat(string Output,string Compress,struct stat &St);
MultiCompress(string Output,string Compress,mode_t Permissions,
diff --git a/ftparchive/writer.cc b/ftparchive/writer.cc
index e1fd33ad3..35a23a3d7 100644
--- a/ftparchive/writer.cc
+++ b/ftparchive/writer.cc
@@ -754,7 +754,7 @@ bool ContentsWriter::ReadFromPkgs(string PkgFile,string PkgCompress)
// Open the package file
int CompFd = -1;
- int Proc = -1;
+ pid_t Proc = -1;
if (Pkgs.OpenOld(CompFd,Proc) == false)
return false;
diff --git a/ftparchive/writer.h b/ftparchive/writer.h
index 6c47fb933..ce4c947a9 100644
--- a/ftparchive/writer.h
+++ b/ftparchive/writer.h
@@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: writer.h,v 1.7 2003/12/26 22:55:13 mdz Exp $
+// $Id: writer.h,v 1.4.2.2 2003/12/26 22:55:43 mdz Exp $
/* ######################################################################
Writer