summaryrefslogtreecommitdiff
path: root/apt-inst/contrib
diff options
context:
space:
mode:
Diffstat (limited to 'apt-inst/contrib')
-rw-r--r--apt-inst/contrib/arfile.cc2
-rw-r--r--apt-inst/contrib/extracttar.cc14
-rw-r--r--apt-inst/contrib/extracttar.h3
3 files changed, 11 insertions, 8 deletions
diff --git a/apt-inst/contrib/arfile.cc b/apt-inst/contrib/arfile.cc
index eb708271e..54d90bf3a 100644
--- a/apt-inst/contrib/arfile.cc
+++ b/apt-inst/contrib/arfile.cc
@@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: arfile.cc,v 1.7 2004/01/07 20:39:37 mdz Exp $
+// $Id: arfile.cc,v 1.6.2.1 2004/01/16 18:58:50 mdz Exp $
/* ######################################################################
AR File - Handle an 'AR' archive
diff --git a/apt-inst/contrib/extracttar.cc b/apt-inst/contrib/extracttar.cc
index 63bb2ba80..4c29757ab 100644
--- a/apt-inst/contrib/extracttar.cc
+++ b/apt-inst/contrib/extracttar.cc
@@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: extracttar.cc,v 1.9 2004/01/07 20:39:37 mdz Exp $
+// $Id: extracttar.cc,v 1.8.2.1 2004/01/16 18:58:50 mdz Exp $
/* ######################################################################
Extract a Tar - Tar Extractor
@@ -58,8 +58,8 @@ struct ExtractTar::TarHeader
// ExtractTar::ExtractTar - Constructor /*{{{*/
// ---------------------------------------------------------------------
/* */
-ExtractTar::ExtractTar(FileFd &Fd,unsigned long Max) : File(Fd),
- MaxInSize(Max)
+ExtractTar::ExtractTar(FileFd &Fd,unsigned long Max,string DecompressionProgram) : File(Fd),
+ MaxInSize(Max), DecompressProg(DecompressionProgram)
{
GZPid = -1;
@@ -93,7 +93,8 @@ bool ExtractTar::Done(bool Force)
// Make sure we clean it up!
kill(GZPid,SIGINT);
- if (ExecWait(GZPid,_config->Find("dir::bin::gzip","/bin/gzip").c_str(),
+ string confvar = string("dir::bin::") + DecompressProg;
+ if (ExecWait(GZPid,_config->Find(confvar.c_str(),DecompressProg.c_str()).c_str(),
Force) == false)
{
GZPid = -1;
@@ -134,10 +135,11 @@ bool ExtractTar::StartGzip()
SetCloseExec(STDERR_FILENO,false);
const char *Args[3];
- Args[0] = _config->Find("dir::bin::gzip","/bin/gzip").c_str();
+ string confvar = string("dir::bin::") + DecompressProg;
+ Args[0] = _config->Find(confvar.c_str(),DecompressProg.c_str()).c_str();
Args[1] = "-d";
Args[2] = 0;
- execv(Args[0],(char **)Args);
+ execvp(Args[0],(char **)Args);
cerr << _("Failed to exec gzip ") << Args[0] << endl;
_exit(100);
}
diff --git a/apt-inst/contrib/extracttar.h b/apt-inst/contrib/extracttar.h
index aaca987f2..ec930ca22 100644
--- a/apt-inst/contrib/extracttar.h
+++ b/apt-inst/contrib/extracttar.h
@@ -38,6 +38,7 @@ class ExtractTar
int GZPid;
FileFd InFd;
bool Eof;
+ string DecompressProg;
// Fork and reap gzip
bool StartGzip();
@@ -47,7 +48,7 @@ class ExtractTar
bool Go(pkgDirStream &Stream);
- ExtractTar(FileFd &Fd,unsigned long Max);
+ ExtractTar(FileFd &Fd,unsigned long Max,string DecompressionProgram);
virtual ~ExtractTar();
};