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. --- apt-pkg/deb/debfile.h | 11 ++--- apt-pkg/deb/debindexfile.cc | 10 ++-- apt-pkg/deb/debindexfile.h | 114 ++++++++++++++++++++++---------------------- apt-pkg/deb/deblistparser.h | 46 +++++++++--------- apt-pkg/deb/debmetaindex.cc | 4 +- apt-pkg/deb/debmetaindex.h | 30 ++++++------ apt-pkg/deb/debrecords.h | 40 ++++++++-------- apt-pkg/deb/debsrcrecords.h | 27 +++++------ apt-pkg/deb/debsystem.h | 20 ++++---- apt-pkg/deb/debversion.h | 12 ++--- apt-pkg/deb/dpkgpm.h | 14 +++--- 11 files changed, 162 insertions(+), 166 deletions(-) (limited to 'apt-pkg/deb') diff --git a/apt-pkg/deb/debfile.h b/apt-pkg/deb/debfile.h index 48a75ae55..887ee7142 100644 --- a/apt-pkg/deb/debfile.h +++ b/apt-pkg/deb/debfile.h @@ -56,8 +56,7 @@ class APT_PUBLIC debDebFile class APT_PUBLIC debDebFile::ControlExtract : public pkgDirStream { public: - - virtual bool DoItem(Item &Itm,int &Fd) APT_OVERRIDE; + bool DoItem(Item &Itm, int &Fd) override; }; class APT_PUBLIC debDebFile::MemControlExtract : public pkgDirStream @@ -72,9 +71,9 @@ class APT_PUBLIC debDebFile::MemControlExtract : public pkgDirStream std::string Member; // Members from DirStream - virtual bool DoItem(Item &Itm,int &Fd) APT_OVERRIDE; - virtual bool Process(Item &Itm,const unsigned char *Data, - unsigned long long Size,unsigned long long Pos) APT_OVERRIDE; + bool DoItem(Item &Itm, int &Fd) override; + bool Process(Item &Itm, const unsigned char *Data, + unsigned long long Size, unsigned long long Pos) override; // Helpers bool Read(debDebFile &Deb); @@ -82,7 +81,7 @@ class APT_PUBLIC debDebFile::MemControlExtract : public pkgDirStream MemControlExtract() : IsControl(false), Control(0), Length(0), Member("control") {}; explicit MemControlExtract(std::string Member) : IsControl(false), Control(0), Length(0), Member(Member) {}; - ~MemControlExtract() {delete [] Control;}; + ~MemControlExtract() override { delete[] Control; }; }; /*}}}*/ diff --git a/apt-pkg/deb/debindexfile.cc b/apt-pkg/deb/debindexfile.cc index c4115e53e..306018858 100644 --- a/apt-pkg/deb/debindexfile.cc +++ b/apt-pkg/deb/debindexfile.cc @@ -325,7 +325,7 @@ class APT_HIDDEN debIFTypeSrc : public pkgIndexFile::Type class APT_HIDDEN debIFTypePkg : public pkgIndexFile::Type { public: - virtual pkgRecords::Parser *CreatePkgParser(pkgCache::PkgFileIterator const &File) const APT_OVERRIDE + [[nodiscard]] pkgRecords::Parser *CreatePkgParser(pkgCache::PkgFileIterator const &File) const override { return new debRecordParser(File.FileName(),*File.Cache()); }; @@ -339,7 +339,7 @@ class APT_HIDDEN debIFTypeTrans : public debIFTypePkg class APT_HIDDEN debIFTypeStatus : public pkgIndexFile::Type { public: - virtual pkgRecords::Parser *CreatePkgParser(pkgCache::PkgFileIterator const &File) const APT_OVERRIDE + [[nodiscard]] pkgRecords::Parser *CreatePkgParser(pkgCache::PkgFileIterator const &File) const override { return new debRecordParser(File.FileName(),*File.Cache()); }; @@ -348,7 +348,7 @@ class APT_HIDDEN debIFTypeStatus : public pkgIndexFile::Type class APT_HIDDEN debIFTypeDebPkgFile : public pkgIndexFile::Type { public: - virtual pkgRecords::Parser *CreatePkgParser(pkgCache::PkgFileIterator const &File) const APT_OVERRIDE + [[nodiscard]] pkgRecords::Parser *CreatePkgParser(pkgCache::PkgFileIterator const &File) const override { return new debDebFileRecordParser(File.FileName()); }; @@ -357,7 +357,7 @@ class APT_HIDDEN debIFTypeDebPkgFile : public pkgIndexFile::Type class APT_HIDDEN debIFTypeDscFile : public pkgIndexFile::Type { public: - virtual pkgSrcRecords::Parser *CreateSrcPkgParser(std::string const &DscFile) const APT_OVERRIDE + [[nodiscard]] pkgSrcRecords::Parser *CreateSrcPkgParser(std::string const &DscFile) const override { return new debDscRecordParser(DscFile, NULL); }; @@ -366,7 +366,7 @@ class APT_HIDDEN debIFTypeDscFile : public pkgIndexFile::Type class APT_HIDDEN debIFTypeDebianSourceDir : public pkgIndexFile::Type { public: - virtual pkgSrcRecords::Parser *CreateSrcPkgParser(std::string const &SourceDir) const APT_OVERRIDE + [[nodiscard]] pkgSrcRecords::Parser *CreateSrcPkgParser(std::string const &SourceDir) const override { return new debDscRecordParser(SourceDir + std::string("/debian/control"), NULL); }; diff --git a/apt-pkg/deb/debindexfile.h b/apt-pkg/deb/debindexfile.h index 57b37385e..e9b22ff29 100644 --- a/apt-pkg/deb/debindexfile.h +++ b/apt-pkg/deb/debindexfile.h @@ -29,87 +29,85 @@ class debStatusIndex : public pkgDebianIndexRealFile { void * const d; protected: - virtual std::string GetArchitecture() const APT_OVERRIDE; - virtual std::string GetComponent() const APT_OVERRIDE; - virtual uint8_t GetIndexFlags() const APT_OVERRIDE; + [[nodiscard]] std::string GetArchitecture() const override; + [[nodiscard]] std::string GetComponent() const override; + [[nodiscard]] uint8_t GetIndexFlags() const override; public: - virtual const Type *GetType() const APT_OVERRIDE APT_PURE; + [[nodiscard]] const Type *GetType() const override APT_PURE; // Interface for the Cache Generator - virtual bool HasPackages() const APT_OVERRIDE {return true;}; + [[nodiscard]] bool HasPackages() const override { return true; }; // Abort if the file does not exist. - virtual bool Exists() const APT_OVERRIDE {return true;}; + [[nodiscard]] bool Exists() const override { return true; }; - virtual pkgCacheListParser * CreateListParser(FileFd &Pkg) APT_OVERRIDE; + pkgCacheListParser *CreateListParser(FileFd &Pkg) override; explicit debStatusIndex(std::string const &File); - virtual ~debStatusIndex(); + ~debStatusIndex() override; }; class debPackagesIndex : public pkgDebianIndexTargetFile { void * const d; protected: - virtual uint8_t GetIndexFlags() const APT_OVERRIDE; + [[nodiscard]] uint8_t GetIndexFlags() const override; public: - virtual const Type *GetType() const APT_OVERRIDE APT_PURE; + [[nodiscard]] const Type *GetType() const override APT_PURE; // Stuff for accessing files on remote items - virtual std::string ArchiveInfo(pkgCache::VerIterator const &Ver) const APT_OVERRIDE; + [[nodiscard]] std::string ArchiveInfo(pkgCache::VerIterator const &Ver) const override; // Interface for the Cache Generator - virtual bool HasPackages() const APT_OVERRIDE {return true;}; + [[nodiscard]] bool HasPackages() const override {return true;}; debPackagesIndex(IndexTarget const &Target, bool const Trusted); - virtual ~debPackagesIndex(); + ~debPackagesIndex() override; }; class debTranslationsIndex : public pkgDebianIndexTargetFile { void * const d; protected: - virtual std::string GetArchitecture() const APT_OVERRIDE; - virtual uint8_t GetIndexFlags() const APT_OVERRIDE; - virtual bool OpenListFile(FileFd &Pkg, std::string const &FileName) APT_OVERRIDE; - APT_HIDDEN virtual pkgCacheListParser * CreateListParser(FileFd &Pkg) APT_OVERRIDE; + [[nodiscard]] std::string GetArchitecture() const override; + [[nodiscard]] uint8_t GetIndexFlags() const override; + bool OpenListFile(FileFd &Pkg, std::string const &FileName) override; + APT_HIDDEN pkgCacheListParser *CreateListParser(FileFd &Pkg) override; public: - - virtual const Type *GetType() const APT_OVERRIDE APT_PURE; + [[nodiscard]] const Type *GetType() const override APT_PURE; // Interface for the Cache Generator - virtual bool HasPackages() const APT_OVERRIDE; + [[nodiscard]] bool HasPackages() const override; explicit debTranslationsIndex(IndexTarget const &Target); - virtual ~debTranslationsIndex(); + ~debTranslationsIndex() override; }; class debSourcesIndex : public pkgDebianIndexTargetFile { void * const d; - virtual uint8_t GetIndexFlags() const APT_OVERRIDE; - virtual bool OpenListFile(FileFd &Pkg, std::string const &FileName) APT_OVERRIDE; - APT_HIDDEN virtual pkgCacheListParser * CreateListParser(FileFd &Pkg) APT_OVERRIDE; - - public: + [[nodiscard]] uint8_t GetIndexFlags() const override; + bool OpenListFile(FileFd &Pkg, std::string const &FileName) override; + APT_HIDDEN pkgCacheListParser *CreateListParser(FileFd &Pkg) override; - virtual const Type *GetType() const APT_OVERRIDE APT_PURE; +public: + [[nodiscard]] const Type *GetType() const override APT_PURE; // Stuff for accessing files on remote items - virtual std::string SourceInfo(pkgSrcRecords::Parser const &Record, - pkgSrcRecords::File const &File) const APT_OVERRIDE; + [[nodiscard]] std::string SourceInfo(pkgSrcRecords::Parser const &Record, + pkgSrcRecords::File const &File) const override; // Interface for the record parsers - virtual pkgSrcRecords::Parser *CreateSrcParser() const APT_OVERRIDE; + [[nodiscard]] pkgSrcRecords::Parser *CreateSrcParser() const override; // Interface for the Cache Generator - virtual bool HasPackages() const APT_OVERRIDE {return false;}; + [[nodiscard]] bool HasPackages() const override { return false; }; debSourcesIndex(IndexTarget const &Target, bool const Trusted); - virtual ~debSourcesIndex(); + ~debSourcesIndex() override; }; class debDebPkgFileIndex : public pkgDebianIndexRealFile @@ -118,14 +116,14 @@ class debDebPkgFileIndex : public pkgDebianIndexRealFile std::string DebFile; protected: - virtual std::string GetComponent() const APT_OVERRIDE; - virtual std::string GetArchitecture() const APT_OVERRIDE; - virtual uint8_t GetIndexFlags() const APT_OVERRIDE; - virtual bool OpenListFile(FileFd &Pkg, std::string const &FileName) APT_OVERRIDE; - APT_HIDDEN virtual pkgCacheListParser * CreateListParser(FileFd &Pkg) APT_OVERRIDE; + [[nodiscard]] std::string GetComponent() const override; + [[nodiscard]] std::string GetArchitecture() const override; + [[nodiscard]] uint8_t GetIndexFlags() const override; + bool OpenListFile(FileFd &Pkg, std::string const &FileName) override; + APT_HIDDEN pkgCacheListParser *CreateListParser(FileFd &Pkg) override; public: - virtual const Type *GetType() const APT_OVERRIDE APT_PURE; + [[nodiscard]] const Type *GetType() const override APT_PURE; /** get the control (file) content of the deb file * @@ -136,15 +134,15 @@ public: static bool GetContent(std::ostream &content, std::string const &debfile); // Interface for the Cache Generator - virtual bool HasPackages() const APT_OVERRIDE {return true;} - virtual pkgCache::PkgFileIterator FindInCache(pkgCache &Cache) const APT_OVERRIDE; + [[nodiscard]] bool HasPackages() const override { return true; } + pkgCache::PkgFileIterator FindInCache(pkgCache &Cache) const override; // Interface for acquire explicit debDebPkgFileIndex(std::string const &DebFile); - virtual ~debDebPkgFileIndex(); + ~debDebPkgFileIndex() override; - std::string ArchiveInfo(pkgCache::VerIterator const &Ver) const override; + [[nodiscard]] std::string ArchiveInfo(pkgCache::VerIterator const &Ver) const override; }; class APT_PUBLIC debDscFileIndex : public pkgDebianIndexRealFile @@ -152,14 +150,14 @@ class APT_PUBLIC debDscFileIndex : public pkgDebianIndexRealFile void * const d; protected: - virtual std::string GetComponent() const APT_OVERRIDE; - virtual std::string GetArchitecture() const APT_OVERRIDE; - virtual uint8_t GetIndexFlags() const APT_OVERRIDE; + [[nodiscard]] std::string GetComponent() const override; + [[nodiscard]] std::string GetArchitecture() const override; + [[nodiscard]] uint8_t GetIndexFlags() const override; public: - virtual const Type *GetType() const APT_OVERRIDE APT_PURE; - virtual pkgSrcRecords::Parser *CreateSrcParser() const APT_OVERRIDE; - virtual bool HasPackages() const APT_OVERRIDE {return false;}; + [[nodiscard]] const Type *GetType() const override APT_PURE; + [[nodiscard]] pkgSrcRecords::Parser *CreateSrcParser() const override; + [[nodiscard]] bool HasPackages() const override { return false; }; explicit debDscFileIndex(std::string const &DscFile); virtual ~debDscFileIndex(); @@ -168,29 +166,29 @@ public: class debDebianSourceDirIndex : public debDscFileIndex { protected: - virtual std::string GetComponent() const APT_OVERRIDE; + [[nodiscard]] std::string GetComponent() const override; public: - virtual const Type *GetType() const APT_OVERRIDE APT_PURE; +[[nodiscard]] const Type *GetType() const override APT_PURE; }; class APT_PUBLIC debStringPackageIndex : public pkgDebianIndexRealFile { void * const d; protected: - virtual std::string GetArchitecture() const APT_OVERRIDE; - virtual std::string GetComponent() const APT_OVERRIDE; - virtual uint8_t GetIndexFlags() const APT_OVERRIDE; + [[nodiscard]] std::string GetArchitecture() const override; + [[nodiscard]] std::string GetComponent() const override; + [[nodiscard]] uint8_t GetIndexFlags() const override; -public: - virtual const Type *GetType() const APT_OVERRIDE APT_PURE; + public: + [[nodiscard]] const Type *GetType() const override APT_PURE; // Interface for the Cache Generator - virtual bool HasPackages() const APT_OVERRIDE {return true;}; + [[nodiscard]] bool HasPackages() const override { return true; }; // Abort if the file does not exist. - virtual bool Exists() const APT_OVERRIDE {return true;}; + [[nodiscard]] bool Exists() const override { return true; }; explicit debStringPackageIndex(std::string const &content); - virtual ~debStringPackageIndex(); + ~debStringPackageIndex() override; }; #endif diff --git a/apt-pkg/deb/deblistparser.h b/apt-pkg/deb/deblistparser.h index 637063f94..200e04036 100644 --- a/apt-pkg/deb/deblistparser.h +++ b/apt-pkg/deb/deblistparser.h @@ -59,21 +59,21 @@ class APT_HIDDEN debListParser : public pkgCacheListParser APT_PUBLIC static unsigned char GetPrio(std::string Str); // These all operate against the current section - virtual std::string Package() APT_OVERRIDE; - virtual bool ArchitectureAll() APT_OVERRIDE; - virtual std::string_view Architecture() APT_OVERRIDE; - virtual std::string_view Version() APT_OVERRIDE; - virtual bool NewVersion(pkgCache::VerIterator &Ver) APT_OVERRIDE; - virtual std::vector AvailableDescriptionLanguages() APT_OVERRIDE; - virtual std::string_view Description_md5() APT_OVERRIDE; - virtual uint32_t VersionHash() APT_OVERRIDE; - virtual bool SameVersion(uint32_t Hash, pkgCache::VerIterator const &Ver) APT_OVERRIDE; - virtual bool UsePackage(pkgCache::PkgIterator &Pkg, - pkgCache::VerIterator &Ver) APT_OVERRIDE; - virtual map_filesize_t Offset() APT_OVERRIDE {return iOffset;}; - virtual map_filesize_t Size() APT_OVERRIDE {return Section.size();}; - - virtual bool Step() APT_OVERRIDE; + std::string Package() override; + bool ArchitectureAll() override; + std::string_view Architecture() override; + std::string_view Version() override; + bool NewVersion(pkgCache::VerIterator &Ver) override; + std::vector AvailableDescriptionLanguages() override; + std::string_view Description_md5() override; + uint32_t VersionHash() override; + bool SameVersion(uint32_t Hash, pkgCache::VerIterator const &Ver) override; + bool UsePackage(pkgCache::PkgIterator &Pkg, + pkgCache::VerIterator &Ver) override; + map_filesize_t Offset() override { return iOffset; }; + map_filesize_t Size() override { return Section.size(); }; + + bool Step() override; APT_PUBLIC static const char *ParseDepends(const char *Start, const char *Stop, std::string &Package, std::string &Ver, unsigned int &Op, @@ -99,7 +99,7 @@ class APT_HIDDEN debListParser : public pkgCacheListParser APT_PUBLIC static const char *ConvertRelation(const char *I,unsigned int &Op); explicit debListParser(FileFd *File); - virtual ~debListParser(); + ~debListParser() override; #ifdef APT_COMPILING_APT std::string_view SHA256() const @@ -116,25 +116,25 @@ class APT_HIDDEN debDebFileParser : public debListParser public: debDebFileParser(FileFd *File, std::string const &DebFile); - virtual bool UsePackage(pkgCache::PkgIterator &Pkg, - pkgCache::VerIterator &Ver) APT_OVERRIDE; + bool UsePackage(pkgCache::PkgIterator &Pkg, + pkgCache::VerIterator &Ver) override; }; class APT_HIDDEN debTranslationsParser : public debListParser { public: // a translation can never be a real package - virtual std::string_view Architecture() APT_OVERRIDE { return ""; } - virtual std::string_view Version() APT_OVERRIDE { return ""; } + std::string_view Architecture() override { return {}; } + std::string_view Version() override { return {}; } - explicit debTranslationsParser(FileFd *File) - : debListParser(File) {}; + explicit debTranslationsParser(FileFd *File) + : debListParser(File) {}; }; class APT_HIDDEN debStatusListParser : public debListParser { public: - virtual bool ParseStatus(pkgCache::PkgIterator &Pkg,pkgCache::VerIterator &Ver) APT_OVERRIDE; + bool ParseStatus(pkgCache::PkgIterator &Pkg,pkgCache::VerIterator &Ver) override; explicit debStatusListParser(FileFd *File) : debListParser(File) {}; }; diff --git a/apt-pkg/deb/debmetaindex.cc b/apt-pkg/deb/debmetaindex.cc index b9369a898..191be05d6 100644 --- a/apt-pkg/deb/debmetaindex.cc +++ b/apt-pkg/deb/debmetaindex.cc @@ -1475,7 +1475,7 @@ class APT_HIDDEN debSLTypeDeb : public debSLTypeDebian /*{{{*/ bool CreateItem(std::vector &List, std::string const &URI, std::string const &Dist, std::string const &Section, - std::map const &Options) const APT_OVERRIDE + std::map const &Options) const override { return CreateItemInternal(List, URI, Dist, Section, false, Options); } @@ -1491,7 +1491,7 @@ class APT_HIDDEN debSLTypeDebSrc : public debSLTypeDebian /*{{{*/ bool CreateItem(std::vector &List, std::string const &URI, std::string const &Dist, std::string const &Section, - std::map const &Options) const APT_OVERRIDE + std::map const &Options) const override { return CreateItemInternal(List, URI, Dist, Section, true, Options); } diff --git a/apt-pkg/deb/debmetaindex.h b/apt-pkg/deb/debmetaindex.h index a1a9c41b5..7a6f1fbb4 100644 --- a/apt-pkg/deb/debmetaindex.h +++ b/apt-pkg/deb/debmetaindex.h @@ -30,20 +30,20 @@ class APT_HIDDEN debReleaseIndex : public metaIndex debReleaseIndex(std::string const &URI, std::string const &Dist, std::map const &Options); debReleaseIndex(std::string const &URI, std::string const &Dist, bool const Trusted, std::map const &Options); - virtual ~debReleaseIndex(); + ~debReleaseIndex() override; - virtual std::string ArchiveURI(std::string const &File) const APT_OVERRIDE; - virtual bool GetIndexes(pkgAcquire *Owner, bool const &GetAll=false) APT_OVERRIDE; - virtual std::vector GetIndexTargets() const APT_OVERRIDE; + [[nodiscard]] std::string ArchiveURI(std::string const &File) const override; + bool GetIndexes(pkgAcquire *Owner, bool const &GetAll = false) override; + [[nodiscard]] std::vector GetIndexTargets() const override; - virtual std::string Describe() const APT_OVERRIDE; - virtual pkgCache::RlsFileIterator FindInCache(pkgCache &Cache, bool const ModifyCheck) const APT_OVERRIDE; - virtual bool Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const APT_OVERRIDE; + [[nodiscard]] std::string Describe() const override; + pkgCache::RlsFileIterator FindInCache(pkgCache &Cache, bool ModifyCheck) const override; + bool Merge(pkgCacheGenerator &Gen, OpProgress *Prog) const override; - virtual bool Load(std::string const &Filename, std::string * const ErrorText) APT_OVERRIDE; - virtual metaIndex * UnloadedClone() const APT_OVERRIDE; + bool Load(std::string const &Filename, std::string *ErrorText) override; + [[nodiscard]] metaIndex *UnloadedClone() const override; - virtual std::vector *GetIndexFiles() APT_OVERRIDE; + std::vector *GetIndexFiles() override; bool SetTrusted(TriState const Trusted); bool SetCheckValidUntil(TriState const Trusted); @@ -56,12 +56,12 @@ class APT_HIDDEN debReleaseIndex : public metaIndex bool SetSignedBy(std::string const &SignedBy); std::map GetReleaseOptions(); - virtual bool IsTrusted() const APT_OVERRIDE; - bool IsArchitectureSupported(std::string const &arch) const override; - bool IsArchitectureAllSupportedFor(IndexTarget const &target) const override; - bool HasSupportForComponent(std::string const &component) const override; + [[nodiscard]] bool IsTrusted() const override; + [[nodiscard]] bool IsArchitectureSupported(std::string const &arch) const override; + [[nodiscard]] bool IsArchitectureAllSupportedFor(IndexTarget const &target) const override; + [[nodiscard]] bool HasSupportForComponent(std::string const &component) const override; - APT_PURE time_t GetNotBefore() const override; + [[nodiscard]] time_t GetNotBefore() const override APT_PURE; void AddComponent(std::string const &sourcesEntry, bool const isSrc, std::string const &Name, diff --git a/apt-pkg/deb/debrecords.h b/apt-pkg/deb/debrecords.h index 10ef91768..050f0399f 100644 --- a/apt-pkg/deb/debrecords.h +++ b/apt-pkg/deb/debrecords.h @@ -29,26 +29,26 @@ class APT_HIDDEN debRecordParserBase : public pkgRecords::Parser public: // These refer to the archive file for the Version - virtual std::string FileName() APT_OVERRIDE; - virtual std::string SourcePkg() APT_OVERRIDE; - virtual std::string SourceVer() APT_OVERRIDE; + std::string FileName() override; + std::string SourcePkg() override; + std::string SourceVer() override; - virtual HashStringList Hashes() const APT_OVERRIDE; + [[nodiscard]] HashStringList Hashes() const override; // These are some general stats about the package - virtual std::string Maintainer() APT_OVERRIDE; - virtual std::string ShortDesc(std::string const &lang) APT_OVERRIDE; - virtual std::string LongDesc(std::string const &lang) APT_OVERRIDE; - virtual std::string Name() APT_OVERRIDE; - virtual std::string Homepage() APT_OVERRIDE; + std::string Maintainer() override; + std::string ShortDesc(std::string const &lang) override; + std::string LongDesc(std::string const &lang) override; + std::string Name() override; + std::string Homepage() override; // An arbitrary custom field - virtual std::string RecordField(const char *fieldName) APT_OVERRIDE; + std::string RecordField(const char *fieldName) override; - virtual void GetRec(const char *&Start,const char *&Stop) APT_OVERRIDE; + void GetRec(const char *&Start, const char *&Stop) override; debRecordParserBase(); - virtual ~debRecordParserBase(); + ~debRecordParserBase() override; }; class APT_HIDDEN debRecordParser : public debRecordParserBase @@ -58,12 +58,12 @@ class APT_HIDDEN debRecordParser : public debRecordParserBase FileFd File; pkgTagFile Tags; - virtual bool Jump(pkgCache::VerFileIterator const &Ver) APT_OVERRIDE; - virtual bool Jump(pkgCache::DescFileIterator const &Desc) APT_OVERRIDE; + bool Jump(pkgCache::VerFileIterator const &Ver) override; + bool Jump(pkgCache::DescFileIterator const &Desc) override; public: debRecordParser(std::string FileName,pkgCache &Cache); - virtual ~debRecordParser(); + ~debRecordParser() override; }; // custom record parser that reads deb files directly @@ -76,14 +76,14 @@ class APT_HIDDEN debDebFileRecordParser : public debRecordParserBase APT_HIDDEN bool LoadContent(); protected: // single file files, so no jumping whatsoever - bool Jump(pkgCache::VerFileIterator const &) APT_OVERRIDE; - bool Jump(pkgCache::DescFileIterator const &) APT_OVERRIDE; + bool Jump(pkgCache::VerFileIterator const &/*Ver*/) override; + bool Jump(pkgCache::DescFileIterator const & /*Desc*/) override; public: - virtual std::string FileName() APT_OVERRIDE; + std::string FileName() override; - explicit debDebFileRecordParser(std::string FileName); - virtual ~debDebFileRecordParser(); + explicit debDebFileRecordParser(std::string FileName); + ~debDebFileRecordParser() override; }; #endif diff --git a/apt-pkg/deb/debsrcrecords.h b/apt-pkg/deb/debsrcrecords.h index dedcb6dbe..a439efa82 100644 --- a/apt-pkg/deb/debsrcrecords.h +++ b/apt-pkg/deb/debsrcrecords.h @@ -35,28 +35,27 @@ class APT_HIDDEN debSrcRecordParser : public pkgSrcRecords::Parser char *Buffer; public: + bool Restart() override { return Jump(0); } + bool Step() override {iOffset = Tags.Offset(); return Tags.Step(Sect);} + bool Jump(unsigned long const &Off) override {iOffset = Off; return Tags.Jump(Sect,Off);} - virtual bool Restart() APT_OVERRIDE {return Jump(0);}; - virtual bool Step() APT_OVERRIDE {iOffset = Tags.Offset(); return Tags.Step(Sect);}; - virtual bool Jump(unsigned long const &Off) APT_OVERRIDE {iOffset = Off; return Tags.Jump(Sect,Off);}; - - virtual std::string Package() const APT_OVERRIDE; - virtual std::string Version() const APT_OVERRIDE {return std::string{Sect.Find(pkgTagSection::Key::Version)};}; - virtual std::string Maintainer() const APT_OVERRIDE {return std::string{Sect.Find(pkgTagSection::Key::Maintainer)};}; - virtual std::string Section() const APT_OVERRIDE {return std::string{Sect.Find(pkgTagSection::Key::Section)};}; - virtual const char **Binaries() APT_OVERRIDE; - virtual bool BuildDepends(std::vector &BuildDeps, bool const &ArchOnly, bool const &StripMultiArch = true) APT_OVERRIDE; - virtual unsigned long Offset() APT_OVERRIDE {return iOffset;}; - virtual std::string AsStr() APT_OVERRIDE + [[nodiscard]] std::string Package() const override; + [[nodiscard]] std::string Version() const override { return std::string{Sect.Find(pkgTagSection::Key::Version)}; } + [[nodiscard]] std::string Maintainer() const override { return std::string{Sect.Find(pkgTagSection::Key::Maintainer)}; } + [[nodiscard]] std::string Section() const override { return std::string{Sect.Find(pkgTagSection::Key::Section)}; } + const char **Binaries() override; + bool BuildDepends(std::vector &BuildDeps, bool const &ArchOnly, bool const &StripMultiArch = true) override; + unsigned long Offset() override { return iOffset; } + std::string AsStr() override { const char *Start=0,*Stop=0; Sect.GetSection(Start,Stop); return std::string(Start,Stop); }; - virtual bool Files(std::vector &F) APT_OVERRIDE; + bool Files(std::vector &F) override; debSrcRecordParser(std::string const &File,pkgIndexFile const *Index); - virtual ~debSrcRecordParser(); + ~debSrcRecordParser() override; }; class APT_HIDDEN debDscRecordParser : public debSrcRecordParser diff --git a/apt-pkg/deb/debsystem.h b/apt-pkg/deb/debsystem.h index c426faf81..294ae1819 100644 --- a/apt-pkg/deb/debsystem.h +++ b/apt-pkg/deb/debsystem.h @@ -27,18 +27,18 @@ class debSystem : public pkgSystem APT_HIDDEN bool CheckUpdates(); public: - virtual bool Lock(OpProgress *const Progress) APT_OVERRIDE; - virtual bool UnLock(bool NoErrors = false) APT_OVERRIDE; - virtual pkgPackageManager *CreatePM(pkgDepCache *Cache) const APT_OVERRIDE; - virtual bool Initialize(Configuration &Cnf) APT_OVERRIDE; - virtual bool ArchiveSupported(const char *Type) APT_OVERRIDE; - virtual signed Score(Configuration const &Cnf) APT_OVERRIDE; - virtual bool AddStatusFiles(std::vector &List) APT_OVERRIDE; - virtual bool FindIndex(pkgCache::PkgFileIterator File, - pkgIndexFile *&Found) const APT_OVERRIDE; + bool Lock(OpProgress *Progress) override; + bool UnLock(bool NoErrors = false) override; + pkgPackageManager *CreatePM(pkgDepCache *Cache) const override; + bool Initialize(Configuration &Cnf) override; + bool ArchiveSupported(const char *Type) override; + signed Score(Configuration const &Cnf) override; + bool AddStatusFiles(std::vector &List) override; + bool FindIndex(pkgCache::PkgFileIterator File, + pkgIndexFile *&Found) const override; debSystem(); - virtual ~debSystem(); + ~debSystem() override; APT_HIDDEN static std::string GetDpkgExecutable(); APT_HIDDEN static std::vector GetDpkgBaseCommand(); diff --git a/apt-pkg/deb/debversion.h b/apt-pkg/deb/debversion.h index 5c328a985..6d82e5889 100644 --- a/apt-pkg/deb/debversion.h +++ b/apt-pkg/deb/debversion.h @@ -23,15 +23,15 @@ class APT_PUBLIC debVersioningSystem : public pkgVersioningSystem const char *BEnd) APT_PURE; // Compare versions.. - virtual int DoCmpVersion(const char *A,const char *Aend, - const char *B,const char *Bend) APT_OVERRIDE APT_PURE; - virtual bool CheckDep(const char *PkgVer,int Op,const char *DepVer) APT_OVERRIDE APT_PURE; - virtual APT_PURE int DoCmpReleaseVer(const char *A,const char *Aend, - const char *B,const char *Bend) APT_OVERRIDE + int DoCmpVersion(const char *A, const char *Aend, + const char *B, const char *Bend) override APT_PURE; + bool CheckDep(const char *PkgVer, int Op, const char *DepVer) override APT_PURE; + int DoCmpReleaseVer(const char *A, const char *Aend, + const char *B, const char *Bend) override APT_PURE { return DoCmpVersion(A,Aend,B,Bend); } - virtual std::string UpstreamVersion(const char *A) APT_OVERRIDE; + std::string UpstreamVersion(const char *A) override; debVersioningSystem(); }; diff --git a/apt-pkg/deb/dpkgpm.h b/apt-pkg/deb/dpkgpm.h index ed0b67b31..5ce9dc110 100644 --- a/apt-pkg/deb/dpkgpm.h +++ b/apt-pkg/deb/dpkgpm.h @@ -113,18 +113,18 @@ class APT_PUBLIC pkgDPkgPM : public pkgPackageManager void ProcessDpkgStatusLine(char *line); // The Actual installation implementation - virtual bool Install(PkgIterator Pkg,std::string File) APT_OVERRIDE; - virtual bool Configure(PkgIterator Pkg) APT_OVERRIDE; - virtual bool Remove(PkgIterator Pkg,bool Purge = false) APT_OVERRIDE; + bool Install(PkgIterator Pkg,std::string File) override; + bool Configure(PkgIterator Pkg) override; + bool Remove(PkgIterator Pkg, bool Purge = false) override; - virtual bool Go(APT::Progress::PackageManager *progress) APT_OVERRIDE; + bool Go(APT::Progress::PackageManager *progress) override; + + void Reset() override; - virtual void Reset() APT_OVERRIDE; - public: explicit pkgDPkgPM(pkgDepCache *Cache); - virtual ~pkgDPkgPM(); + ~pkgDPkgPM() override; APT_HIDDEN static bool ExpandPendingCalls(std::vector &List, pkgDepCache &Cache); }; -- 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 'apt-pkg/deb') 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 785a7a50b53bd0794e58cca31730818714992c00 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 26 Dec 2024 21:32:44 +0000 Subject: Drop APT_DEPRECATED usage C++14 includes the standard attribute, so we can use that instead. Note that we drop the deprecation of {Pkg,Dep}Iterator::operator<< as this is ignored (a friends declaration must be a definition to have attributes) very noisily by GCC >= 12 and the methods can be somewhat useful in debugging if you are to lazy to get APT::Pretty{Pkg,Dep}. --- apt-pkg/acquire-method.h | 2 +- apt-pkg/cacheiterators.h | 8 ++++---- apt-pkg/contrib/macros.h | 8 ++++---- apt-pkg/contrib/strutl.h | 2 +- apt-pkg/deb/deblistparser.h | 11 ++++++----- 5 files changed, 16 insertions(+), 15 deletions(-) (limited to 'apt-pkg/deb') diff --git a/apt-pkg/acquire-method.h b/apt-pkg/acquire-method.h index 387d0984d..bad0935d6 100644 --- a/apt-pkg/acquire-method.h +++ b/apt-pkg/acquire-method.h @@ -102,7 +102,7 @@ class APT_PUBLIC pkgAcqMethod bool MediaFail(std::string Required,std::string Drive); virtual void Exit() {}; - APT_DEPRECATED_MSG("Use SendMessage instead") void PrintStatus(char const * const header, const char* Format, va_list &args) const; + [[deprecated("Use SendMessage instead")]] void PrintStatus(char const * const header, const char* Format, va_list &args) const; public: enum CnfFlags diff --git a/apt-pkg/cacheiterators.h b/apt-pkg/cacheiterators.h index 9ed5c1719..31ce1b295 100644 --- a/apt-pkg/cacheiterators.h +++ b/apt-pkg/cacheiterators.h @@ -177,8 +177,8 @@ class APT_PUBLIC pkgCache::PkgIterator: public Iterator { OkState State() const APT_PURE; const char *CurVersion() const APT_PURE; - //Nice printable representation - APT_DEPRECATED_MSG("Use APT::PrettyPkg instead") friend std::ostream& operator <<(std::ostream& out, PkgIterator i); + // for a nice printable representation you likely want APT::PrettyPkg instead + friend std::ostream& operator<<(std::ostream& out, PkgIterator i); std::string FullName(bool const &Pretty = false) const; // Constructors @@ -364,8 +364,8 @@ class APT_PUBLIC pkgCache::DepIterator : public Iterator(newMap) + (S2 - static_cast(oldMap)); } - //Nice printable representation - APT_DEPRECATED_MSG("Use APT::PrettyDep instead") friend std::ostream& operator <<(std::ostream& out, DepIterator D); + // for a nice printable representation you likely want APT::PrettyDep instead + friend std::ostream& operator<<(std::ostream& out, DepIterator D); inline DepIterator(pkgCache &Owner, Dependency *Trg, Version* = 0) : Iterator(Owner, Trg), Type(DepVer), S2(Trg == 0 ? Owner.DepDataP : (Owner.DepDataP + Trg->DependencyData)) { diff --git a/apt-pkg/contrib/macros.h b/apt-pkg/contrib/macros.h index c1fa73775..66437f305 100644 --- a/apt-pkg/contrib/macros.h +++ b/apt-pkg/contrib/macros.h @@ -36,16 +36,12 @@ #endif #if APT_GCC_VERSION >= 0x0300 - #define APT_DEPRECATED __attribute__ ((deprecated)) - #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_PRINTF(n) __attribute__((format(printf, n, n + 1))) #define APT_WEAK __attribute__((weak)); #define APT_UNUSED __attribute__((unused)) #else - #define APT_DEPRECATED - #define APT_DEPRECATED_MSG #define APT_PURE #define APT_PRINTF(n) #define APT_WEAK @@ -135,8 +131,12 @@ AptScopeWrapper(F) -> AptScopeWrapper; #define CLRFLAG(v,f) ((v) &=~FLAG(f)) #define CHKFLAG(v,f) ((v) & FLAG(f) ? true : false) #if APT_GCC_VERSION >= 0x0300 + #define APT_DEPRECATED __attribute__ ((deprecated)) + #define APT_DEPRECATED_MSG(X) __attribute__ ((deprecated(X))) #define APT_NORETURN __attribute__((noreturn)) #else + #define APT_DEPRECATED + #define APT_DEPRECATED_MSG(X) #define APT_NORETURN #endif #endif diff --git a/apt-pkg/contrib/strutl.h b/apt-pkg/contrib/strutl.h index 91f5fe44b..ecb61000d 100644 --- a/apt-pkg/contrib/strutl.h +++ b/apt-pkg/contrib/strutl.h @@ -56,7 +56,7 @@ namespace APT { APT_PUBLIC bool UTF8ToCodeset(const char *codeset, const std::string &orig, std::string *dest); APT_PUBLIC char *_strstrip(char *String); APT_PUBLIC char *_strrstrip(char *String); // right strip only -APT_DEPRECATED_MSG("Use SubstVar to avoid memory headaches") APT_PUBLIC char *_strtabexpand(char *String,size_t Len); +[[deprecated("Use SubstVar to avoid memory headaches")]] APT_PUBLIC char *_strtabexpand(char *String,size_t Len); APT_PUBLIC bool ParseQuoteWord(const char *&String,std::string &Res); APT_PUBLIC bool ParseCWord(const char *&String,std::string &Res); APT_PUBLIC std::string QuoteString(const std::string &Str,const char *Bad); diff --git a/apt-pkg/deb/deblistparser.h b/apt-pkg/deb/deblistparser.h index 200e04036..aec09ed2e 100644 --- a/apt-pkg/deb/deblistparser.h +++ b/apt-pkg/deb/deblistparser.h @@ -82,18 +82,19 @@ class APT_HIDDEN debListParser : public pkgCacheListParser std::string const &Arch = ""); #if APT_PKG_ABI <= 600 + [[deprecated("Use std::string_view variant instead")]] APT_PUBLIC static const char *ParseDepends(const char *Start, const char *Stop, APT::StringView &Package, APT::StringView &Ver, unsigned int &Op, - bool const ParseArchFlags = false, bool StripMultiArch = true, - bool const ParseRestrictionsList = false, - std::string Arch = "") APT_DEPRECATED_MSG("Use std::string_view variant instead"); + bool ParseArchFlags = false, bool StripMultiArch = true, + bool ParseRestrictionsList = false, + std::string Arch = ""); #endif APT_PUBLIC static const char *ParseDepends(const char *Start, const char *Stop, std::string_view &Package, std::string_view &Ver, unsigned int &Op, - bool const ParseArchFlags = false, bool StripMultiArch = true, - bool const ParseRestrictionsList = false, + bool ParseArchFlags = false, bool StripMultiArch = true, + bool ParseRestrictionsList = false, std::string Arch = ""); APT_PUBLIC static const char *ConvertRelation(const char *I,unsigned int &Op); -- 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 'apt-pkg/deb') 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"> - -