diff options
author | Matt Zimmerman <matt.zimmerman@canonical.com> | 2004-12-12 17:51:33 +0000 |
---|---|---|
committer | Matt Zimmerman <matt.zimmerman@canonical.com> | 2004-12-12 17:51:33 +0000 |
commit | b21c043804b1be7f4d79ac3f5a6615dc96f26a42 (patch) | |
tree | 6c00f8b2637fe3f2fff706a8af7d34105a45c7a0 /apt-inst/contrib/extracttar.cc | |
parent | ef86e052e562d84c87fc2280887cb95cc9676b8f (diff) |
Merge bzip2-debs branch
Patches applied:
* apt@packages.debian.org/apt--bzip2-debs--0--base-0
tag of apt@packages.debian.org/apt--main--0--patch-30
* apt@packages.debian.org/apt--bzip2-debs--0--patch-1
Create baz branch
* apt@packages.debian.org/apt--bzip2-debs--0--patch-2
Implement data.tar.bz2 support
Diffstat (limited to 'apt-inst/contrib/extracttar.cc')
-rw-r--r-- | apt-inst/contrib/extracttar.cc | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/apt-inst/contrib/extracttar.cc b/apt-inst/contrib/extracttar.cc index 63bb2ba80..b719d5b81 100644 --- a/apt-inst/contrib/extracttar.cc +++ b/apt-inst/contrib/extracttar.cc @@ -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); } |