From d0ef571416e1ff6266c89e6285898d269768cf8f Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 1 Aug 2016 17:52:55 +0200 Subject: suggest transport-packages based on established namescheme apt-transports not shipped in apt directly are usually named apt-transport-% with % being what is in the name of the transport. tor additional introduced aliases via %+something, which isn't a bad idea, so be strip the +something part from the method name before suggesting the installation of an apt-transport-% package. This avoids us the maintainance of a list of existing transports creating a two class system of known and unknown transports which would be quite arbitrary and is unfriendly to backports. --- apt-pkg/acquire-worker.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/apt-pkg/acquire-worker.cc b/apt-pkg/acquire-worker.cc index 9ed7b5b28..39cc55bdf 100644 --- a/apt-pkg/acquire-worker.cc +++ b/apt-pkg/acquire-worker.cc @@ -97,8 +97,10 @@ bool pkgAcquire::Worker::Start() if (FileExists(Method) == false) { _error->Error(_("The method driver %s could not be found."),Method.c_str()); - if (Access == "https") - _error->Notice(_("Is the package %s installed?"), "apt-transport-https"); + std::string const A(Access.cbegin(), std::find(Access.cbegin(), Access.cend(), '+')); + std::string pkg; + strprintf(pkg, "apt-transport-%s", A.c_str()); + _error->Notice(_("Is the package %s installed?"), pkg.c_str()); return false; } -- cgit v1.2.3