diff options
author | Guillem Jover <guillem@debian.org> | 2014-02-16 23:30:48 +0100 |
---|---|---|
committer | Michael Vogt <mvo@debian.org> | 2014-02-22 20:06:59 +0100 |
commit | e7f56293f029505f59670be2bad244f6d9912369 (patch) | |
tree | bc54d05e0854421e696906362b6114dc08be78f7 /cmdline | |
parent | 50b942e9a228337a2ca20931036c7cfd8cdba90d (diff) |
Add support for data.tar, control.tar and control.tar.xz
Sync the deb(5) format support with latest dpkg, by allowing
uncompressed tar members and xz compressed control.tar. This
also refactors the control.tar member extraction by using
ExtractTarMember(), which also means future changes only need
to be implemented in a single place.
Diffstat (limited to 'cmdline')
-rw-r--r-- | cmdline/apt-extracttemplates.cc | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/cmdline/apt-extracttemplates.cc b/cmdline/apt-extracttemplates.cc index 8e1937113..2408a7d9d 100644 --- a/cmdline/apt-extracttemplates.cc +++ b/cmdline/apt-extracttemplates.cc @@ -24,8 +24,7 @@ #include <apt-pkg/pkgcachegen.h> #include <apt-pkg/version.h> #include <apt-pkg/tagfile.h> -#include <apt-pkg/extracttar.h> -#include <apt-pkg/arfile.h> +#include <apt-pkg/debfile.h> #include <apt-pkg/deblistparser.h> #include <apt-pkg/error.h> #include <apt-pkg/strutl.h> @@ -91,18 +90,9 @@ string DebFile::GetInstalledVer(const string &package) /* */ bool DebFile::Go() { - ARArchive AR(File); - if (_error->PendingError() == true) - return false; - - const ARArchive::Member *Member = AR.FindMember("control.tar.gz"); - if (Member == 0) - return _error->Error(_("%s not a valid DEB package."),File.Name().c_str()); - - if (File.Seek(Member->Start) == false) - return false; - ExtractTar Tar(File, Member->Size,"gzip"); - return Tar.Go(*this); + debDebFile Deb(File); + + return Deb.ExtractTarMember(*this, "control.tar"); } /*}}}*/ // DebFile::DoItem examine element in package and mark /*{{{*/ |