From 9d7a660611e9e134cd6d74a594bde59cad77c8d8 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Mon, 27 Jan 2025 15:51:24 +0100 Subject: apt: Introduce the modernize-sources command This handles rewriting .list entries to .sources ones; the only options handled are - signed-by => Signed-By - trusted => Trusted The options to specify architectures, check-valid-until, etc. are not supported as they are not exposed in the code. We probably should refactor the parser at some point so we can actually read the parsed entry rather than the abstract objects we create from it. This can be improved further: - Keyrings from /etc/apt/trusted.gpg.d should be moved to /etc/apt/keyrings. - automatic detection by trying to verify using each keyring in trusted.gpg.d until we find the right one and then using that for Signed-By rather than leave some sources empty. --- apt-pkg/metaindex.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'apt-pkg') diff --git a/apt-pkg/metaindex.h b/apt-pkg/metaindex.h index 198c3f34a..e6c8b7c64 100644 --- a/apt-pkg/metaindex.h +++ b/apt-pkg/metaindex.h @@ -121,6 +121,10 @@ public: virtual bool IsArchitectureSupported(std::string const &arch) const; virtual bool IsArchitectureAllSupportedFor(IndexTarget const &target) const; virtual bool HasSupportForComponent(std::string const &component) const; + +#ifdef APT_COMPILING_APT + bool IsTrustedSet() { return Trusted == TRI_YES; } +#endif }; #endif -- cgit v1.2.3-70-g09d2