summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2012-02-03 13:10:34 +0100
committerMichael Vogt <michael.vogt@ubuntu.com>2012-02-03 13:10:34 +0100
commitbce778a312f88011a891e079b0a0f6d58f663479 (patch)
tree56cab3a4d7184dad31fc8269f5d92d304c0f41fe /apt-pkg/contrib
parentf2ea4c45421bfe73e70b8210e327bea5018811a7 (diff)
rework previous patch to avoid changing the inline code
Diffstat (limited to 'apt-pkg/contrib')
-rw-r--r--apt-pkg/contrib/fileutl.cc5
-rw-r--r--apt-pkg/contrib/fileutl.h5
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<APT::Configuration::Compressor> const compressors = APT::Configuration::getCompressors();
std::vector<APT::Configuration::Compressor>::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();