diff options
-rw-r--r-- | apt-inst/deb/debfile.cc | 17 | ||||
-rw-r--r-- | apt-inst/deb/debfile.h | 1 |
2 files changed, 13 insertions, 5 deletions
diff --git a/apt-inst/deb/debfile.cc b/apt-inst/deb/debfile.cc index 79434d8b5..15db1a7fc 100644 --- a/apt-inst/deb/debfile.cc +++ b/apt-inst/deb/debfile.cc @@ -88,21 +88,20 @@ const ARArchive::Member *debDebFile::GotoMember(const char *Name) return Member; } /*}}}*/ -// DebFile::ExtractArchive - Extract the archive data itself /*{{{*/ +// DebFile::ExtractTarMember - Extract the contents of a tar member /*{{{*/ // --------------------------------------------------------------------- /* Simple wrapper around tar.. */ -bool debDebFile::ExtractArchive(pkgDirStream &Stream) +bool debDebFile::ExtractTarMember(pkgDirStream &Stream,const char *Name) { // Get the archive member const ARArchive::Member *Member = NULL; std::string Compressor; - std::string const data = "data.tar"; std::vector<APT::Configuration::Compressor> compressor = APT::Configuration::getCompressors(); for (std::vector<APT::Configuration::Compressor>::const_iterator c = compressor.begin(); c != compressor.end(); ++c) { - Member = AR.FindMember(std::string(data).append(c->Extension).c_str()); + Member = AR.FindMember(std::string(Name).append(c->Extension).c_str()); if (Member == NULL) continue; Compressor = c->Binary; @@ -111,7 +110,7 @@ bool debDebFile::ExtractArchive(pkgDirStream &Stream) if (Member == NULL) { - std::string ext = "data.tar.{"; + std::string ext = std::string(Name) + ".{"; for (std::vector<APT::Configuration::Compressor>::const_iterator c = compressor.begin(); c != compressor.end(); ++c) ext.append(c->Extension.substr(1)); @@ -129,6 +128,14 @@ bool debDebFile::ExtractArchive(pkgDirStream &Stream) return Tar.Go(Stream); } /*}}}*/ +// DebFile::ExtractArchive - Extract the archive data itself /*{{{*/ +// --------------------------------------------------------------------- +/* Simple wrapper around DebFile::ExtractTarMember. */ +bool debDebFile::ExtractArchive(pkgDirStream &Stream) +{ + return ExtractTarMember(Stream, "data.tar"); +} + /*}}}*/ // DebFile::ControlExtract::DoItem - Control Tar Extraction /*{{{*/ // --------------------------------------------------------------------- diff --git a/apt-inst/deb/debfile.h b/apt-inst/deb/debfile.h index 38211fb0f..ecef71d21 100644 --- a/apt-inst/deb/debfile.h +++ b/apt-inst/deb/debfile.h @@ -48,6 +48,7 @@ class debDebFile class ControlExtract; class MemControlExtract; + bool ExtractTarMember(pkgDirStream &Stream, const char *Name); bool ExtractArchive(pkgDirStream &Stream); const ARArchive::Member *GotoMember(const char *Name); inline FileFd &GetFile() {return File;}; |