From 144353a9ef433d4ef6c1eda06097ed572de177da Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 31 Jan 2012 17:50:58 +0100 Subject: Fix IndexCopy::CopyPackages and TranslationsCopy::CopyTranslations to handle compressed files again (LP: #924182, closes: #658096) --- apt-pkg/indexcopy.cc | 4 ++-- debian/changelog | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/apt-pkg/indexcopy.cc b/apt-pkg/indexcopy.cc index 3747e3570..e29e2819c 100644 --- a/apt-pkg/indexcopy.cc +++ b/apt-pkg/indexcopy.cc @@ -85,7 +85,7 @@ bool IndexCopy::CopyPackages(string CDROM,string Name,vector &List, string OrigPath = string(*I,CDROM.length()); // Open the package file - FileFd Pkg(*I + GetFileName(), FileFd::ReadOnly, FileFd::Extension); + FileFd Pkg(*I + GetFileName(), FileFd::ReadOnly, FileFd::Auto); off_t const FileSize = Pkg.Size(); pkgTagFile Parser(&Pkg); @@ -797,7 +797,7 @@ bool TranslationsCopy::CopyTranslations(string CDROM,string Name, /*{{{*/ string OrigPath = string(*I,CDROM.length()); // Open the package file - FileFd Pkg(*I, FileFd::ReadOnly, FileFd::Extension); + FileFd Pkg(*I, FileFd::ReadOnly, FileFd::Auto); off_t const FileSize = Pkg.Size(); pkgTagFile Parser(&Pkg); diff --git a/debian/changelog b/debian/changelog index 122c2ce36..361c38ad1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -27,6 +27,8 @@ apt (0.8.16~exp13) UNRELEASED; urgency=low of them in a single iteration (Closes: #657695, LP: #922485) - use a signed int instead of short for score calculation as upgrades become so big now that it can overflow (Closes: #657732, LP: #917173) + * Fix IndexCopy::CopyPackages and TranslationsCopy::CopyTranslations to + handle compressed files again (LP: #924182, closes: #658096) [ Michael Vogt ] * apt-pkg/deb/dpkgpm.cc: -- cgit v1.2.3 From bce778a312f88011a891e079b0a0f6d58f663479 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Fri, 3 Feb 2012 13:10:34 +0100 Subject: rework previous patch to avoid changing the inline code --- apt-pkg/contrib/fileutl.cc | 5 +++++ apt-pkg/contrib/fileutl.h | 5 +---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/apt-pkg/contrib/fileutl.cc b/apt-pkg/contrib/fileutl.cc index 28898fc34..529e7d655 100644 --- a/apt-pkg/contrib/fileutl.cc +++ b/apt-pkg/contrib/fileutl.cc @@ -890,6 +890,11 @@ bool FileFd::OpenDescriptor(int Fd, unsigned int const Mode, CompressMode Compre std::vector const compressors = APT::Configuration::getCompressors(); std::vector::const_iterator compressor = compressors.begin(); std::string name; + + // compat with the old API + if (Mode == ReadOnlyGzip && Compress == None) + Compress = Gzip; + switch (Compress) { case None: name = "."; break; diff --git a/apt-pkg/contrib/fileutl.h b/apt-pkg/contrib/fileutl.h index 8a5025142..3814cfe44 100644 --- a/apt-pkg/contrib/fileutl.h +++ b/apt-pkg/contrib/fileutl.h @@ -108,10 +108,7 @@ class FileFd bool OpenDescriptor(int Fd, unsigned int const Mode, CompressMode Compress, bool AutoClose=false); bool OpenDescriptor(int Fd, unsigned int const Mode, APT::Configuration::Compressor const &compressor, bool AutoClose=false); inline bool OpenDescriptor(int Fd, unsigned int const Mode, bool AutoClose=false) { - if (Mode == ReadOnlyGzip) - return OpenDescriptor(Fd, Mode, Gzip, AutoClose); - else - return OpenDescriptor(Fd, Mode, None, AutoClose); + return OpenDescriptor(Fd, Mode, None, AutoClose); }; bool Close(); bool Sync(); -- cgit v1.2.3