From f73593a4034d9eec0ec4466b8e173d4a4daece1f Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 26 Dec 2024 19:41:53 +0000 Subject: Drop usage of macro APT_OVERRIDE for simple override We were rather inconsistent in using it and as our public headers contain deduction guides (a c++17 feature) it seems silly to try to hide a c++11 feature in a macro, so lets stop this charade and drop the macro and while we are changing all these lines lets apply [[nodiscard]] (another c++17 feature) and other suggestions from clang-tidy and formatting for a little more consistency. --- methods/aptmethod.h | 4 ++-- methods/basehttp.h | 4 ++-- methods/cdrom.cc | 6 +++--- methods/connect.cc | 8 ++++---- methods/copy.cc | 2 +- methods/file.cc | 2 +- methods/gpgv.cc | 2 +- methods/http.cc | 10 +++++----- methods/http.h | 38 +++++++++++++++++++------------------- methods/mirror.cc | 10 +++++----- methods/rred.cc | 2 +- methods/sqv.cc | 2 +- methods/store.cc | 2 +- 13 files changed, 46 insertions(+), 46 deletions(-) (limited to 'methods') diff --git a/methods/aptmethod.h b/methods/aptmethod.h index 1ea173075..f564499f0 100644 --- a/methods/aptmethod.h +++ b/methods/aptmethod.h @@ -120,7 +120,7 @@ protected: }; public: - virtual bool Configuration(std::string Message) APT_OVERRIDE + bool Configuration(std::string Message) override { if (pkgAcqMethod::Configuration(Message) == false) return false; @@ -540,7 +540,7 @@ class aptAuthConfMethod : public aptMethod std::vector> authconfs; public: - virtual bool Configuration(std::string Message) APT_OVERRIDE + bool Configuration(std::string Message) override { if (pkgAcqMethod::Configuration(Message) == false) return false; diff --git a/methods/basehttp.h b/methods/basehttp.h index c077ea384..ee4a84d3d 100644 --- a/methods/basehttp.h +++ b/methods/basehttp.h @@ -126,7 +126,7 @@ struct ServerState class BaseHttpMethod : public aptAuthConfMethod { protected: - virtual bool Fetch(FetchItem *) APT_OVERRIDE; + bool Fetch(FetchItem *) override; std::unique_ptr Server; std::string NextURI; @@ -170,7 +170,7 @@ class BaseHttpMethod : public aptAuthConfMethod virtual void SendReq(FetchItem *Itm) = 0; virtual std::unique_ptr CreateServerState(URI const &uri) = 0; virtual void RotateDNS() = 0; - virtual bool Configuration(std::string Message) APT_OVERRIDE; + bool Configuration(std::string Message) override; bool AddProxyAuth(URI &Proxy, URI const &Server); diff --git a/methods/cdrom.cc b/methods/cdrom.cc index f534a06f5..88a10c0f0 100644 --- a/methods/cdrom.cc +++ b/methods/cdrom.cc @@ -42,10 +42,10 @@ class CDROMMethod : public aptMethod bool IsCorrectCD(URI want, string MountPath, string& NewID); bool AutoDetectAndMount(const URI, string &NewID); - virtual bool Fetch(FetchItem *Itm) APT_OVERRIDE; + bool Fetch(FetchItem *Itm) override; std::string GetID(std::string const &Name); - virtual void Exit() APT_OVERRIDE; - virtual bool Configuration(std::string Message) APT_OVERRIDE; + void Exit() override; + bool Configuration(std::string Message) override; public: diff --git a/methods/connect.cc b/methods/connect.cc index b00e73eb7..ff2e39260 100644 --- a/methods/connect.cc +++ b/methods/connect.cc @@ -89,10 +89,10 @@ static bool ConnectionAllowed(char const * const Service, std::string const &Hos struct FdFd final : public MethodFd { int fd = -1; - int Fd() APT_OVERRIDE { return fd; } - ssize_t Read(void *buf, size_t count) APT_OVERRIDE { return ::read(fd, buf, count); } - ssize_t Write(void *buf, size_t count) APT_OVERRIDE { return ::write(fd, buf, count); } - int Close() APT_OVERRIDE + int Fd() override { return fd; } + ssize_t Read(void *buf, size_t count) override { return ::read(fd, buf, count); } + ssize_t Write(void *buf, size_t count) override { return ::write(fd, buf, count); } + int Close() override { int result = 0; if (fd != -1) diff --git a/methods/copy.cc b/methods/copy.cc index 9c9c6572d..e3f2a29a2 100644 --- a/methods/copy.cc +++ b/methods/copy.cc @@ -26,7 +26,7 @@ class CopyMethod final : public aptMethod { - bool URIAcquire(std::string const &Message, FetchItem *Itm) APT_OVERRIDE; + bool URIAcquire(std::string const &Message, FetchItem *Itm) override; public: CopyMethod() : aptMethod("copy", "1.0", SingleInstance | SendConfig | SendURIEncoded) diff --git a/methods/file.cc b/methods/file.cc index 111440ce1..2a17336fc 100644 --- a/methods/file.cc +++ b/methods/file.cc @@ -29,7 +29,7 @@ class FileMethod final : public aptMethod { - bool URIAcquire(std::string const &Message, FetchItem *Itm) APT_OVERRIDE; + bool URIAcquire(std::string const &Message, FetchItem *Itm) override; public: FileMethod() : aptMethod("file", "1.0", SingleInstance | SendConfig | LocalOnly | SendURIEncoded) diff --git a/methods/gpgv.cc b/methods/gpgv.cc index e5554b1e2..736cfbde2 100644 --- a/methods/gpgv.cc +++ b/methods/gpgv.cc @@ -130,7 +130,7 @@ class GPGVMethod : public aptMethod SignersStorage &Signers); protected: - virtual bool URIAcquire(std::string const &Message, FetchItem *Itm) APT_OVERRIDE; + bool URIAcquire(std::string const &Message, FetchItem *Itm) override; public: GPGVMethod() : aptMethod("gpgv", "1.1", SingleInstance | SendConfig | SendURIEncoded){}; }; diff --git a/methods/http.cc b/methods/http.cc index 3574bcad5..f2514eb9d 100644 --- a/methods/http.cc +++ b/methods/http.cc @@ -284,9 +284,9 @@ struct HttpConnectFd final : public MethodFd std::unique_ptr UnderlyingFd; std::string Buffer; - int Fd() APT_OVERRIDE { return UnderlyingFd->Fd(); } + int Fd() override { return UnderlyingFd->Fd(); } - ssize_t Read(void *buf, size_t count) APT_OVERRIDE + ssize_t Read(void *buf, size_t count) override { if (!Buffer.empty()) { @@ -299,17 +299,17 @@ struct HttpConnectFd final : public MethodFd return UnderlyingFd->Read(buf, count); } - ssize_t Write(void *buf, size_t count) APT_OVERRIDE + ssize_t Write(void *buf, size_t count) override { return UnderlyingFd->Write(buf, count); } - int Close() APT_OVERRIDE + int Close() override { return UnderlyingFd->Close(); } - bool HasPending() APT_OVERRIDE + bool HasPending() override { return !Buffer.empty(); } diff --git a/methods/http.h b/methods/http.h index 5bfcbc8a2..5d6a8aad1 100644 --- a/methods/http.h +++ b/methods/http.h @@ -98,37 +98,37 @@ struct HttpServerState final : public ServerState std::unique_ptr ServerFd; protected: - virtual bool ReadHeaderLines(std::string &Data) APT_OVERRIDE; - virtual ResultState LoadNextResponse(bool const ToFile, RequestState &Req) APT_OVERRIDE; - virtual bool WriteResponse(std::string const &Data) APT_OVERRIDE; + bool ReadHeaderLines(std::string &Data) override; + ResultState LoadNextResponse(bool ToFile, RequestState &Req) override; + bool WriteResponse(std::string const &Data) override; public: - virtual void Reset() APT_OVERRIDE; + void Reset() override; - virtual ResultState RunData(RequestState &Req) APT_OVERRIDE; - virtual ResultState RunDataToDevNull(RequestState &Req) APT_OVERRIDE; + ResultState RunData(RequestState &Req) override; + ResultState RunDataToDevNull(RequestState &Req) override; - virtual ResultState Open() APT_OVERRIDE; - virtual bool IsOpen() APT_OVERRIDE; - virtual bool Close() APT_OVERRIDE; - virtual bool InitHashes(HashStringList const &ExpectedHashes) APT_OVERRIDE; - virtual Hashes * GetHashes() APT_OVERRIDE; - virtual ResultState Die(RequestState &Req) APT_OVERRIDE; - virtual bool Flush(FileFd *const File, bool MustComplete = true) APT_OVERRIDE; - virtual ResultState Go(bool ToFile, RequestState &Req) APT_OVERRIDE; + ResultState Open() override; + bool IsOpen() override; + bool Close() override; + bool InitHashes(HashStringList const &ExpectedHashes) override; + Hashes * GetHashes() override; + ResultState Die(RequestState &Req) override; + bool Flush(FileFd *File, bool MustComplete = true) override; + ResultState Go(bool ToFile, RequestState &Req) override; HttpServerState(URI Srv, HttpMethod *Owner); - virtual ~HttpServerState() {Close();}; + ~HttpServerState() override {Close();}; }; class HttpMethod final : public BaseHttpMethod { public: - virtual void SendReq(FetchItem *Itm) APT_OVERRIDE; + void SendReq(FetchItem *Itm) override; - virtual std::unique_ptr CreateServerState(URI const &uri) APT_OVERRIDE; - virtual void RotateDNS() APT_OVERRIDE; - virtual DealWithHeadersResult DealWithHeaders(FetchResult &Res, RequestState &Req) APT_OVERRIDE; + std::unique_ptr CreateServerState(URI const &uri) override; + void RotateDNS() override; + DealWithHeadersResult DealWithHeaders(FetchResult &Res, RequestState &Req) override; protected: std::string AutoDetectProxyCmd; diff --git a/methods/mirror.cc b/methods/mirror.cc index 5781ebcf0..dfdd550b7 100644 --- a/methods/mirror.cc +++ b/methods/mirror.cc @@ -89,12 +89,12 @@ class MirrorMethod : public aptMethod /*{{{*/ }; std::unordered_map mirrorfilestate; - virtual bool URIAcquire(std::string const &Message, FetchItem *Itm) APT_OVERRIDE; + bool URIAcquire(std::string const &Message, FetchItem *Itm) override; - void RedirectItem(MirrorListInfo const &info, FetchItem *const Itm, std::string const &Message); - bool MirrorListFileReceived(MirrorListInfo &info, FetchItem *const Itm); - std::string GetMirrorFileURI(std::string const &Message, FetchItem *const Itm); - void DealWithPendingItems(std::vector const &baseuris, MirrorListInfo const &info, FetchItem *const Itm, std::function handler); + void RedirectItem(MirrorListInfo const &info, FetchItem *Itm, std::string const &Message); + bool MirrorListFileReceived(MirrorListInfo &info, FetchItem *Itm); + std::string GetMirrorFileURI(std::string const &Message, FetchItem *Itm); + void DealWithPendingItems(std::vector const &baseuris, MirrorListInfo const &info, FetchItem *Itm, std::function handler); public: explicit MirrorMethod(std::string &&pProg) : aptMethod(std::move(pProg), "2.0", SingleInstance | Pipeline | SendConfig | AuxRequests | SendURIEncoded), genrng(clock()) diff --git a/methods/rred.cc b/methods/rred.cc index bef2e969e..836697a11 100644 --- a/methods/rred.cc +++ b/methods/rred.cc @@ -624,7 +624,7 @@ class RredMethod final : public aptMethod { } protected: - virtual bool URIAcquire(std::string const &Message, FetchItem *Itm) APT_OVERRIDE { + bool URIAcquire(std::string const &Message, FetchItem *Itm) override { Debug = DebugEnabled(); URI Get(Itm->Uri); std::string Path = DecodeSendURI(Get.Host + Get.Path); // rred:/path - no host diff --git a/methods/sqv.cc b/methods/sqv.cc index 716081f8e..45d001af1 100644 --- a/methods/sqv.cc +++ b/methods/sqv.cc @@ -21,7 +21,7 @@ class SQVMethod : public aptMethod vector &signers); protected: - virtual bool URIAcquire(std::string const &Message, FetchItem *Itm) APT_OVERRIDE; + bool URIAcquire(std::string const &Message, FetchItem *Itm) override; public: SQVMethod(); diff --git a/methods/store.cc b/methods/store.cc index ed2eb3fe1..bfd748e23 100644 --- a/methods/store.cc +++ b/methods/store.cc @@ -33,7 +33,7 @@ class StoreMethod final : public aptMethod { - virtual bool Fetch(FetchItem *Itm) APT_OVERRIDE; + bool Fetch(FetchItem *Itm) override; public: -- cgit v1.2.3-70-g09d2 From 1e2b5197ee350a36fbad006f198bbf8e9a5c8e53 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 26 Dec 2024 20:46:23 +0000 Subject: Drop the remaining usage of APT_ARRAY_SIZE That macro is not that useful as it might perhaps once was. Lets prepare dropping it now in favour of more standard ways of working with arrays now. --- apt-pkg/contrib/macros.h | 5 +---- apt-pkg/pkgcache.cc | 2 +- methods/gpgv.cc | 13 +++++-------- 3 files changed, 7 insertions(+), 13 deletions(-) (limited to 'methods') diff --git a/apt-pkg/contrib/macros.h b/apt-pkg/contrib/macros.h index e0c23b99b..807733927 100644 --- a/apt-pkg/contrib/macros.h +++ b/apt-pkg/contrib/macros.h @@ -17,10 +17,6 @@ #ifndef MACROS_H #define MACROS_H -/* Useful count macro, use on an array of things and it will return the - number of items in the array */ -#define APT_ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0])) - // Flag Macros #define FLAG(f) (1L << (f)) #define SETFLAG(v,f) ((v) |= FLAG(f)) @@ -141,6 +137,7 @@ AptScopeWrapper(F) -> AptScopeWrapper; #else #define APT_OVERRIDE /* no c++11 standard */ #endif +#define APT_ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0])) #endif #endif #endif diff --git a/apt-pkg/pkgcache.cc b/apt-pkg/pkgcache.cc index 57c6d2b22..1f5f12885 100644 --- a/apt-pkg/pkgcache.cc +++ b/apt-pkg/pkgcache.cc @@ -245,7 +245,7 @@ uint32_t pkgCache::CacheHash() XXH3_64bits_update(state, reinterpret_cast(PACKAGE_VERSION), - APT_ARRAY_SIZE(PACKAGE_VERSION)); + strlen(PACKAGE_VERSION)); XXH3_64bits_update(state, reinterpret_cast(&header), diff --git a/methods/gpgv.cc b/methods/gpgv.cc index 736cfbde2..8eda8d67f 100644 --- a/methods/gpgv.cc +++ b/methods/gpgv.cc @@ -68,7 +68,7 @@ struct Digest { } }; -static constexpr Digest Digests[] = { +static constexpr std::array Digests = {{ {Digest::State::Untrusted, "Invalid digest"}, {Digest::State::Untrusted, "MD5"}, {Digest::State::Untrusted, "SHA1"}, @@ -81,17 +81,14 @@ static constexpr Digest Digests[] = { {Digest::State::Trusted, "SHA384"}, {Digest::State::Trusted, "SHA512"}, {Digest::State::Trusted, "SHA224"}, -}; +}}; -static Digest FindDigest(std::string const & Digest) +static Digest FindDigest(std::string const &Digest) { int id = atoi(Digest.c_str()); - if (id >= 0 && static_cast(id) < APT_ARRAY_SIZE(Digests)) - { + if (id >= 0 && static_cast(id) < Digests.size()) return Digests[id]; - } else { - return Digests[0]; - } + return Digests[0]; } struct Signer { -- cgit v1.2.3-70-g09d2 From 9000543eb219f83b6b9592b681fc6811bc56e26f Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 26 Dec 2024 21:00:03 +0000 Subject: Drop APT_NORETURN usage [[noreturn]] is a C++11 feature and so we can just use it unconditionally. --- apt-pkg/contrib/gpgv.cc | 2 +- apt-pkg/contrib/gpgv.h | 10 +++++----- apt-pkg/contrib/macros.h | 7 +++++-- apt-pkg/deb/dpkgpm.cc | 2 +- cmdline/apt-internal-planner.cc | 2 +- cmdline/apt-internal-solver.cc | 2 +- methods/basehttp.h | 2 +- 7 files changed, 15 insertions(+), 12 deletions(-) (limited to 'methods') diff --git a/apt-pkg/contrib/gpgv.cc b/apt-pkg/contrib/gpgv.cc index 48d31a44c..59301fa0c 100644 --- a/apt-pkg/contrib/gpgv.cc +++ b/apt-pkg/contrib/gpgv.cc @@ -290,7 +290,7 @@ void ExecGPGV(std::string const &File, std::string const &FileGPG, bool const Debug = _config->FindB("Debug::Acquire::gpgv", false); struct exiter { std::vector files; - void operator ()(int code) APT_NORETURN { + [[noreturn]] void operator ()(int code) { std::for_each(files.begin(), files.end(), [](auto f) { unlink(f.c_str()); }); exit(code); diff --git a/apt-pkg/contrib/gpgv.h b/apt-pkg/contrib/gpgv.h index 0b84f6bb7..f4f0a2ac7 100644 --- a/apt-pkg/contrib/gpgv.h +++ b/apt-pkg/contrib/gpgv.h @@ -47,11 +47,11 @@ APT_PUBLIC std::pair> FindGPGV(bool * @param fd is used as a pipe for the standard output of gpgv * @param key is the specific one to be used instead of using all */ -APT_PUBLIC void ExecGPGV(std::string const &File, std::string const &FileSig, - int const &statusfd, int fd[2], std::vector const &KeyFiles) APT_NORETURN; -APT_PUBLIC void ExecGPGV(std::string const &File, std::string const &FileSig, - int const &statusfd, int fd[2], std::string const &Key = "") APT_NORETURN; -inline APT_NORETURN void ExecGPGV(std::string const &File, std::string const &FileSig, +[[noreturn]] APT_PUBLIC void ExecGPGV(std::string const &File, std::string const &FileSig, + int const &statusfd, int fd[2], std::vector const &KeyFiles); +[[noreturn]] APT_PUBLIC void ExecGPGV(std::string const &File, std::string const &FileSig, + int const &statusfd, int fd[2], std::string const &Key = ""); +[[noreturn]] inline void ExecGPGV(std::string const &File, std::string const &FileSig, int const &statusfd = -1) { int fd[2]; ExecGPGV(File, FileSig, statusfd, fd); diff --git a/apt-pkg/contrib/macros.h b/apt-pkg/contrib/macros.h index db4932969..c1fa73775 100644 --- a/apt-pkg/contrib/macros.h +++ b/apt-pkg/contrib/macros.h @@ -40,7 +40,6 @@ #define APT_DEPRECATED_MSG(X) __attribute__ ((deprecated(X))) // __attribute__((const)) is too dangerous for us, we end up using it wrongly #define APT_PURE __attribute__((pure)) - #define APT_NORETURN __attribute__((noreturn)) #define APT_PRINTF(n) __attribute__((format(printf, n, n + 1))) #define APT_WEAK __attribute__((weak)); #define APT_UNUSED __attribute__((unused)) @@ -48,7 +47,6 @@ #define APT_DEPRECATED #define APT_DEPRECATED_MSG #define APT_PURE - #define APT_NORETURN #define APT_PRINTF(n) #define APT_WEAK #define APT_UNUSED @@ -136,6 +134,11 @@ AptScopeWrapper(F) -> AptScopeWrapper; #define SETFLAG(v,f) ((v) |= FLAG(f)) #define CLRFLAG(v,f) ((v) &=~FLAG(f)) #define CHKFLAG(v,f) ((v) & FLAG(f) ? true : false) +#if APT_GCC_VERSION >= 0x0300 + #define APT_NORETURN __attribute__((noreturn)) +#else + #define APT_NORETURN +#endif #endif #endif #endif diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc index 8cadd2712..d176e85fc 100644 --- a/apt-pkg/deb/dpkgpm.cc +++ b/apt-pkg/deb/dpkgpm.cc @@ -1488,7 +1488,7 @@ public: auto begin() const { return args.cbegin(); } auto end() const { return args.cend(); } auto& front() const { return args.front(); } - APT_NORETURN void execute(char const *const errmsg) { + [[noreturn]] void execute(char const *const errmsg) { args.push_back(nullptr); execvp(args.front(), &args.front()); std::cerr << errmsg << std::endl; diff --git a/cmdline/apt-internal-planner.cc b/cmdline/apt-internal-planner.cc index abd2a7be9..b850ed628 100644 --- a/cmdline/apt-internal-planner.cc +++ b/cmdline/apt-internal-planner.cc @@ -51,7 +51,7 @@ static bool ShowHelp(CommandLine &) /*{{{*/ return true; } /*}}}*/ -APT_NORETURN static void DIE(std::string const &message) { /*{{{*/ +[[noreturn]] static void DIE(std::string const &message) { /*{{{*/ std::cerr << "ERROR: " << message << std::endl; _error->DumpErrors(std::cerr); exit(EXIT_FAILURE); diff --git a/cmdline/apt-internal-solver.cc b/cmdline/apt-internal-solver.cc index d596dcb5e..ceedd96c7 100644 --- a/cmdline/apt-internal-solver.cc +++ b/cmdline/apt-internal-solver.cc @@ -51,7 +51,7 @@ static bool ShowHelp(CommandLine &) /*{{{*/ return true; } /*}}}*/ -APT_NORETURN static void DIE(std::string const &message) { /*{{{*/ +[[noreturn]] static void DIE(std::string const &message) { /*{{{*/ std::cerr << "ERROR: " << message << std::endl; _error->DumpErrors(std::cerr); exit(EXIT_FAILURE); diff --git a/methods/basehttp.h b/methods/basehttp.h index ee4a84d3d..1d3ed1ace 100644 --- a/methods/basehttp.h +++ b/methods/basehttp.h @@ -163,7 +163,7 @@ class BaseHttpMethod : public aptAuthConfMethod static std::string FailFile; static int FailFd; static time_t FailTime; - static APT_NORETURN void SigTerm(int); + [[noreturn]] static void SigTerm(int); int Loop(); -- cgit v1.2.3-70-g09d2 From 25cd3ded69a79c2a7eb3d858e041f1509f5f5ed8 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 27 Dec 2024 02:16:56 +0000 Subject: Remove leftovers of the apt-key removal References: a00fbbdb28cc31e78882301c2efe7218583ab4cb --- .gitignore | 1 - README.md | 1 - apt-pkg/contrib/gpgv.cc | 2 -- apt-pkg/deb/debmetaindex.cc | 2 +- debian/control | 1 - doc/apt-verbatim.ent | 23 ----------------------- doc/apt.ent | 4 ---- doc/po/apt-doc.pot | 7 ------- doc/po/de.po | 12 +++++------- doc/po/es.po | 9 --------- doc/po/fr.po | 12 +++++------- doc/po/it.po | 16 +++++++--------- doc/po/ja.po | 16 +++++++--------- doc/po/nl.po | 16 +++++++--------- doc/po/pl.po | 16 +++++++--------- doc/po/pt.po | 16 +++++++--------- doc/po/pt_BR.po | 7 ------- methods/gpgv.cc | 8 ++++---- methods/sqv.cc | 2 +- prepare-release | 4 ---- vendor/README | 11 +++++------ vendor/blankon/apt-vendor.ent | 4 ---- vendor/debian/apt-vendor.ent | 4 ---- vendor/getinfo | 2 +- vendor/procursus/apt-vendor.ent | 4 ---- vendor/raspbian/apt-vendor.ent | 4 ---- vendor/steamos/apt-vendor.ent | 4 ---- vendor/ubuntu/apt-vendor.ent | 4 ---- 28 files changed, 57 insertions(+), 155 deletions(-) (limited to 'methods') diff --git a/.gitignore b/.gitignore index aeab4a372..e6f4ed2f4 100644 --- a/.gitignore +++ b/.gitignore @@ -44,7 +44,6 @@ docbook-text-style.xsl **/cmdline/apt-extracttemplates **/cmdline/apt-get **/cmdline/apt-helper -**/cmdline/apt-key **/cmdline/apt-mark **/cmdline/apt-sortpkgs **/cmdline/planners diff --git a/README.md b/README.md index b2a0fdb2b..58c349713 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,6 @@ Included tools are: as well as available packages * **apt-cdrom** to use removable media as a source for packages * **apt-config** as an interface to the configuration settings -* **apt-key** as an interface to manage authentication keys * **apt-extracttemplates** to be used by debconf to prompt for configuration questions before installation * **apt-ftparchive** creates Packages and other index files diff --git a/apt-pkg/contrib/gpgv.cc b/apt-pkg/contrib/gpgv.cc index 59301fa0c..237ddc856 100644 --- a/apt-pkg/contrib/gpgv.cc +++ b/apt-pkg/contrib/gpgv.cc @@ -111,8 +111,6 @@ static bool operator!=(LineBuffer const &buf, std::string_view const exp) noexce clear-signed files (=the complete content of the file is signed and the content isn't encoded) we do a divide and conquer approach here and split up the clear-signed file in message and signature for gpg. - And as a cherry on the cake, we use our apt-key wrapper to do part - of the lifting in regards to merging keyrings. Fun for the whole family. */ #define apt_error(...) apt_msg("ERROR", __VA_ARGS__) #define apt_warning(...) apt_msg("WARNING", __VA_ARGS__) diff --git a/apt-pkg/deb/debmetaindex.cc b/apt-pkg/deb/debmetaindex.cc index 191be05d6..c53b00881 100644 --- a/apt-pkg/deb/debmetaindex.cc +++ b/apt-pkg/deb/debmetaindex.cc @@ -75,7 +75,7 @@ static std::string NormalizeSignedBy(std::string SignedBy, bool const Introducer return os.str(); } - // we could go all fancy and allow short/long/string matches as gpgv/apt-key does, + // we could go all fancy and allow short/long/string matches as gpgv does, // but fingerprints are harder to fake than the others and this option is set once, // not interactively all the time so easy to type is not really a concern. std::transform(SignedBy.begin(), SignedBy.end(), SignedBy.begin(), [](char const c) { diff --git a/debian/control b/debian/control index 1022efa37..a51da4456 100644 --- a/debian/control +++ b/debian/control @@ -69,7 +69,6 @@ Description: commandline package manager as well as installable packages * apt-cdrom to use removable media as a source for packages * apt-config as an interface to the configuration settings - * apt-key as an interface to manage authentication keys Package: libapt-pkg6.0t64 Replaces: libapt-pkg6.0 diff --git a/doc/apt-verbatim.ent b/doc/apt-verbatim.ent index 67977ccc8..61db5888b 100644 --- a/doc/apt-verbatim.ent +++ b/doc/apt-verbatim.ent @@ -69,12 +69,6 @@ " > - - apt-key - 8 - " -> - apt-secure 8 @@ -424,23 +418,6 @@ &synopsis-help; "> -&synopsis-keyid;"> - - apt-key - - - add &synopsis-param-filename; - del &synopsis-param-keyid; - export &synopsis-param-keyid; - exportall - list - finger - adv - update - net-update - &synopsis-help; - -"> apt-mark diff --git a/doc/apt.ent b/doc/apt.ent index b502073a9..9034d2e66 100644 --- a/doc/apt.ent +++ b/doc/apt.ent @@ -258,7 +258,3 @@ or further configured by the configuration option an - - - - diff --git a/doc/po/apt-doc.pot b/doc/po/apt-doc.pot index dfed6c4d5..bb7a2180e 100644 --- a/doc/po/apt-doc.pot +++ b/doc/po/apt-doc.pot @@ -525,13 +525,6 @@ msgid "" "generate section --> " msgstr "" -#. type: Plain text -#: apt.ent -msgid "" -" " -msgstr "" - #. type: Content of: #: apt.8.xml apt-get.8.xml apt-cache.8.xml apt-mark.8.xml apt-secure.8.xml #: apt-cdrom.8.xml apt-config.8.xml diff --git a/doc/po/de.po b/doc/po/de.po index 71b7ead94..7268e5d8c 100644 --- a/doc/po/de.po +++ b/doc/po/de.po @@ -697,13 +697,6 @@ msgid "" "generate section --> " msgstr "" -#. type: Plain text -#: apt.ent -msgid "" -" " -msgstr "" - #. type: Content of: #: apt.8.xml apt-get.8.xml apt-cache.8.xml apt-mark.8.xml apt-secure.8.xml #: apt-cdrom.8.xml apt-config.8.xml @@ -14080,6 +14073,11 @@ msgstr "" "fortfahren, wodurch die bereits auf der Platte heruntergeladenen Archive " "benutzt werden." +#~ msgid "" +#~ " " +#~ msgstr "" + #, fuzzy #~| msgid "APT key management utility" #~ msgid "Deprecated APT key management utility" diff --git a/doc/po/es.po b/doc/po/es.po index 0eb8a0cbe..bf6f153f3 100644 --- a/doc/po/es.po +++ b/doc/po/es.po @@ -777,15 +777,6 @@ msgstr "" " " -#. type: Plain text -#: apt.ent -msgid "" -" " -msgstr "" -" " - #. type: Content of: #: apt.8.xml apt-get.8.xml apt-cache.8.xml apt-mark.8.xml apt-secure.8.xml #: apt-cdrom.8.xml apt-config.8.xml diff --git a/doc/po/fr.po b/doc/po/fr.po index b020c08be..df70ce2b8 100644 --- a/doc/po/fr.po +++ b/doc/po/fr.po @@ -692,13 +692,6 @@ msgid "" "generate section --> " msgstr "" -#. type: Plain text -#: apt.ent -msgid "" -" " -msgstr "" - #. type: Content of: #: apt.8.xml apt-get.8.xml apt-cache.8.xml apt-mark.8.xml apt-secure.8.xml #: apt-cdrom.8.xml apt-config.8.xml @@ -13911,6 +13904,11 @@ msgstr " # apt-get -o dir::cache::archives=\"/disc/\" dist-upgrade\n" msgid "Which will use the already fetched archives on the disc." msgstr "Cette commande utilisera les fichiers récupérés sur le disque." +#~ msgid "" +#~ " " +#~ msgstr "" + #, fuzzy #~| msgid "APT key management utility" #~ msgid "Deprecated APT key management utility" diff --git a/doc/po/it.po b/doc/po/it.po index 75751dadb..5fa78e1e8 100644 --- a/doc/po/it.po +++ b/doc/po/it.po @@ -736,15 +736,6 @@ msgstr "" " " -#. type: Plain text -#: apt.ent -msgid "" -" " -msgstr "" -" " - #. type: Content of: #: apt.8.xml apt-get.8.xml apt-cache.8.xml apt-mark.8.xml apt-secure.8.xml #: apt-cdrom.8.xml apt-config.8.xml @@ -13695,6 +13686,13 @@ msgstr " # apt-get -o dir::cache::archives=\"/disc/\" dist-upgrade\n" msgid "Which will use the already fetched archives on the disc." msgstr "che userà gli archivi già scaricati e presenti sul disco." +#~ msgid "" +#~ " " +#~ msgstr "" +#~ " " + #, fuzzy #~| msgid "APT key management utility" #~ msgid "Deprecated APT key management utility" diff --git a/doc/po/ja.po b/doc/po/ja.po index e223cbd6e..783e29c32 100644 --- a/doc/po/ja.po +++ b/doc/po/ja.po @@ -739,15 +739,6 @@ msgstr "" " " -#. type: Plain text -#: apt.ent -msgid "" -" " -msgstr "" -" " - #. type: Content of: #: apt.8.xml apt-get.8.xml apt-cache.8.xml apt-mark.8.xml apt-secure.8.xml #: apt-cdrom.8.xml apt-config.8.xml @@ -13143,6 +13134,13 @@ msgstr " # apt-get -o dir::cache::archives=\"/disc/\" dist-upgrade\n" msgid "Which will use the already fetched archives on the disc." msgstr "これで、ディスクにある取得済みのアーカイブを使用するようになります。" +#~ msgid "" +#~ " " +#~ msgstr "" +#~ " " + #, fuzzy #~| msgid "APT key management utility" #~ msgid "Deprecated APT key management utility" diff --git a/doc/po/nl.po b/doc/po/nl.po index 56b8207f2..e265e318a 100644 --- a/doc/po/nl.po +++ b/doc/po/nl.po @@ -705,15 +705,6 @@ msgstr "" " " -#. type: Plain text -#: apt.ent -msgid "" -" " -msgstr "" -" " - #. type: Content of: #: apt.8.xml apt-get.8.xml apt-cache.8.xml apt-mark.8.xml apt-secure.8.xml #: apt-cdrom.8.xml apt-config.8.xml @@ -14249,6 +14240,13 @@ msgid "Which will use the already fetched archives on the disc." msgstr "" "En dit zal gebruik maken van de reeds opgehaalde archieven op de schijf." +#~ msgid "" +#~ " " +#~ msgstr "" +#~ " " + #~ msgid "Deprecated APT key management utility" #~ msgstr "Verouderd hulpprogramma voor het beheer van de sleutels van APT" diff --git a/doc/po/pl.po b/doc/po/pl.po index db3391fd6..c8c38c448 100644 --- a/doc/po/pl.po +++ b/doc/po/pl.po @@ -735,15 +735,6 @@ msgstr "" " " -#. type: Plain text -#: apt.ent -msgid "" -" " -msgstr "" -" " - #. type: Content of: #: apt.8.xml apt-get.8.xml apt-cache.8.xml apt-mark.8.xml apt-secure.8.xml #: apt-cdrom.8.xml apt-config.8.xml @@ -12517,6 +12508,13 @@ msgstr " # apt-get -o dir::cache::archives=\"/disc/\" dist-upgrade\n" msgid "Which will use the already fetched archives on the disc." msgstr "Które użyje pobranych uprzednio archiwów z dysku." +#~ msgid "" +#~ " " +#~ msgstr "" +#~ " " + # #, fuzzy #~| msgid "APT key management utility" diff --git a/doc/po/pt.po b/doc/po/pt.po index 0a5832611..083a16f37 100644 --- a/doc/po/pt.po +++ b/doc/po/pt.po @@ -700,15 +700,6 @@ msgstr "" " " -#. type: Plain text -#: apt.ent -msgid "" -" " -msgstr "" -" " - #. type: Content of: #: apt.8.xml apt-get.8.xml apt-cache.8.xml apt-mark.8.xml apt-secure.8.xml #: apt-cdrom.8.xml apt-config.8.xml @@ -13868,6 +13859,13 @@ msgstr " # apt-get -o dir::cache::archives=\"/disc/\" dist-upgrade\n" msgid "Which will use the already fetched archives on the disc." msgstr "O qual irá usar os arquivos já obtidos e que estão no disco." +#~ msgid "" +#~ " " +#~ msgstr "" +#~ " " + #~ msgid "Deprecated APT key management utility" #~ msgstr "Utilitário de gestão de chaves do APT descontinuado" diff --git a/doc/po/pt_BR.po b/doc/po/pt_BR.po index f36008f8c..f685f4026 100644 --- a/doc/po/pt_BR.po +++ b/doc/po/pt_BR.po @@ -501,13 +501,6 @@ msgid "" "generate section --> " msgstr "" -#. type: Plain text -#: apt.ent -msgid "" -" " -msgstr "" - #. type: Content of: #: apt.8.xml apt-get.8.xml apt-cache.8.xml apt-mark.8.xml apt-secure.8.xml #: apt-cdrom.8.xml apt-config.8.xml diff --git a/methods/gpgv.cc b/methods/gpgv.cc index 8eda8d67f..1a6356dee 100644 --- a/methods/gpgv.cc +++ b/methods/gpgv.cc @@ -211,7 +211,7 @@ string GPGVMethod::VerifyGetSigners(const char *file, const char *outfile, FILE *pipein = fdopen(fd[0], "r"); - // Loop over the output of apt-key (which really is gnupg), and check the signatures. + // Loop over the output of gpgv, and check the signatures. std::vector ErrSigners; std::map> SubKeyMapping; size_t buffersize = 0; @@ -337,7 +337,7 @@ string GPGVMethod::VerifyGetSigners(const char *file, const char *outfile, for (auto errSigner : ErrSigners) Signers.Worthless.push_back({errSigner, ""}); - // apt-key has a --keyid parameter, but this requires gpg, so we call it without it + // gpgv has no --keyid parameter, so we call it without it // and instead check after the fact which keyids where used for verification if (keyFpts.empty() == false) { @@ -562,7 +562,7 @@ bool GPGVMethod::URIAcquire(std::string const &Message, FetchItem *Itm) keyFpts.emplace_back(std::move(key)); } - // Run apt-key on file, extract contents and get the key ID of the signer + // Run gpgv on file, extract contents and get the key ID of the signer string const msg = VerifyGetSignersWithLegacy(Path.c_str(), Itm->DestFile.c_str(), keyFpts, keyFiles, Signers); if (_error->PendingError()) return false; @@ -657,7 +657,7 @@ bool GPGVMethod::URIAcquire(std::string const &Message, FetchItem *Itm) Dequeue(); if (DebugEnabled()) - std::clog << "apt-key succeeded\n"; + std::clog << "gpgv succeeded\n"; return true; } diff --git a/methods/sqv.cc b/methods/sqv.cc index 45d001af1..ce7e36657 100644 --- a/methods/sqv.cc +++ b/methods/sqv.cc @@ -296,7 +296,7 @@ bool SQVMethod::URIAcquire(std::string const &Message, FetchItem *Itm) if (_error->PendingError()) return false; - // Run apt-key on file, extract contents and get the key ID of the signer + // Run sqv on file, extract contents and get the key ID of the signer VerifyGetSigners(Path.c_str(), Itm->DestFile.c_str(), keyFiles, Signers); if (_error->PendingError()) { diff --git a/prepare-release b/prepare-release index fe9628fd0..c5d6ac81b 100755 --- a/prepare-release +++ b/prepare-release @@ -233,7 +233,6 @@ elif [ "$1" = 'spellcheckers' -o "$1" = 'lint' ]; then -e '^.*apt-pkg/pkgcache\.h.*mmaped.*==>.*mapped.*$' \ -e '^.*apt-pkg/pkgcachegen\.cc.*mmaped.*==>.*mapped.*$' \ -e '^.*apt-pkg/contrib/mmap\.h.*mmaped.*==>.*mapped.*$' \ - -e '^.*cmdline/apt-key\.in.*dashs.*==>.*dashes.*$' \ -e '^.*methods/aptmethod\.h.*creat.*==>.*create.*$' \ -e '^.*dselect/install.*ans.*==>.*and.*$' \ -e '^.*ftparchive/writer\.h.*Delink.*==>.*Unlink.*$' \ @@ -276,9 +275,6 @@ elif [ "$1" = 'spellcheckers' -o "$1" = 'lint' ]; then -e '^./ftparchive/byhash.cc: ByHash ByHash (duplicate word) -> ByHash$' \ -e '^./ftparchive/writer.cc: this Packages -> these packages$' \ -e '^./ftparchive/byhash.h: ByHash ByHash (duplicate word) -> ByHash$' \ - -e '^./cmdline/apt-key.in: done done (duplicate word) -> done$' \ - -e '^./cmdline/apt-key.in: fi fi (duplicate word) -> fi$' \ - -e '^./cmdline/apt-key.in: echo echo (duplicate word) -> echo$' \ -e '^./triehash/.travis.yml: perl perl (duplicate word) -> perl$' \ -e '^./triehash/README.md: Performance Performance (duplicate word) -> Performance$' \ -e '^./debian/apt.apt-compat.cron.daily: fi fi (duplicate word) -> fi$' \ diff --git a/vendor/README b/vendor/README index 6846c8455..3b344d5ad 100644 --- a/vendor/README +++ b/vendor/README @@ -2,10 +2,10 @@ The vendor system in APT is an experiment to help distributions ship a stock apt release instead of applying documentation patches to it, increasing maintenance burden for everyone and hiding 'interesting' patches in the mix. -The provided information is used in the apt-key script and in documentation -like manpages and example configuration files. If you have patches modifying -additional bits and pieces currently not covered by this system please -contact us so we can change this! +The provided information is used in documentation like man pages and +example configuration files. If you have patches modifying additional +bits and pieces currently not covered by this system please contact us +so we can change this! == Adding a new vendor @@ -39,8 +39,7 @@ by opening a bug in the Debian BTS against apt with a patch attached. The format used is the one DocBook XML uses. The file is included as an entity file in the manpages xml source, so the syntax has to be valid! -The keyring-* settings are additionally used also in the creation of the -apt-key script and the keyring-package in particular as a dependency for apt. +The keyring-package setting is used as a dependency for apt. The field current-codename is optional and can be used in sources.list.in. diff --git a/vendor/blankon/apt-vendor.ent b/vendor/blankon/apt-vendor.ent index ea7625f90..a2d0d640b 100644 --- a/vendor/blankon/apt-vendor.ent +++ b/vendor/blankon/apt-vendor.ent @@ -1,10 +1,6 @@ blankon-keyring"> -/usr/share/keyrings/blankon-archive-keyring.gpg"> -/usr/share/keyrings/blankon-archive-removed-keys.gpg"> - - debian-archive-keyring"> - - - - procursus-keyring"> - - - - diff --git a/vendor/raspbian/apt-vendor.ent b/vendor/raspbian/apt-vendor.ent index 96d9fb71b..e3b960381 100644 --- a/vendor/raspbian/apt-vendor.ent +++ b/vendor/raspbian/apt-vendor.ent @@ -1,10 +1,6 @@ raspbian-archive-keyring"> -/usr/share/keyrings/raspbian-archive-keyring.gpg"> -/usr/share/keyrings/raspbian-archive-removed-keys.gpg"> - - valve-archive-keyring"> -/usr/share/keyrings/valve-archive-keyring.gpg"> -/usr/share/keyrings/valve-archive-removed-keys.gpg"> - - ubuntu-keyring"> -/usr/share/keyrings/ubuntu-archive-keyring.gpg"> -/usr/share/keyrings/ubuntu-archive-removed-keys.gpg"> - -