ソースを参照

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.
David Kalnischkies 10 年 前
コミット
d0ef571416
共有1 個のファイルを変更した4 個の追加2 個の削除を含む
  1. 4 2
      apt-pkg/acquire-worker.cc

+ 4 - 2
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;
    }