summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2016-07-05 15:05:56 +0200
committerDavid Kalnischkies <david@kalnischkies.de>2016-07-05 20:44:45 +0200
commitcc9745a0d81a3e1aa5ef6f99f7ad638d26bdb950 (patch)
tree377615ca6d4adfb778d65cc7481fafecf607c0c8 /apt-pkg/contrib
parent29b8e6b939bb7fcf0b2959545d8c822995c84118 (diff)
give a descriptive error for pipe tries with 'false'
If libapt has builtin support for a compression type it will create a dummy compressor struct with the Binary set to 'false' as it will catch these before using the generic pipe implementation which uses the Binary. The catching happens based on configured Names through, so you can actually force apt to use the external binaries even if it would usually use the builtin support. That logic fails through if you don't happen to have these external binaries installed as it will fallback to calling 'false', which will end in confusing 'Write error's. So, this is again something you only encounter in constructed testing. Gbp-Dch: Ignore
Diffstat (limited to 'apt-pkg/contrib')
-rw-r--r--apt-pkg/contrib/fileutl.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/apt-pkg/contrib/fileutl.cc b/apt-pkg/contrib/fileutl.cc
index 388849144..c623f1a2a 100644
--- a/apt-pkg/contrib/fileutl.cc
+++ b/apt-pkg/contrib/fileutl.cc
@@ -1882,6 +1882,9 @@ public:
if ((Mode & FileFd::ReadWrite) == FileFd::ReadWrite)
return filefd->FileFdError("ReadWrite mode is not supported for file %s", filefd->FileName.c_str());
+ if (compressor.Binary == "false")
+ return filefd->FileFdError("libapt has inbuilt support for the %s compression,"
+ " but was forced to ignore it in favor of an external binary – which isn't installed.", compressor.Name.c_str());
bool const Comp = (Mode & FileFd::WriteOnly) == FileFd::WriteOnly;
if (Comp == false)