From 241ed15da41b6f412c75a2a7d4cc0d10ffbfa17d Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Mon, 4 Feb 2019 15:39:57 +0100 Subject: Bump SONAMEs in preparation for ABI breaks --- apt-pkg/contrib/macros.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'apt-pkg') diff --git a/apt-pkg/contrib/macros.h b/apt-pkg/contrib/macros.h index 57d3f6c22..f15625a4c 100644 --- a/apt-pkg/contrib/macros.h +++ b/apt-pkg/contrib/macros.h @@ -165,9 +165,9 @@ // reverse-dependencies of libapt-pkg against the new SONAME. // Non-ABI-Breaks should only increase RELEASE number. // See also buildlib/libversion.mak -#define APT_PKG_MAJOR 5 +#define APT_PKG_MAJOR 6 #define APT_PKG_MINOR 0 -#define APT_PKG_RELEASE 2 +#define APT_PKG_RELEASE 0 #define APT_PKG_ABI ((APT_PKG_MAJOR * 100) + APT_PKG_MINOR) #endif -- cgit v1.2.3 From 10176f8b30568a1a5d21bb67ff2ca937c771dc61 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Mon, 4 Feb 2019 16:01:12 +0100 Subject: pkgcache: Remove deprecated bits --- apt-pkg/pkgcache.cc | 2 -- apt-pkg/pkgcache.h | 20 -------------------- apt-pkg/pkgcachegen.cc | 3 --- 3 files changed, 25 deletions(-) (limited to 'apt-pkg') diff --git a/apt-pkg/pkgcache.cc b/apt-pkg/pkgcache.cc index 80dd1d1fa..9af8d2d13 100644 --- a/apt-pkg/pkgcache.cc +++ b/apt-pkg/pkgcache.cc @@ -125,7 +125,6 @@ bool pkgCache::Header::CheckSizes(Header &Against) const // Cache::pkgCache - Constructor /*{{{*/ // --------------------------------------------------------------------- /* */ -APT_IGNORE_DEPRECATED_PUSH pkgCache::pkgCache(MMap *Map, bool DoMap) : Map(*Map), VS(nullptr), d(NULL) { // call getArchitectures() with cached=false to ensure that the @@ -135,7 +134,6 @@ pkgCache::pkgCache(MMap *Map, bool DoMap) : Map(*Map), VS(nullptr), d(NULL) if (DoMap == true) ReMap(); } -APT_IGNORE_DEPRECATED_POP /*}}}*/ // Cache::ReMap - Reopen the cache file /*{{{*/ // --------------------------------------------------------------------- diff --git a/apt-pkg/pkgcache.h b/apt-pkg/pkgcache.h index 787e3995f..c20320a56 100644 --- a/apt-pkg/pkgcache.h +++ b/apt-pkg/pkgcache.h @@ -220,7 +220,6 @@ class pkgCache /*{{{*/ Provides *ProvideP; Dependency *DepP; DependencyData *DepDataP; - APT_DEPRECATED_MSG("Not used anymore in cache generation and without a replacement") StringItem *StringItemP; char *StrP; virtual bool ReMap(bool const &Errorchecks = true); @@ -438,11 +437,6 @@ struct pkgCache::Group */ struct pkgCache::Package { - /** \brief Name of the package - * Note that the access method Name() will remain. It is just this data member - * deprecated as this information is already stored and available via the - * associated Group – so it is wasting precious binary cache space */ - APT_DEPRECATED_MSG("Use the .Name() method instead of accessing the member directly") map_stringitem_t Name; /** \brief Architecture of the package */ map_stringitem_t Arch; /** \brief Base of a singly linked list of versions @@ -607,7 +601,6 @@ struct pkgCache::DescFile The version list is always sorted from highest version to lowest version by the generator. Equal version numbers are either merged or handled as separate versions based on the Hash value. */ -APT_IGNORE_DEPRECATED_PUSH struct pkgCache::Version { /** \brief complete version string */ @@ -630,9 +623,6 @@ struct pkgCache::Version AllForeign = All | Foreign, AllAllowed = All | Allowed }; - /** \brief deprecated variant of No */ - static const APT_DEPRECATED_MSG("The default value of the Multi-Arch field is no, not none") VerMultiArch None = No; - /** \brief stores the MultiArch capabilities of this version Flags used are defined in pkgCache::Version::VerMultiArch @@ -675,7 +665,6 @@ struct pkgCache::Version /** \brief parsed priority value */ map_number_t Priority; }; -APT_IGNORE_DEPRECATED_POP /*}}}*/ // Description structure /*{{{*/ /** \brief datamember of a linked list of available description for a version */ @@ -770,15 +759,6 @@ struct pkgCache::Provides map_pointer_t NextPkgProv; // Provides }; /*}}}*/ -// UNUSED StringItem structure /*{{{*/ -struct APT_DEPRECATED_MSG("No longer used in cache generation without a replacement") pkgCache::StringItem -{ - /** \brief string this refers to */ - map_ptrloc String; // StringItem - /** \brief Next link in the chain */ - map_ptrloc NextItem; // StringItem -}; - /*}}}*/ inline char const * pkgCache::NativeArch() { return StrP + HeaderP->Architecture; } diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc index 5a3b65b3a..c91fc322b 100644 --- a/apt-pkg/pkgcachegen.cc +++ b/apt-pkg/pkgcachegen.cc @@ -600,9 +600,6 @@ bool pkgCacheGenerator::NewPackage(pkgCache::PkgIterator &Pkg, StringView Name, Pkg = pkgCache::PkgIterator(Cache,Cache.PkgP + Package); // Set the name, arch and the ID - APT_IGNORE_DEPRECATED_PUSH - Pkg->Name = Grp->Name; - APT_IGNORE_DEPRECATED_POP Pkg->Group = Grp.Index(); // all is mapped to the native architecture map_stringitem_t const idxArch = (Arch == "all") ? Cache.HeaderP->Architecture : StoreString(MIXED, Arch); -- cgit v1.2.3 From 53414a347dbf42513c94b2cd475591d83983ee2b Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Mon, 4 Feb 2019 16:05:45 +0100 Subject: cacheiterators: Cleanup deprecated code --- apt-pkg/cacheiterators.h | 10 ---------- apt-pkg/pkgcache.cc | 40 +--------------------------------------- 2 files changed, 1 insertion(+), 49 deletions(-) (limited to 'apt-pkg') diff --git a/apt-pkg/cacheiterators.h b/apt-pkg/cacheiterators.h index 20853061e..27daf4c43 100644 --- a/apt-pkg/cacheiterators.h +++ b/apt-pkg/cacheiterators.h @@ -164,9 +164,6 @@ class pkgCache::PkgIterator: public Iterator { // Accessors inline const char *Name() const { return Group().Name(); } - // Versions have sections - and packages can have different versions with different sections - // so this interface is broken by design. Run as fast as you can to Version.Section(). - APT_DEPRECATED_MSG("Use the .Section method of VerIterator instead") inline const char *Section() const; inline bool Purge() const {return S->CurrentState == pkgCache::State::Purge || (S->CurrentVer == 0 && S->CurrentState == pkgCache::State::NotInstalled);} inline const char *Arch() const {return S->Arch == 0?0:Owner->StrP + S->Arch;} @@ -177,7 +174,6 @@ class pkgCache::PkgIterator: public Iterator { inline DepIterator RevDependsList() const APT_PURE; inline PrvIterator ProvidesList() const APT_PURE; OkState State() const APT_PURE; - APT_DEPRECATED_MSG("This method does not respect apt_preferences! Use pkgDepCache::GetCandidateVersion(Pkg)") const char *CandVersion() const APT_PURE; const char *CurVersion() const APT_PURE; //Nice printable representation @@ -422,8 +418,6 @@ class pkgCache::RlsFileIterator : public Iterator inline const char *Site() const {return S->Site == 0?0:Owner->StrP + S->Site;} inline bool Flagged(pkgCache::Flag::ReleaseFileFlags const flag) const {return (S->Flags & flag) == flag; } - APT_DEPRECATED_MSG("Can be remove without replacement; it is a no-op") - bool IsOk(); std::string RelStr(); // Constructors @@ -458,8 +452,6 @@ class pkgCache::PkgFileIterator : public Iterator inline const char *Architecture() const {return S->Architecture == 0?0:Owner->StrP + S->Architecture;} inline const char *IndexType() const {return S->IndexType == 0?0:Owner->StrP + S->IndexType;} - APT_DEPRECATED_MSG("Can be remove without replacement; it is a no-op") - bool IsOk(); std::string RelStr(); // Constructors @@ -525,7 +517,5 @@ inline pkgCache::VerFileIterator pkgCache::VerIterator::FileList() const {return VerFileIterator(*Owner,Owner->VerFileP + S->FileList);} inline pkgCache::DescFileIterator pkgCache::DescIterator::FileList() const {return DescFileIterator(*Owner,Owner->DescFileP + S->FileList);} -APT_DEPRECATED_MSG("Use the .Section method of VerIterator instead") inline const char * pkgCache::PkgIterator::Section() const - {return S->VersionList == 0 ? 0 : VersionList().Section();} /*}}}*/ #endif diff --git a/apt-pkg/pkgcache.cc b/apt-pkg/pkgcache.cc index 9af8d2d13..5819a9b4a 100644 --- a/apt-pkg/pkgcache.cc +++ b/apt-pkg/pkgcache.cc @@ -560,19 +560,6 @@ pkgCache::PkgIterator::OkState pkgCache::PkgIterator::State() const return NeedsNothing; } /*}}}*/ -// PkgIterator::CandVersion - Returns the candidate version string /*{{{*/ -// --------------------------------------------------------------------- -/* Return string representing of the candidate version. */ -const char * -pkgCache::PkgIterator::CandVersion() const -{ - //TargetVer is empty, so don't use it. - VerIterator version = pkgPolicy(Owner).GetCandidateVer(*this); - if (version.IsGood()) - return version.VerStr(); - return 0; -} - /*}}}*/ // PkgIterator::CurVersion - Returns the current version string /*{{{*/ // --------------------------------------------------------------------- /* Return string representing of the current version. */ @@ -598,15 +585,10 @@ operator<<(std::ostream& out, pkgCache::PkgIterator Pkg) return out << "invalid package"; string current = string(Pkg.CurVersion() == 0 ? "none" : Pkg.CurVersion()); -APT_IGNORE_DEPRECATED_PUSH - string candidate = string(Pkg.CandVersion() == 0 ? "none" : Pkg.CandVersion()); -APT_IGNORE_DEPRECATED_POP string newest = string(Pkg.VersionList().end() ? "none" : Pkg.VersionList().VerStr()); out << Pkg.Name() << " [ " << Pkg.Arch() << " ] < " << current; - if (current != candidate) - out << " -> " << candidate; - if ( newest != "none" && candidate != newest) + if ( newest != "none") out << " | " << newest; if (Pkg->VersionList == 0) out << " > ( none )"; @@ -1007,16 +989,6 @@ const char * pkgCache::VerIterator::MultiArchType() const return "none"; } /*}}}*/ -// RlsFileIterator::IsOk - Checks if the cache is in sync with the file /*{{{*/ -// --------------------------------------------------------------------- -/* This stats the file and compares its stats with the ones that were - stored during generation. Date checks should probably also be - included here. */ -bool pkgCache::RlsFileIterator::IsOk() -{ - return true; -} - /*}}}*/ // RlsFileIterator::RelStr - Return the release string /*{{{*/ string pkgCache::RlsFileIterator::RelStr() { @@ -1034,16 +1006,6 @@ string pkgCache::RlsFileIterator::RelStr() return Res; } /*}}}*/ -// PkgFileIterator::IsOk - Checks if the cache is in sync with the file /*{{{*/ -// --------------------------------------------------------------------- -/* This stats the file and compares its stats with the ones that were - stored during generation. Date checks should probably also be - included here. */ -bool pkgCache::PkgFileIterator::IsOk() -{ - return true; -} - /*}}}*/ string pkgCache::PkgFileIterator::RelStr() /*{{{*/ { std::string Res; -- cgit v1.2.3 From eeecbe521fdad69a924992f505d0a32b53800cfc Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 26 Feb 2019 11:33:11 +0100 Subject: upgrade: Remove deprecated functions --- apt-pkg/upgrade.cc | 23 +---------------------- apt-pkg/upgrade.h | 3 --- 2 files changed, 1 insertion(+), 25 deletions(-) (limited to 'apt-pkg') diff --git a/apt-pkg/upgrade.cc b/apt-pkg/upgrade.cc index c9432aa64..06c3751e0 100644 --- a/apt-pkg/upgrade.cc +++ b/apt-pkg/upgrade.cc @@ -119,12 +119,7 @@ static bool pkgDistUpgrade(pkgDepCache &Cache, OpProgress * const Progress) if (Progress != NULL) Progress->Done(); return success; -} -bool pkgDistUpgrade(pkgDepCache &Cache) -{ - return pkgDistUpgrade(Cache, NULL); -} - /*}}}*/ +} /*}}}*/ // AllUpgradeNoNewPackages - Upgrade but no removals or new pkgs /*{{{*/ static bool pkgAllUpgradeNoNewPackages(pkgDepCache &Cache, OpProgress * const Progress) { @@ -224,20 +219,6 @@ static bool pkgAllUpgradeWithNewPackages(pkgDepCache &Cache, OpProgress * const return success; } /*}}}*/ -// AllUpgrade - Upgrade as many packages as possible /*{{{*/ -// --------------------------------------------------------------------- -/* Right now the system must be consistent before this can be called. - It also will not change packages marked for install, it only tries - to install packages not marked for install */ -static bool pkgAllUpgrade(pkgDepCache &Cache, OpProgress * const Progress) -{ - return pkgAllUpgradeNoNewPackages(Cache, Progress); -} -bool pkgAllUpgrade(pkgDepCache &Cache) -{ - return pkgAllUpgrade(Cache, NULL); -} - /*}}}*/ // MinimizeUpgrade - Minimizes the set of packages to be upgraded /*{{{*/ // --------------------------------------------------------------------- /* This simply goes over the entire set of packages and tries to keep @@ -286,7 +267,6 @@ bool pkgMinimizeUpgrade(pkgDepCache &Cache) // APT::Upgrade::Upgrade - Upgrade using a specific strategy /*{{{*/ bool APT::Upgrade::Upgrade(pkgDepCache &Cache, int mode, OpProgress * const Progress) { -APT_IGNORE_DEPRECATED_PUSH if (mode == ALLOW_EVERYTHING) return pkgDistUpgrade(Cache, Progress); else if ((mode & ~FORBID_REMOVE_PACKAGES) == 0) @@ -295,7 +275,6 @@ APT_IGNORE_DEPRECATED_PUSH return pkgAllUpgradeNoNewPackages(Cache, Progress); else _error->Error("pkgAllUpgrade called with unsupported mode %i", mode); -APT_IGNORE_DEPRECATED_POP return false; } /*}}}*/ diff --git a/apt-pkg/upgrade.h b/apt-pkg/upgrade.h index 5612acfcb..c3d0852b2 100644 --- a/apt-pkg/upgrade.h +++ b/apt-pkg/upgrade.h @@ -28,8 +28,5 @@ namespace APT { } } -APT_DEPRECATED_MSG("Use APT::Upgrade::Upgrade() instead") bool pkgDistUpgrade(pkgDepCache &Cache); -APT_DEPRECATED_MSG("Use APT::Upgrade::Upgrade() instead") bool pkgAllUpgrade(pkgDepCache &Cache); - bool pkgMinimizeUpgrade(pkgDepCache &Cache); #endif -- cgit v1.2.3 From 29a63ffeffbecdb6dc3202cf0c42419d9a795735 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 26 Feb 2019 11:50:15 +0100 Subject: cachefile: Remove deprecated functions --- apt-pkg/cachefile.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'apt-pkg') diff --git a/apt-pkg/cachefile.h b/apt-pkg/cachefile.h index ed5d5c57c..998145ee6 100644 --- a/apt-pkg/cachefile.h +++ b/apt-pkg/cachefile.h @@ -65,13 +65,11 @@ class pkgCacheFile inline unsigned char &operator [](pkgCache::DepIterator const &I) const {return (*DCache)[I];}; bool BuildCaches(OpProgress *Progress = NULL,bool WithLock = true); - APT_DEPRECATED_MSG("Pass Progress in as a pointer") bool BuildCaches(OpProgress &Progress,bool const &WithLock = true) { return BuildCaches(&Progress, WithLock); }; bool BuildSourceList(OpProgress *Progress = NULL); bool BuildPolicy(OpProgress *Progress = NULL); bool BuildDepCache(OpProgress *Progress = NULL); bool Open(OpProgress *Progress = NULL, bool WithLock = true); inline bool ReadOnlyOpen(OpProgress *Progress = NULL) { return Open(Progress, false); }; - APT_DEPRECATED_MSG("Pass Progress in as a pointer") bool Open(OpProgress &Progress,bool const &WithLock = true) { return Open(&Progress, WithLock); }; static void RemoveCaches(); void Close(); -- cgit v1.2.3 From a65b59abbb1772bcee23c6374cad884ca9a6f769 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 26 Feb 2019 11:51:28 +0100 Subject: pkgrecords: Renive deprecated functions --- apt-pkg/pkgrecords.h | 4 ---- 1 file changed, 4 deletions(-) (limited to 'apt-pkg') diff --git a/apt-pkg/pkgrecords.h b/apt-pkg/pkgrecords.h index 6d1342d45..25cc07f2f 100644 --- a/apt-pkg/pkgrecords.h +++ b/apt-pkg/pkgrecords.h @@ -67,10 +67,6 @@ class pkgRecords::Parser /*{{{*/ * choose the hash to be used. */ virtual HashStringList Hashes() const { return HashStringList(); }; - APT_DEPRECATED_MSG("Use .Hashes instead of a hardcoded hash algorithm") std::string MD5Hash() const { return GetHashFromHashes("MD5Sum"); }; - APT_DEPRECATED_MSG("Use .Hashes instead of a hardcoded hash algorithm") std::string SHA1Hash() const { return GetHashFromHashes("SHA1"); }; - APT_DEPRECATED_MSG("Use .Hashes instead of a hardcoded hash algorithm") std::string SHA256Hash() const { return GetHashFromHashes("SHA256"); }; - APT_DEPRECATED_MSG("Use .Hashes instead of a hardcoded hash algorithm") std::string SHA512Hash() const { return GetHashFromHashes("SHA512"); }; // These are some general stats about the package virtual std::string Maintainer() {return std::string();}; -- cgit v1.2.3 From e217a3a425ba72e8b6ce395e1ecd411fbe58e916 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 26 Feb 2019 11:59:38 +0100 Subject: pkgSrcRecords::Parser: Fold Files2() into Files() This is possible now with the API break. Cleaner code, woohoo. --- apt-pkg/deb/debsrcrecords.cc | 41 +++-------------------------------------- apt-pkg/deb/debsrcrecords.h | 1 - apt-pkg/sourcelist.cc | 4 ++-- apt-pkg/srcrecords.cc | 30 ------------------------------ apt-pkg/srcrecords.h | 8 -------- 5 files changed, 5 insertions(+), 79 deletions(-) (limited to 'apt-pkg') diff --git a/apt-pkg/deb/debsrcrecords.cc b/apt-pkg/deb/debsrcrecords.cc index 9656fcac3..0b6cf1ff0 100644 --- a/apt-pkg/deb/debsrcrecords.cc +++ b/apt-pkg/deb/debsrcrecords.cc @@ -158,30 +158,7 @@ bool debSrcRecordParser::BuildDepends(std::vector &F) -{ - std::vector F2; - if (Files2(F2) == false) - return false; - for (std::vector::const_iterator f2 = F2.begin(); f2 != F2.end(); ++f2) - { - pkgSrcRecords::File2 f; -#if __GNUC__ >= 4 - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#endif - f.MD5Hash = f2->MD5Hash; - f.Size = f2->Size; -#if __GNUC__ >= 4 - #pragma GCC diagnostic pop -#endif - f.Path = f2->Path; - f.Type = f2->Type; - F.push_back(f); - } - return true; -} -bool debSrcRecordParser::Files2(std::vector &List) +bool debSrcRecordParser::Files(std::vector &List) { List.clear(); @@ -231,7 +208,7 @@ bool debSrcRecordParser::Files2(std::vector &List) path = Base + path; // look if we have a record for this file already - std::vector::iterator file = List.begin(); + std::vector::iterator file = List.begin(); for (; file != List.end(); ++file) if (file->Path == path) break; @@ -239,12 +216,6 @@ bool debSrcRecordParser::Files2(std::vector &List) // we have it already, store the new hash and be done if (file != List.end()) { - if (checksumField == "Files") - { - APT_IGNORE_DEPRECATED_PUSH - file->MD5Hash = hash; - APT_IGNORE_DEPRECATED_POP - } // an error here indicates that we have two different hashes for the same file if (file->Hashes.push_back(hashString) == false) return _error->Error("Error parsing checksum in %s of source package %s", checksumField.c_str(), Package().c_str()); @@ -252,18 +223,12 @@ bool debSrcRecordParser::Files2(std::vector &List) } // we haven't seen this file yet - pkgSrcRecords::File2 F; + pkgSrcRecords::File F; F.Path = path; F.FileSize = strtoull(size.c_str(), NULL, 10); F.Hashes.push_back(hashString); F.Hashes.FileSize(F.FileSize); - APT_IGNORE_DEPRECATED_PUSH - F.Size = F.FileSize; - if (checksumField == "Files") - F.MD5Hash = hash; - APT_IGNORE_DEPRECATED_POP - // Try to guess what sort of file it is we are getting. string::size_type Pos = F.Path.length()-1; while (1) diff --git a/apt-pkg/deb/debsrcrecords.h b/apt-pkg/deb/debsrcrecords.h index 45617f641..b572d3427 100644 --- a/apt-pkg/deb/debsrcrecords.h +++ b/apt-pkg/deb/debsrcrecords.h @@ -53,7 +53,6 @@ class APT_HIDDEN debSrcRecordParser : public pkgSrcRecords::Parser return std::string(Start,Stop); }; virtual bool Files(std::vector &F) APT_OVERRIDE; - bool Files2(std::vector &F); debSrcRecordParser(std::string const &File,pkgIndexFile const *Index); virtual ~debSrcRecordParser(); diff --git a/apt-pkg/sourcelist.cc b/apt-pkg/sourcelist.cc index a3d693151..5be8fbc0c 100644 --- a/apt-pkg/sourcelist.cc +++ b/apt-pkg/sourcelist.cc @@ -571,8 +571,8 @@ bool pkgSourceList::AddVolatileFile(std::string const &File, std::vector fileslst; - if (changes.Files2(fileslst) == false || fileslst.empty()) + std::vector fileslst; + if (changes.Files(fileslst) == false || fileslst.empty()) return false; auto const basedir = flNotFile(File); for (auto && file: fileslst) diff --git a/apt-pkg/srcrecords.cc b/apt-pkg/srcrecords.cc index 9d515ae75..a830a28f0 100644 --- a/apt-pkg/srcrecords.cc +++ b/apt-pkg/srcrecords.cc @@ -146,36 +146,6 @@ const char *pkgSrcRecords::Parser::BuildDepType(unsigned char const &Type) return fields[Type]; } /*}}}*/ -bool pkgSrcRecords::Parser::Files2(std::vector &F2)/*{{{*/ -{ - debSrcRecordParser * const deb = dynamic_cast(this); - if (deb != NULL) - return deb->Files2(F2); - - std::vector F; - if (Files(F) == false) - return false; - for (std::vector::const_iterator f = F.begin(); f != F.end(); ++f) - { - pkgSrcRecords::File2 f2; -#if __GNUC__ >= 4 - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#endif - f2.MD5Hash = f->MD5Hash; - f2.Size = f->Size; - f2.Hashes.push_back(HashString("MD5Sum", f->MD5Hash)); - f2.FileSize = f->Size; -#if __GNUC__ >= 4 - #pragma GCC diagnostic pop -#endif - f2.Path = f->Path; - f2.Type = f->Type; - F2.push_back(f2); - } - return true; -} - /*}}}*/ pkgSrcRecords::Parser::Parser(const pkgIndexFile *Index) : d(NULL), iIndex(Index) {} diff --git a/apt-pkg/srcrecords.h b/apt-pkg/srcrecords.h index 8c52f5683..77d648fa8 100644 --- a/apt-pkg/srcrecords.h +++ b/apt-pkg/srcrecords.h @@ -29,21 +29,14 @@ class pkgSrcRecords { public: -APT_IGNORE_DEPRECATED_PUSH // Describes a single file struct File { - APT_DEPRECATED_MSG("Use Hashes member instead of hardcoded hash algorithm") std::string MD5Hash; - APT_DEPRECATED_MSG("Use FileSize member instead") unsigned long Size; std::string Path; std::string Type; - }; - struct File2 : public File - { unsigned long long FileSize; HashStringList Hashes; }; -APT_IGNORE_DEPRECATED_POP // Abstract parser for each source record class Parser @@ -86,7 +79,6 @@ APT_IGNORE_DEPRECATED_POP static const char *BuildDepType(unsigned char const &Type) APT_PURE; virtual bool Files(std::vector &F) = 0; - bool Files2(std::vector &F); explicit Parser(const pkgIndexFile *Index); virtual ~Parser(); -- cgit v1.2.3 From eba6aa6b49bf23d1ece40389b3d2959f5d125f50 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 26 Feb 2019 12:04:55 +0100 Subject: clean: Fold pkgArchiveCleaner2 into pkgArchiveCleaner --- apt-pkg/clean.cc | 19 +------------------ apt-pkg/clean.h | 16 ++++------------ 2 files changed, 5 insertions(+), 30 deletions(-) (limited to 'apt-pkg') diff --git a/apt-pkg/clean.cc b/apt-pkg/clean.cc index f335554a3..9dd56e609 100644 --- a/apt-pkg/clean.cc +++ b/apt-pkg/clean.cc @@ -43,17 +43,9 @@ bool pkgArchiveCleaner::Go(std::string Dir,pkgCache &Cache) if (FileExists(Dir) == false) return true; - auto const withoutChangingDir = dynamic_cast(this); int const dirfd = open(Dir.c_str(), O_RDONLY | O_DIRECTORY | O_CLOEXEC); if (dirfd == -1) return _error->Errno("open",_("Unable to read %s"),Dir.c_str()); - std::string CWD; - if (withoutChangingDir == nullptr) - { - CWD = SafeGetCWD(); - if (fchdir(dirfd) != 0) - return _error->Errno("fchdir",_("Unable to change to %s"),Dir.c_str()); - } DIR * const D = fdopendir(dirfd); if (D == nullptr) return _error->Errno("opendir",_("Unable to read %s"),Dir.c_str()); @@ -131,18 +123,9 @@ bool pkgArchiveCleaner::Go(std::string Dir,pkgCache &Cache) continue; } - if (withoutChangingDir == nullptr) - { - APT_IGNORE_DEPRECATED_PUSH - Erase(Dir->d_name, Pkg, Ver, St); - APT_IGNORE_DEPRECATED_POP - } - else - withoutChangingDir->Erase(dirfd, Dir->d_name, Pkg, Ver, St); + Erase(dirfd, Dir->d_name, Pkg, Ver, St); } closedir(D); - if (withoutChangingDir == nullptr && chdir(CWD.c_str()) != 0) - return _error->Errno("chdir", _("Unable to change to %s"),Dir.c_str()); return true; } /*}}}*/ diff --git a/apt-pkg/clean.h b/apt-pkg/clean.h index d6490a0c5..a64e6a935 100644 --- a/apt-pkg/clean.h +++ b/apt-pkg/clean.h @@ -25,8 +25,9 @@ class pkgArchiveCleaner void * const d; protected: - - APT_DEPRECATED_MSG("Use pkgArchiveCleaner2 to avoid CWD expectations and chdir") virtual void Erase(const char * /*File*/,std::string /*Pkg*/,std::string /*Ver*/,struct stat & /*St*/) {}; + virtual void Erase(int const dirfd, char const * const File, + std::string const &Pkg,std::string const &Ver, + struct stat const &St) = 0; public: @@ -35,15 +36,6 @@ class pkgArchiveCleaner pkgArchiveCleaner(); virtual ~pkgArchiveCleaner(); }; -// TODO: merge classes and "erase" the old way -class pkgArchiveCleaner2: public pkgArchiveCleaner -{ - friend class pkgArchiveCleaner; -protected: - using pkgArchiveCleaner::Erase; - virtual void Erase(int const dirfd, char const * const File, - std::string const &Pkg,std::string const &Ver, - struct stat const &St) = 0; -}; + #endif -- cgit v1.2.3 From f4cae55a9ffaa80e339ab8a94e8737ba22f702e3 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 26 Feb 2019 12:07:36 +0100 Subject: indexfile: Remove deprecated translation functions --- apt-pkg/indexfile.cc | 26 -------------------------- apt-pkg/indexfile.h | 9 --------- 2 files changed, 35 deletions(-) (limited to 'apt-pkg') diff --git a/apt-pkg/indexfile.cc b/apt-pkg/indexfile.cc index 85d0e87cd..a7290c653 100644 --- a/apt-pkg/indexfile.cc +++ b/apt-pkg/indexfile.cc @@ -86,32 +86,6 @@ std::string pkgIndexFile::SourceInfo(pkgSrcRecords::Parser const &/*Record*/, return std::string(); } /*}}}*/ -// IndexFile::TranslationsAvailable - Check if will use Translation /*{{{*/ -bool pkgIndexFile::TranslationsAvailable() { - return (APT::Configuration::getLanguages().empty() != true); -} - /*}}}*/ -// IndexFile::CheckLanguageCode - Check the Language Code /*{{{*/ -bool pkgIndexFile::CheckLanguageCode(const char * const Lang) -{ - if (strlen(Lang) == 2 || (strlen(Lang) == 5 && Lang[2] == '_')) - return true; - - if (strcmp(Lang,"C") != 0) - _error->Warning("Wrong language code %s", Lang); - - return false; -} - /*}}}*/ -// IndexFile::LanguageCode - Return the Language Code /*{{{*/ -std::string pkgIndexFile::LanguageCode() { -APT_IGNORE_DEPRECATED_PUSH - if (TranslationsAvailable() == false) - return ""; - return APT::Configuration::getLanguages()[0]; -APT_IGNORE_DEPRECATED_POP -} - /*}}}*/ // IndexTarget - Constructor /*{{{*/ IndexTarget::IndexTarget(std::string const &MetaKey, std::string const &ShortDesc, diff --git a/apt-pkg/indexfile.h b/apt-pkg/indexfile.h index 31b95172e..d69d84d39 100644 --- a/apt-pkg/indexfile.h +++ b/apt-pkg/indexfile.h @@ -150,15 +150,6 @@ class pkgIndexFile virtual bool Merge(pkgCacheGenerator &/*Gen*/, OpProgress* const /*Prog*/) { return true; }; virtual pkgCache::PkgFileIterator FindInCache(pkgCache &Cache) const; - APT_DEPRECATED_MSG("These methods make no sense anymore with multi-language support") static bool TranslationsAvailable(); - /* No intern need for this method anymore as the check for correctness - is already done in getLanguages(). Note also that this check is - rather bad (doesn't take three character like ast into account).*/ - APT_DEPRECATED_MSG("These methods make no sense anymore with multi-language support") static bool CheckLanguageCode(const char * const Lang); - /* As we have now possibly more than one LanguageCode this method is - superseded by a) private classmembers or b) getLanguages() */ - APT_DEPRECATED_MSG("These methods make no sense anymore with multi-language support") static std::string LanguageCode(); - bool IsTrusted() const { return Trusted; }; explicit pkgIndexFile(bool const Trusted); -- cgit v1.2.3 From 975316780b2ba3d4e60592fac9d4eb99ffc4c924 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 26 Feb 2019 12:14:59 +0100 Subject: tagfile: Remove deprecated pkgUserTagSection and TFRewrite --- apt-pkg/tagfile.cc | 148 +---------------------------------------------------- apt-pkg/tagfile.h | 16 ------ 2 files changed, 2 insertions(+), 162 deletions(-) (limited to 'apt-pkg') diff --git a/apt-pkg/tagfile.cc b/apt-pkg/tagfile.cc index 1e7f2867c..4b6a5e78b 100644 --- a/apt-pkg/tagfile.cc +++ b/apt-pkg/tagfile.cc @@ -473,14 +473,12 @@ bool pkgTagFile::Jump(pkgTagSection &Tag,unsigned long long Offset) // pkgTagSection::pkgTagSection - Constructor /*{{{*/ // --------------------------------------------------------------------- /* */ -APT_IGNORE_DEPRECATED_PUSH pkgTagSection::pkgTagSection() : Section(0), d(new pkgTagSectionPrivate()), Stop(0) { memset(&AlphaIndexes, 0, sizeof(AlphaIndexes)); memset(&BetaIndexes, 0, sizeof(BetaIndexes)); } -APT_IGNORE_DEPRECATED_POP /*}}}*/ // TagSection::Scan - Scan for the end of the header information /*{{{*/ bool pkgTagSection::Scan(const char *Start,unsigned long MaxLength, bool const Restart) @@ -538,14 +536,12 @@ bool pkgTagSection::Scan(const char *Start,unsigned long MaxLength, bool const R } else { if (BetaIndexes[lastTagHash] != 0) lastTagData.NextInBucket = BetaIndexes[lastTagHash]; - APT_IGNORE_DEPRECATED_PUSH BetaIndexes[lastTagHash] = TagCount; - APT_IGNORE_DEPRECATED_POP } d->Tags.push_back(lastTagData); } - APT_IGNORE_DEPRECATED(++TagCount;) + ++TagCount; lastTagData = pkgTagSectionPrivate::TagData(Stop - Section); // find the colon separating tag and value char const * Colon = (char const *) memchr(Stop, ':', End - Stop); @@ -590,7 +586,7 @@ bool pkgTagSection::Scan(const char *Start,unsigned long MaxLength, bool const R } else { if (BetaIndexes[lastTagHash] != 0) lastTagData.NextInBucket = BetaIndexes[lastTagHash]; - APT_IGNORE_DEPRECATED(BetaIndexes[lastTagHash] = TagCount;) + BetaIndexes[lastTagHash] = TagCount; } d->Tags.push_back(lastTagData); } @@ -1065,146 +1061,6 @@ bool pkgTagSection::Write(FileFd &File, char const * const * const Order, std::v } /*}}}*/ -void pkgUserTagSection::TrimRecord(bool /*BeforeRecord*/, const char* &End)/*{{{*/ -{ - for (; Stop < End && (Stop[0] == '\n' || Stop[0] == '\r' || Stop[0] == '#'); Stop++) - if (Stop[0] == '#') - Stop = (const char*) memchr(Stop,'\n',End-Stop); -} - /*}}}*/ - #include "tagfile-order.c" -// TFRewrite - Rewrite a control record /*{{{*/ -// --------------------------------------------------------------------- -/* This writes the control record to stdout rewriting it as necessary. The - override map item specificies the rewriting rules to follow. This also - takes the time to sort the feild list. */ -APT_IGNORE_DEPRECATED_PUSH -bool TFRewrite(FILE *Output,pkgTagSection const &Tags,const char *Order[], - TFRewriteData *Rewrite) -{ - unsigned char Visited[256]; // Bit 1 is Order, Bit 2 is Rewrite - for (unsigned I = 0; I != 256; I++) - Visited[I] = 0; - - // Set new tag up as necessary. - for (unsigned int J = 0; Rewrite != 0 && Rewrite[J].Tag != 0; J++) - { - if (Rewrite[J].NewTag == 0) - Rewrite[J].NewTag = Rewrite[J].Tag; - } - - // Write all of the tags, in order. - if (Order != NULL) - { - for (unsigned int I = 0; Order[I] != 0; I++) - { - bool Rewritten = false; - - // See if this is a field that needs to be rewritten - for (unsigned int J = 0; Rewrite != 0 && Rewrite[J].Tag != 0; J++) - { - if (strcasecmp(Rewrite[J].Tag,Order[I]) == 0) - { - Visited[J] |= 2; - if (Rewrite[J].Rewrite != 0 && Rewrite[J].Rewrite[0] != 0) - { - if (isspace_ascii(Rewrite[J].Rewrite[0])) - fprintf(Output,"%s:%s\n",Rewrite[J].NewTag,Rewrite[J].Rewrite); - else - fprintf(Output,"%s: %s\n",Rewrite[J].NewTag,Rewrite[J].Rewrite); - } - Rewritten = true; - break; - } - } - - // See if it is in the fragment - unsigned Pos; - if (Tags.Find(StringView(Order[I]),Pos) == false) - continue; - Visited[Pos] |= 1; - - if (Rewritten == true) - continue; - - /* Write out this element, taking a moment to rewrite the tag - in case of changes of case. */ - const char *Start; - const char *Stop; - Tags.Get(Start,Stop,Pos); - - if (fputs(Order[I],Output) < 0) - return _error->Errno("fputs","IO Error to output"); - Start += strlen(Order[I]); - if (fwrite(Start,Stop - Start,1,Output) != 1) - return _error->Errno("fwrite","IO Error to output"); - if (Stop[-1] != '\n') - fprintf(Output,"\n"); - } - } - - // Now write all the old tags that were missed. - for (unsigned int I = 0; I != Tags.Count(); I++) - { - if ((Visited[I] & 1) == 1) - continue; - - const char *Start; - const char *Stop; - Tags.Get(Start,Stop,I); - const char *End = Start; - for (; End < Stop && *End != ':'; End++); - - // See if this is a field that needs to be rewritten - bool Rewritten = false; - for (unsigned int J = 0; Rewrite != 0 && Rewrite[J].Tag != 0; J++) - { - if (stringcasecmp(Start,End,Rewrite[J].Tag) == 0) - { - Visited[J] |= 2; - if (Rewrite[J].Rewrite != 0 && Rewrite[J].Rewrite[0] != 0) - { - if (isspace_ascii(Rewrite[J].Rewrite[0])) - fprintf(Output,"%s:%s\n",Rewrite[J].NewTag,Rewrite[J].Rewrite); - else - fprintf(Output,"%s: %s\n",Rewrite[J].NewTag,Rewrite[J].Rewrite); - } - - Rewritten = true; - break; - } - } - - if (Rewritten == true) - continue; - - // Write out this element - if (fwrite(Start,Stop - Start,1,Output) != 1) - return _error->Errno("fwrite","IO Error to output"); - if (Stop[-1] != '\n') - fprintf(Output,"\n"); - } - - // Now write all the rewrites that were missed - for (unsigned int J = 0; Rewrite != 0 && Rewrite[J].Tag != 0; J++) - { - if ((Visited[J] & 2) == 2) - continue; - - if (Rewrite[J].Rewrite != 0 && Rewrite[J].Rewrite[0] != 0) - { - if (isspace_ascii(Rewrite[J].Rewrite[0])) - fprintf(Output,"%s:%s\n",Rewrite[J].NewTag,Rewrite[J].Rewrite); - else - fprintf(Output,"%s: %s\n",Rewrite[J].NewTag,Rewrite[J].Rewrite); - } - } - - return true; -} -APT_IGNORE_DEPRECATED_POP - /*}}}*/ - pkgTagSection::~pkgTagSection() { delete d; } diff --git a/apt-pkg/tagfile.h b/apt-pkg/tagfile.h index 8b59c43de..de7bfcbaf 100644 --- a/apt-pkg/tagfile.h +++ b/apt-pkg/tagfile.h @@ -187,11 +187,6 @@ class pkgTagSection }; -class APT_DEPRECATED_MSG("Use pkgTagFile with the SUPPORT_COMMENTS flag instead") pkgUserTagSection : public pkgTagSection -{ - virtual void TrimRecord(bool BeforeRecord, const char* &End) APT_OVERRIDE; -}; - /** \class pkgTagFile reads and prepares a deb822 formatted file for parsing * via #pkgTagSection. The default mode tries to be as fast as possible and * assumes perfectly valid (machine generated) files like Packages. Support @@ -227,15 +222,4 @@ public: extern const char **TFRewritePackageOrder; extern const char **TFRewriteSourceOrder; -APT_IGNORE_DEPRECATED_PUSH -struct APT_DEPRECATED_MSG("Use pkgTagSection::Tag and pkgTagSection::Write() instead") TFRewriteData -{ - const char *Tag; - const char *Rewrite; - const char *NewTag; -}; -APT_DEPRECATED_MSG("Use pkgTagSection::Tag and pkgTagSection::Write() instead") bool TFRewrite(FILE *Output,pkgTagSection const &Tags,const char *Order[], - TFRewriteData *Rewrite); -APT_IGNORE_DEPRECATED_POP - #endif -- cgit v1.2.3 From 91e1f7d49830289d8e9d3fdd7ebbe7544a9838b8 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 26 Feb 2019 12:42:42 +0100 Subject: acquire: Fold pkgAcquireStatus2 into pkgAcquireStatus Clean up the code, make it neat, lalala --- apt-pkg/acquire.cc | 11 ++--------- apt-pkg/acquire.h | 14 +------------- 2 files changed, 3 insertions(+), 22 deletions(-) (limited to 'apt-pkg') diff --git a/apt-pkg/acquire.cc b/apt-pkg/acquire.cc index 541785b03..fc256b39e 100644 --- a/apt-pkg/acquire.cc +++ b/apt-pkg/acquire.cc @@ -1444,9 +1444,8 @@ void pkgAcquireStatus::Fetched(unsigned long long Size,unsigned long long Resume /*}}}*/ bool pkgAcquireStatus::ReleaseInfoChanges(metaIndex const * const LastRelease, metaIndex const * const CurrentRelease, std::vector &&Changes)/*{{{*/ { - auto const virt = dynamic_cast(this); - if (virt != nullptr) - return virt->ReleaseInfoChanges(LastRelease, CurrentRelease, std::move(Changes)); + (void) LastRelease; + (void) CurrentRelease; return ReleaseInfoChangesAsGlobalErrors(std::move(Changes)); } /*}}}*/ @@ -1464,12 +1463,6 @@ bool pkgAcquireStatus::ReleaseInfoChangesAsGlobalErrors(std::vector &&Changes) -{ - return ReleaseInfoChangesAsGlobalErrors(std::move(Changes)); -} -pkgAcquireStatus2::pkgAcquireStatus2() : pkgAcquireStatus() {} -pkgAcquireStatus2::~pkgAcquireStatus2() {} pkgAcquire::UriIterator::UriIterator(pkgAcquire::Queue *Q) : d(NULL), CurQ(Q), CurItem(0) diff --git a/apt-pkg/acquire.h b/apt-pkg/acquire.h index 1cf4da5bf..0b7b34d54 100644 --- a/apt-pkg/acquire.h +++ b/apt-pkg/acquire.h @@ -819,17 +819,13 @@ class pkgAcquireStatus * success it will print for each change the message attached to it via GlobalError either as an * error (if DefaultAction == false) or as a notice otherwise. * - * \b Note: To keep ABI compatibility for now this method isn't marked as - * virtual, but you can derive your class from #pkgAcquireStatus2 which has it - * marked as virtual. TODO on next ABI break: merge both classes. - * * @param LastRelease can be used to extract further information from the previous Release file * @param CurrentRelease can be used to extract further information from the current Release file * @param Changes is an array of changes alongside explanatory messages * which should be presented in some way to the user. * @return \b true if all changes are accepted by user, otherwise or if user can't be asked \b false */ - bool ReleaseInfoChanges(metaIndex const * const LastRelease, metaIndex const * const CurrentRelease, std::vector &&Changes); + virtual bool ReleaseInfoChanges(metaIndex const * const LastRelease, metaIndex const * const CurrentRelease, std::vector &&Changes); APT_HIDDEN static bool ReleaseInfoChangesAsGlobalErrors(std::vector &&Changes); /** \brief Invoked when an item is confirmed to be up-to-date. @@ -871,14 +867,6 @@ class pkgAcquireStatus /** \brief Initialize all counters to 0 and the time to the current time. */ pkgAcquireStatus(); virtual ~pkgAcquireStatus(); -}; -class pkgAcquireStatus2: public pkgAcquireStatus -{ -public: - virtual bool ReleaseInfoChanges(metaIndex const * const LastRelease, metaIndex const * const CurrentRelease, std::vector &&Changes); - - pkgAcquireStatus2(); - virtual ~pkgAcquireStatus2(); }; /*}}}*/ /** @} */ -- cgit v1.2.3 From a9182c8f789e7d19def3d6e178cb02bd9a46aa24 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 26 Feb 2019 12:44:26 +0100 Subject: acquire: Remove deprecated pkgAcquire::Setup() function --- apt-pkg/acquire.cc | 19 ------------------- apt-pkg/acquire.h | 14 -------------- 2 files changed, 33 deletions(-) (limited to 'apt-pkg') diff --git a/apt-pkg/acquire.cc b/apt-pkg/acquire.cc index fc256b39e..295af6eca 100644 --- a/apt-pkg/acquire.cc +++ b/apt-pkg/acquire.cc @@ -127,25 +127,6 @@ static bool SetupAPTPartialDirectory(std::string const &grand, std::string const return true; } -bool pkgAcquire::Setup(pkgAcquireStatus *Progress, string const &Lock) -{ - Log = Progress; - if (Lock.empty()) - { - string const listDir = _config->FindDir("Dir::State::lists"); - if (SetupAPTPartialDirectory(_config->FindDir("Dir::State"), listDir, "partial", 0700) == false) - return _error->Errno("Acquire", _("List directory %s is missing."), (listDir + "partial").c_str()); - if (SetupAPTPartialDirectory(_config->FindDir("Dir::State"), listDir, "auxfiles", 0755) == false) - { - // not being able to create lists/auxfiles isn't critical as we will use a tmpdir then - } - string const archivesDir = _config->FindDir("Dir::Cache::Archives"); - if (SetupAPTPartialDirectory(_config->FindDir("Dir::Cache"), archivesDir, "partial", 0700) == false) - return _error->Errno("Acquire", _("Archives directory %s is missing."), (archivesDir + "partial").c_str()); - return true; - } - return GetLock(Lock); -} bool pkgAcquire::GetLock(std::string const &Lock) { if (Lock.empty() == true) diff --git a/apt-pkg/acquire.h b/apt-pkg/acquire.h index 0b7b34d54..4d564daf5 100644 --- a/apt-pkg/acquire.h +++ b/apt-pkg/acquire.h @@ -353,20 +353,6 @@ class pkgAcquire */ unsigned long long PartialPresent(); - /** \brief Delayed constructor - * - * \param Progress indicator associated with this download or - * \b NULL for none. This object is not owned by the - * download process and will not be deleted when the pkgAcquire - * object is destroyed. Naturally, it should live for at least as - * long as the pkgAcquire object does. - * \param Lock defines a lock file that should be acquired to ensure - * only one Acquire class is in action at the time or an empty string - * if no lock file should be used. If set also all needed directories - * will be created. - */ - APT_DEPRECATED_MSG("Use constructors, .SetLog and .GetLock as needed") bool Setup(pkgAcquireStatus *Progress = NULL, std::string const &Lock = ""); - void SetLog(pkgAcquireStatus *Progress) { Log = Progress; } /** \brief acquire lock and perform directory setup -- cgit v1.2.3 From 4514f29a3ce0ef8cfdc9665c99ec64da762f6478 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 26 Feb 2019 12:46:26 +0100 Subject: algorithms: Remove deprecated ProblemResolver::InstallProtect() --- apt-pkg/algorithms.cc | 26 -------------------------- apt-pkg/algorithms.h | 2 -- 2 files changed, 28 deletions(-) (limited to 'apt-pkg') diff --git a/apt-pkg/algorithms.cc b/apt-pkg/algorithms.cc index bb0e2f873..4d4adde3c 100644 --- a/apt-pkg/algorithms.cc +++ b/apt-pkg/algorithms.cc @@ -1343,32 +1343,6 @@ bool pkgProblemResolver::ResolveByKeepInternal() return true; } /*}}}*/ -// ProblemResolver::InstallProtect - deprecated cpu-eating no-op /*{{{*/ -// --------------------------------------------------------------------- -/* Actions issued with FromUser bit set are protected from further - modification (expect by other calls with FromUser set) nowadays , so we - don't need to reissue actions here, they are already set in stone. */ -void pkgProblemResolver::InstallProtect() -{ - pkgDepCache::ActionGroup group(Cache); - - for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; ++I) - { - if ((Flags[I->ID] & Protected) == Protected) - { - if ((Flags[I->ID] & ToRemove) == ToRemove) - Cache.MarkDelete(I); - else - { - // preserve the information whether the package was auto - // or manually installed - bool autoInst = (Cache[I].Flags & pkgCache::Flag::Auto); - Cache.MarkInstall(I, false, 0, !autoInst); - } - } - } -} - /*}}}*/ // PrioSortList - Sort a list of versions by priority /*{{{*/ // --------------------------------------------------------------------- /* This is meant to be used in conjunction with AllTargets to get a list diff --git a/apt-pkg/algorithms.h b/apt-pkg/algorithms.h index c5c9f4c69..f6a1ce1fb 100644 --- a/apt-pkg/algorithms.h +++ b/apt-pkg/algorithms.h @@ -147,8 +147,6 @@ class pkgProblemResolver /*{{{*/ bool ResolveByKeep(OpProgress * const Progress = NULL); APT_HIDDEN bool ResolveByKeepInternal(); - APT_DEPRECATED_MSG("NOOP as MarkInstall enforces not overriding FromUser markings") void InstallProtect(); - explicit pkgProblemResolver(pkgDepCache *Cache); virtual ~pkgProblemResolver(); }; -- cgit v1.2.3 From 97bd7e492bad1ef50f2659faef61b409ffe67311 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 26 Feb 2019 12:53:04 +0100 Subject: metaindex: Remove deprecated checkSum::Hash (replaced by Hashes) --- apt-pkg/deb/debmetaindex.cc | 3 --- apt-pkg/metaindex.h | 4 ---- 2 files changed, 7 deletions(-) (limited to 'apt-pkg') diff --git a/apt-pkg/deb/debmetaindex.cc b/apt-pkg/deb/debmetaindex.cc index f88076abf..f2a6b97ad 100644 --- a/apt-pkg/deb/debmetaindex.cc +++ b/apt-pkg/deb/debmetaindex.cc @@ -510,9 +510,6 @@ bool debReleaseIndex::Load(std::string const &Filename, std::string * const Erro Sum->MetaKeyFilename = Name; Sum->Size = Size; Sum->Hashes.FileSize(Size); - APT_IGNORE_DEPRECATED_PUSH - Sum->Hash = hs; - APT_IGNORE_DEPRECATED_POP Entries[Name] = Sum; } Entries[Name]->Hashes.push_back(hs); diff --git a/apt-pkg/metaindex.h b/apt-pkg/metaindex.h index 08664305e..08affe888 100644 --- a/apt-pkg/metaindex.h +++ b/apt-pkg/metaindex.h @@ -30,16 +30,12 @@ class metaIndexPrivate; class metaIndex { public: - APT_IGNORE_DEPRECATED_PUSH struct checkSum { std::string MetaKeyFilename; HashStringList Hashes; unsigned long long Size; - - APT_DEPRECATED_MSG("Use the HashStringList member Hashes instead of a hardcoded HashString") HashString Hash; }; - APT_IGNORE_DEPRECATED_POP enum APT_HIDDEN TriState { TRI_YES, TRI_DONTCARE, TRI_NO, TRI_UNSET -- cgit v1.2.3 From f53a120320cd09d572658d424badc5485f1b9182 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 26 Feb 2019 12:57:46 +0100 Subject: hashes: Remove deprecated functions This keeps the members in the class, but makes them private. We want to migrate to libgcrypt eventually, since we already use libgcrypt through gpgv anyway. --- apt-pkg/contrib/hashes.cc | 21 --------------------- apt-pkg/contrib/hashes.h | 43 ++++++------------------------------------- 2 files changed, 6 insertions(+), 58 deletions(-) (limited to 'apt-pkg') diff --git a/apt-pkg/contrib/hashes.cc b/apt-pkg/contrib/hashes.cc index 98b92cc81..d03fb6083 100644 --- a/apt-pkg/contrib/hashes.cc +++ b/apt-pkg/contrib/hashes.cc @@ -312,7 +312,6 @@ bool Hashes::Add(const unsigned char * const Data, unsigned long long const Size if (Size == 0) return true; bool Res = true; -APT_IGNORE_DEPRECATED_PUSH if ((d->CalcHashes & MD5SUM) == MD5SUM) Res &= MD5.Add(Data, Size); if ((d->CalcHashes & SHA1SUM) == SHA1SUM) @@ -321,15 +320,9 @@ APT_IGNORE_DEPRECATED_PUSH Res &= SHA256.Add(Data, Size); if ((d->CalcHashes & SHA512SUM) == SHA512SUM) Res &= SHA512.Add(Data, Size); -APT_IGNORE_DEPRECATED_POP d->FileSize += Size; return Res; } -bool Hashes::Add(const unsigned char * const Data, unsigned long long const Size, unsigned int const Hashes) -{ - d->CalcHashes = Hashes; - return Add(Data, Size); -} bool Hashes::AddFD(int const Fd,unsigned long long Size) { unsigned char Buf[64*64]; @@ -349,11 +342,6 @@ bool Hashes::AddFD(int const Fd,unsigned long long Size) } return true; } -bool Hashes::AddFD(int const Fd,unsigned long long Size, unsigned int const Hashes) -{ - d->CalcHashes = Hashes; - return AddFD(Fd, Size); -} bool Hashes::AddFD(FileFd &Fd,unsigned long long Size) { unsigned char Buf[64*64]; @@ -377,17 +365,11 @@ bool Hashes::AddFD(FileFd &Fd,unsigned long long Size) return false; } return true; -} -bool Hashes::AddFD(FileFd &Fd,unsigned long long Size, unsigned int const Hashes) -{ - d->CalcHashes = Hashes; - return AddFD(Fd, Size); } /*}}}*/ HashStringList Hashes::GetHashStringList() { HashStringList hashes; -APT_IGNORE_DEPRECATED_PUSH if ((d->CalcHashes & MD5SUM) == MD5SUM) hashes.push_back(HashString("MD5Sum", MD5.Result().Value())); if ((d->CalcHashes & SHA1SUM) == SHA1SUM) @@ -396,13 +378,10 @@ APT_IGNORE_DEPRECATED_PUSH hashes.push_back(HashString("SHA256", SHA256.Result().Value())); if ((d->CalcHashes & SHA512SUM) == SHA512SUM) hashes.push_back(HashString("SHA512", SHA512.Result().Value())); -APT_IGNORE_DEPRECATED_POP hashes.FileSize(d->FileSize); return hashes; } -APT_IGNORE_DEPRECATED_PUSH Hashes::Hashes() : d(new PrivateHashes(~0)) { } Hashes::Hashes(unsigned int const Hashes) : d(new PrivateHashes(Hashes)) {} Hashes::Hashes(HashStringList const &Hashes) : d(new PrivateHashes(Hashes)) {} Hashes::~Hashes() { delete d; } -APT_IGNORE_DEPRECATED_POP diff --git a/apt-pkg/contrib/hashes.h b/apt-pkg/contrib/hashes.h index 28bfd3459..9ef2945d7 100644 --- a/apt-pkg/contrib/hashes.h +++ b/apt-pkg/contrib/hashes.h @@ -53,8 +53,6 @@ class HashString // get hash type used std::string HashType() const { return Type; }; std::string HashValue() const { return Hash; }; - APT_DEPRECATED_MSG("method was const-ified") std::string HashType() { return Type; }; - APT_DEPRECATED_MSG("method was const-ified") std::string HashValue() { return Hash; }; // verify the given filename against the currently loaded hash bool VerifyFile(std::string filename) const; @@ -182,19 +180,17 @@ class PrivateHashes; class Hashes { PrivateHashes * const d; - - public: - /* those will disappear in the future as it is hard to add new ones this way. + /* TODO: those will disappear in the future as it is hard to add new ones this way. * Use Add* to build the results and get them via GetHashStringList() instead */ - APT_DEPRECATED_MSG("Use general .Add* and .GetHashStringList methods instead of hardcoding specific hashes") MD5Summation MD5; - APT_DEPRECATED_MSG("Use general .Add* and .GetHashStringList methods instead of hardcoding specific hashes") SHA1Summation SHA1; - APT_DEPRECATED_MSG("Use general .Add* and .GetHashStringList methods instead of hardcoding specific hashes") SHA256Summation SHA256; - APT_DEPRECATED_MSG("Use general .Add* and .GetHashStringList methods instead of hardcoding specific hashes") SHA512Summation SHA512; + MD5Summation MD5; + SHA1Summation SHA1; + SHA256Summation SHA256; + SHA512Summation SHA512; + public: static const int UntilEOF = 0; bool Add(const unsigned char * const Data, unsigned long long const Size) APT_NONNULL(2); - APT_DEPRECATED_MSG("Construct accordingly instead of choosing hashes while adding") bool Add(const unsigned char * const Data, unsigned long long const Size, unsigned int const Hashes) APT_NONNULL(2); inline bool Add(const char * const Data) APT_NONNULL(2) {return Add(reinterpret_cast(Data),strlen(Data));}; inline bool Add(const unsigned char * const Beg,const unsigned char * const End) APT_NONNULL(2,3) @@ -203,13 +199,10 @@ class Hashes enum SupportedHashes { MD5SUM = (1 << 0), SHA1SUM = (1 << 1), SHA256SUM = (1 << 2), SHA512SUM = (1 << 3) }; bool AddFD(int const Fd,unsigned long long Size = 0); - APT_DEPRECATED_MSG("Construct accordingly instead of choosing hashes while adding") bool AddFD(int const Fd,unsigned long long Size, unsigned int const Hashes); bool AddFD(FileFd &Fd,unsigned long long Size = 0); - APT_DEPRECATED_MSG("Construct accordingly instead of choosing hashes while adding") bool AddFD(FileFd &Fd,unsigned long long Size, unsigned int const Hashes); HashStringList GetHashStringList(); -APT_IGNORE_DEPRECATED_PUSH /** create a Hashes object to calculate all supported hashes * * If ALL is too much, you can limit which Hashes are calculated @@ -221,30 +214,6 @@ APT_IGNORE_DEPRECATED_PUSH /** @param Hashes is a list of hashes */ Hashes(HashStringList const &Hashes); virtual ~Hashes(); -APT_IGNORE_DEPRECATED_POP - - private: - APT_HIDDEN APT_PURE inline unsigned int boolsToFlag(bool const addMD5, bool const addSHA1, bool const addSHA256, bool const addSHA512) - { - unsigned int hashes = ~0; - if (addMD5 == false) hashes &= ~MD5SUM; - if (addSHA1 == false) hashes &= ~SHA1SUM; - if (addSHA256 == false) hashes &= ~SHA256SUM; - if (addSHA512 == false) hashes &= ~SHA512SUM; - return hashes; - } - - public: -APT_IGNORE_DEPRECATED_PUSH - APT_DEPRECATED_MSG("Construct accordingly instead of choosing hashes while adding") bool AddFD(int const Fd, unsigned long long Size, bool const addMD5, - bool const addSHA1, bool const addSHA256, bool const addSHA512) { - return AddFD(Fd, Size, boolsToFlag(addMD5, addSHA1, addSHA256, addSHA512)); - }; - APT_DEPRECATED_MSG("Construct accordingly instead of choosing hashes while adding") bool AddFD(FileFd &Fd, unsigned long long Size, bool const addMD5, - bool const addSHA1, bool const addSHA256, bool const addSHA512) { - return AddFD(Fd, Size, boolsToFlag(addMD5, addSHA1, addSHA256, addSHA512)); - }; -APT_IGNORE_DEPRECATED_POP }; #endif -- cgit v1.2.3 From a969efb944ef9425b4b6a7b5cfe9104607f4f7ff Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 26 Feb 2019 12:59:27 +0100 Subject: indexcopy: Remove deprecated SigVerify::RunGPGV() --- apt-pkg/indexcopy.cc | 10 ---------- apt-pkg/indexcopy.h | 5 ----- 2 files changed, 15 deletions(-) (limited to 'apt-pkg') diff --git a/apt-pkg/indexcopy.cc b/apt-pkg/indexcopy.cc index 41cecdec1..9fa9361a3 100644 --- a/apt-pkg/indexcopy.cc +++ b/apt-pkg/indexcopy.cc @@ -640,16 +640,6 @@ bool SigVerify::CopyAndVerify(string CDROM,string Name,vector &SigList, return true; } /*}}}*/ -// SigVerify::RunGPGV - deprecated wrapper calling ExecGPGV /*{{{*/ -APT_NORETURN bool SigVerify::RunGPGV(std::string const &File, std::string const &FileOut, - int const &statusfd, int fd[2]) { - ExecGPGV(File, FileOut, statusfd, fd); -} -APT_NORETURN bool SigVerify::RunGPGV(std::string const &File, std::string const &FileOut, - int const &statusfd) { - ExecGPGV(File, FileOut, statusfd); -} - /*}}}*/ bool TranslationsCopy::CopyTranslations(string CDROM,string Name, /*{{{*/ vector &List, pkgCdromStatus *log) { diff --git a/apt-pkg/indexcopy.h b/apt-pkg/indexcopy.h index dc3b985a2..8dfd68d9a 100644 --- a/apt-pkg/indexcopy.h +++ b/apt-pkg/indexcopy.h @@ -116,11 +116,6 @@ class SigVerify /*{{{*/ bool CopyAndVerify(std::string CDROM,std::string Name,std::vector &SigList, std::vector PkgList,std::vector SrcList); - APT_DEPRECATED_MSG("Use ExecGPGV instead") static bool RunGPGV(std::string const &File, std::string const &FileOut, - int const &statusfd, int fd[2]); - APT_DEPRECATED_MSG("Use ExecGPGV instead") static bool RunGPGV(std::string const &File, std::string const &FileOut, - int const &statusfd = -1); - SigVerify(); virtual ~SigVerify(); }; -- cgit v1.2.3 From bf83608f21bc7da7a67db976658df0dff2e1dab5 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 26 Feb 2019 13:02:59 +0100 Subject: pkgcachegen: Remove deprecated functions --- apt-pkg/pkgcachegen.cc | 5 ----- apt-pkg/pkgcachegen.h | 4 ---- 2 files changed, 9 deletions(-) (limited to 'apt-pkg') diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc index c91fc322b..030f4df0a 100644 --- a/apt-pkg/pkgcachegen.cc +++ b/apt-pkg/pkgcachegen.cc @@ -1641,9 +1641,6 @@ static bool loadBackMMapFromFile(std::unique_ptr &Gen, Gen.reset(new pkgCacheGenerator(Map.get(),Progress)); return Gen->Start(); } -bool pkgMakeStatusCache(pkgSourceList &List,OpProgress &Progress, - MMap **OutMap, bool AllowMem) - { return pkgCacheGenerator::MakeStatusCache(List, &Progress, OutMap, AllowMem); } bool pkgCacheGenerator::MakeStatusCache(pkgSourceList &List,OpProgress *Progress, MMap **OutMap,bool) { @@ -1806,8 +1803,6 @@ public: ScopedErrorMerge() { _error->PushToStack(); } ~ScopedErrorMerge() { _error->MergeWithStack(); } }; -bool pkgMakeOnlyStatusCache(OpProgress &Progress,DynamicMMap **OutMap) - { return pkgCacheGenerator::MakeOnlyStatusCache(&Progress, OutMap); } bool pkgCacheGenerator::MakeOnlyStatusCache(OpProgress *Progress,DynamicMMap **OutMap) { std::vector Files; diff --git a/apt-pkg/pkgcachegen.h b/apt-pkg/pkgcachegen.h index e11e97e09..42ea3aa34 100644 --- a/apt-pkg/pkgcachegen.h +++ b/apt-pkg/pkgcachegen.h @@ -245,8 +245,4 @@ class APT_HIDDEN pkgCacheListParser }; /*}}}*/ -APT_DEPRECATED_MSG("Use pkgCacheGenerator::MakeStatusCache instead") bool pkgMakeStatusCache(pkgSourceList &List,OpProgress &Progress, - MMap **OutMap = 0,bool AllowMem = false); -APT_DEPRECATED_MSG("Use pkgCacheGenerator::MakeOnlyStatusCache instead") bool pkgMakeOnlyStatusCache(OpProgress &Progress,DynamicMMap **OutMap); - #endif -- cgit v1.2.3 From 0035243ae63ccb22476624ea4294798258377f85 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 26 Feb 2019 13:07:49 +0100 Subject: packagemanager: Remove deprecated functions --- apt-pkg/deb/dpkgpm.cc | 11 ----------- apt-pkg/deb/dpkgpm.h | 1 - apt-pkg/packagemanager.cc | 30 ------------------------------ apt-pkg/packagemanager.h | 5 ----- 4 files changed, 47 deletions(-) (limited to 'apt-pkg') diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc index 3c707e220..061badd88 100644 --- a/apt-pkg/deb/dpkgpm.cc +++ b/apt-pkg/deb/dpkgpm.cc @@ -1223,17 +1223,6 @@ void pkgDPkgPM::BuildPackagesProgressMap() ++PackagesTotal; } /*}}}*/ -bool pkgDPkgPM::Go(int StatusFd) /*{{{*/ -{ - APT::Progress::PackageManager *progress = NULL; - if (StatusFd == -1) - progress = APT::Progress::PackageManagerProgressFactory(); - else - progress = new APT::Progress::PackageManagerProgressFd(StatusFd); - - return Go(progress); -} - /*}}}*/ void pkgDPkgPM::StartPtyMagic() /*{{{*/ { if (_config->FindB("Dpkg::Use-Pty", true) == false) diff --git a/apt-pkg/deb/dpkgpm.h b/apt-pkg/deb/dpkgpm.h index c073b5024..f58bcef67 100644 --- a/apt-pkg/deb/dpkgpm.h +++ b/apt-pkg/deb/dpkgpm.h @@ -127,7 +127,6 @@ class pkgDPkgPM : public pkgPackageManager virtual bool Remove(PkgIterator Pkg,bool Purge = false) APT_OVERRIDE; virtual bool Go(APT::Progress::PackageManager *progress) APT_OVERRIDE; - APT_DEPRECATED_MSG("Use overload with explicit progress manager") virtual bool Go(int StatusFd=-1) APT_OVERRIDE; virtual void Reset() APT_OVERRIDE; diff --git a/apt-pkg/packagemanager.cc b/apt-pkg/packagemanager.cc index 156f7adb5..21905c7b6 100644 --- a/apt-pkg/packagemanager.cc +++ b/apt-pkg/packagemanager.cc @@ -632,10 +632,6 @@ bool pkgPackageManager::SmartConfigure(PkgIterator Pkg, int const Depth) // PM::EarlyRemove - Perform removal of packages before their time /*{{{*/ // --------------------------------------------------------------------- /* This is called to deal with conflicts arising from unpacking */ -bool pkgPackageManager::EarlyRemove(PkgIterator Pkg) -{ - return EarlyRemove(Pkg, NULL); -} bool pkgPackageManager::EarlyRemove(PkgIterator Pkg, DepIterator const * const Dep) { if (List->IsNow(Pkg) == false) @@ -1128,19 +1124,6 @@ pkgPackageManager::OrderResult pkgPackageManager::OrderInstall() return Completed; } -// PM::DoInstallPostFork - compat /*{{{*/ -// --------------------------------------------------------------------- - /*}}}*/ -pkgPackageManager::OrderResult -pkgPackageManager::DoInstallPostFork(int statusFd) -{ - APT::Progress::PackageManager *progress = new - APT::Progress::PackageManagerProgressFd(statusFd); - pkgPackageManager::OrderResult res = DoInstallPostFork(progress); - delete progress; - return res; -} - /*}}}*/ // PM::DoInstallPostFork - Does install part that happens after the fork /*{{{*/ // --------------------------------------------------------------------- pkgPackageManager::OrderResult @@ -1160,19 +1143,6 @@ pkgPackageManager::DoInstallPostFork(APT::Progress::PackageManager *progress) /*}}}*/ // PM::DoInstall - Does the installation /*{{{*/ // --------------------------------------------------------------------- -/* compat */ -pkgPackageManager::OrderResult -pkgPackageManager::DoInstall(int statusFd) -{ - APT::Progress::PackageManager *progress = new - APT::Progress::PackageManagerProgressFd(statusFd); - OrderResult res = DoInstall(progress); - delete progress; - return res; - } - /*}}}*/ -// PM::DoInstall - Does the installation /*{{{*/ -// --------------------------------------------------------------------- /* This uses the filenames in FileNames and the information in the DepCache to perform the installation of packages.*/ pkgPackageManager::OrderResult diff --git a/apt-pkg/packagemanager.h b/apt-pkg/packagemanager.h index d9443443d..9a06e2875 100644 --- a/apt-pkg/packagemanager.h +++ b/apt-pkg/packagemanager.h @@ -92,14 +92,12 @@ class pkgPackageManager : protected pkgCache::Namespace bool SmartUnPack(PkgIterator Pkg, bool const Immediate, int const Depth) APT_MUSTCHECK; bool SmartRemove(PkgIterator Pkg) APT_MUSTCHECK; bool EarlyRemove(PkgIterator Pkg, DepIterator const * const Dep) APT_MUSTCHECK; - APT_DEPRECATED bool EarlyRemove(PkgIterator Pkg) APT_MUSTCHECK; // The Actual installation implementation virtual bool Install(PkgIterator /*Pkg*/,std::string /*File*/) {return false;}; virtual bool Configure(PkgIterator /*Pkg*/) {return false;}; virtual bool Remove(PkgIterator /*Pkg*/,bool /*Purge*/=false) {return false;}; virtual bool Go(APT::Progress::PackageManager * /*progress*/) {return true;}; - APT_DEPRECATED_MSG("Use overload with explicit progress manager") virtual bool Go(int /*statusFd*/=-1) {return true;}; virtual void Reset() {}; @@ -114,8 +112,6 @@ class pkgPackageManager : protected pkgCache::Namespace // Do the installation OrderResult DoInstall(APT::Progress::PackageManager *progress); - // compat - APT_DEPRECATED_MSG("Use APT::Progress::PackageManager subclass instead of fd") OrderResult DoInstall(int statusFd=-1); friend bool EIPP::OrderInstall(char const * const planner, pkgPackageManager * const PM, unsigned int const version, OpProgress * const Progress); @@ -131,7 +127,6 @@ class pkgPackageManager : protected pkgCache::Namespace // stuff that needs to be done after the fork OrderResult DoInstallPostFork(APT::Progress::PackageManager *progress); // compat - APT_DEPRECATED_MSG("Use APT::Progress::PackageManager subclass instead of fd") OrderResult DoInstallPostFork(int statusFd=-1); // ? bool FixMissing(); -- cgit v1.2.3 From 7062f2a5a1bdb8c0e3c4b3b004e092046d1034ba Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 26 Feb 2019 13:10:14 +0100 Subject: depcache: Remove deprecated functions --- apt-pkg/depcache.cc | 15 --------------- apt-pkg/depcache.h | 4 ---- 2 files changed, 19 deletions(-) (limited to 'apt-pkg') diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc index 510f2d3f0..052e3de0e 100644 --- a/apt-pkg/depcache.cc +++ b/apt-pkg/depcache.cc @@ -1723,21 +1723,6 @@ void pkgDepCache::StateCache::Update(PkgIterator Pkg,pkgCache &Cache) Status = 2; } /*}}}*/ -// StateCache::StripEpoch - Remove the epoch specifier from the version /*{{{*/ -// --------------------------------------------------------------------- -/* */ -const char *pkgDepCache::StateCache::StripEpoch(const char *Ver) -{ - if (Ver == 0) - return 0; - - // Strip any epoch - char const * const I = strchr(Ver, ':'); - if (I == nullptr) - return Ver; - return I + 1; -} - /*}}}*/ // Policy::GetCandidateVer - Returns the Candidate install version /*{{{*/ // --------------------------------------------------------------------- /* The default just returns the highest available version that is not diff --git a/apt-pkg/depcache.h b/apt-pkg/depcache.h index 724bf566e..3013c0ddb 100644 --- a/apt-pkg/depcache.h +++ b/apt-pkg/depcache.h @@ -243,7 +243,6 @@ class pkgDepCache : protected pkgCache::Namespace unsigned char DepState; // DepState Flags // Update of candidate version - APT_DEPRECATED_MSG("Use the method of the same name in contrib/strutl.h instead if you must") const char *StripEpoch(const char *Ver) APT_PURE; void Update(PkgIterator Pkg,pkgCache &Cache); // Various test members for the current status of the package @@ -364,9 +363,6 @@ class pkgDepCache : protected pkgCache::Namespace inline pkgCache &GetCache() {return *Cache;}; inline pkgVersioningSystem &VS() {return *Cache->VS;}; - // Policy implementation - APT_DEPRECATED_MSG("Confusingly named method which returns the candidate as chosen by policy (NOT as chosen via .SetCandidateVersion!). You probably want to use .GetCandidateVersion instead.") inline VerIterator GetCandidateVer(PkgIterator const &Pkg) {return /* GetCandidateVersion(Pkg); but for API compat: */ LocalPolicy->GetCandidateVer(Pkg);}; - inline bool IsImportantDep(DepIterator Dep) const {return LocalPolicy->IsImportantDep(Dep);}; inline Policy &GetPolicy() {return *LocalPolicy;}; -- cgit v1.2.3 From 36adf6dd0504d7b280e93f5206d93ee5f7f13e84 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 26 Feb 2019 13:15:38 +0100 Subject: netrc: Remove deprecated function maybe_add_auth() --- apt-pkg/contrib/netrc.cc | 9 --------- apt-pkg/contrib/netrc.h | 2 -- 2 files changed, 11 deletions(-) (limited to 'apt-pkg') diff --git a/apt-pkg/contrib/netrc.cc b/apt-pkg/contrib/netrc.cc index 48114ba3c..ee1996f8d 100644 --- a/apt-pkg/contrib/netrc.cc +++ b/apt-pkg/contrib/netrc.cc @@ -142,15 +142,6 @@ bool MaybeAddAuth(FileFd &NetRCFile, URI &Uri) return false; } -void maybe_add_auth(URI &Uri, std::string NetRCFile) -{ - if (FileExists(NetRCFile) == false) - return; - FileFd fd; - if (fd.Open(NetRCFile, FileFd::ReadOnly)) - MaybeAddAuth(fd, Uri); -} - /* Check if we are authorized. */ bool IsAuthorized(pkgCache::PkgFileIterator const I, std::vector> &authconfs) { diff --git a/apt-pkg/contrib/netrc.h b/apt-pkg/contrib/netrc.h index 80d95acc1..96a5a0973 100644 --- a/apt-pkg/contrib/netrc.h +++ b/apt-pkg/contrib/netrc.h @@ -32,8 +32,6 @@ class URI; class FileFd; -APT_DEPRECATED_MSG("Use FileFd-based MaybeAddAuth instead") -void maybe_add_auth(URI &Uri, std::string NetRCFile); bool MaybeAddAuth(FileFd &NetRCFile, URI &Uri); bool IsAuthorized(pkgCache::PkgFileIterator const I, std::vector> &authconfs) APT_HIDDEN; #endif -- cgit v1.2.3 From 30d563c7a7ac68a0d2c1e765a1a43687d406c0d5 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 26 Feb 2019 13:20:21 +0100 Subject: sourceslist: Remove deprecated AddVolatileFiles() variant --- apt-pkg/sourcelist.cc | 17 ----------------- apt-pkg/sourcelist.h | 1 - 2 files changed, 18 deletions(-) (limited to 'apt-pkg') diff --git a/apt-pkg/sourcelist.cc b/apt-pkg/sourcelist.cc index 5be8fbc0c..eef4d8a7f 100644 --- a/apt-pkg/sourcelist.cc +++ b/apt-pkg/sourcelist.cc @@ -622,22 +622,5 @@ void pkgSourceList::AddVolatileFiles(CommandLine &CmdL, std::vector } return false; }); -} -void pkgSourceList::AddVolatileFiles(CommandLine &CmdL, std::vector * const VolatileCmdL) -{ - std::remove_if(CmdL.FileList + 1, CmdL.FileList + 1 + CmdL.FileSize(), [&](char const * const I) { - if (I != nullptr && (I[0] == '/' || (I[0] == '.' && (I[1] == '\0' || (I[1] == '.' && (I[2] == '\0' || I[2] == '/')) || I[1] == '/')))) - { - if (AddVolatileFile(I)) - { - if (VolatileCmdL != nullptr) - VolatileCmdL->push_back(I); - } - else - _error->Error(_("Unsupported file %s given on commandline"), I); - return true; - } - return false; - }); } /*}}}*/ diff --git a/apt-pkg/sourcelist.h b/apt-pkg/sourcelist.h index fedf90fa6..255c99868 100644 --- a/apt-pkg/sourcelist.h +++ b/apt-pkg/sourcelist.h @@ -131,7 +131,6 @@ class pkgSourceList void AddVolatileFile(pkgIndexFile * const File); bool AddVolatileFile(std::string const &File); bool AddVolatileFile(std::string const &File, std::vector * const VolatileCmdL); - APT_DEPRECATED_MSG("Use the overload with string-vector") void AddVolatileFiles(CommandLine &CmdL, std::vector * const VolatileCmdL); void AddVolatileFiles(CommandLine &CmdL, std::vector * const VolatileCmdL); /** @return list of files registered with #AddVolatileFile */ -- cgit v1.2.3 From 29465ea9555a453ca733280955505de8bfcce935 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 26 Feb 2019 13:21:07 +0100 Subject: sptr: Remove deprecated smart pointer classes Please use the standard C++ variants instead. --- apt-pkg/contrib/fileutl.cc | 1 - apt-pkg/contrib/sptr.h | 74 ---------------------------------------------- 2 files changed, 75 deletions(-) delete mode 100644 apt-pkg/contrib/sptr.h (limited to 'apt-pkg') diff --git a/apt-pkg/contrib/fileutl.cc b/apt-pkg/contrib/fileutl.cc index 0c0cb05ea..860739f68 100644 --- a/apt-pkg/contrib/fileutl.cc +++ b/apt-pkg/contrib/fileutl.cc @@ -25,7 +25,6 @@ #include #include #include -#include #include #include diff --git a/apt-pkg/contrib/sptr.h b/apt-pkg/contrib/sptr.h deleted file mode 100644 index 77806d94d..000000000 --- a/apt-pkg/contrib/sptr.h +++ /dev/null @@ -1,74 +0,0 @@ -// -*- mode: cpp; mode: fold -*- -// Description /*{{{*/ -/* ###################################################################### - - Trivial non-ref counted 'smart pointer' - - This is really only good to eliminate - { - delete Foo; - return; - } - - Blocks from functions. - - I think G++ has become good enough that doing this won't have much - code size implications. - - ##################################################################### */ - /*}}}*/ -#ifndef SMART_POINTER_H -#define SMART_POINTER_H -#include - -template -class APT_DEPRECATED_MSG("use std::unique_ptr instead") SPtr -{ - public: - T *Ptr; - - inline T *operator ->() {return Ptr;}; - inline T &operator *() {return *Ptr;}; - inline operator T *() {return Ptr;}; - inline operator void *() {return Ptr;}; - inline T *UnGuard() {T *Tmp = Ptr; Ptr = 0; return Tmp;}; - inline void operator =(T *N) {Ptr = N;}; - inline bool operator ==(T *lhs) const {return Ptr == lhs;}; - inline bool operator !=(T *lhs) const {return Ptr != lhs;}; - inline T*Get() {return Ptr;}; - - inline SPtr(T *Ptr) : Ptr(Ptr) {}; - inline SPtr() : Ptr(0) {}; - inline ~SPtr() {delete Ptr;}; -}; - -template -class APT_DEPRECATED_MSG("use std::unique_ptr instead") SPtrArray -{ - public: - T *Ptr; - - //inline T &operator *() {return *Ptr;}; - inline operator T *() {return Ptr;}; - inline operator void *() {return Ptr;}; - inline T *UnGuard() {T *Tmp = Ptr; Ptr = 0; return Tmp;}; - //inline T &operator [](signed long I) {return Ptr[I];}; - inline void operator =(T *N) {Ptr = N;}; - inline bool operator ==(T *lhs) const {return Ptr == lhs;}; - inline bool operator !=(T *lhs) const {return Ptr != lhs;}; - inline T *Get() {return Ptr;}; - - inline SPtrArray(T *Ptr) : Ptr(Ptr) {}; - inline SPtrArray() : Ptr(0) {}; -#if __GNUC__ >= 4 - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wunsafe-loop-optimizations" - // gcc warns about this, but we can do nothing here… -#endif - inline ~SPtrArray() {delete [] Ptr;}; -#if __GNUC__ >= 4 - #pragma GCC diagnostic pop -#endif -}; - -#endif -- cgit v1.2.3 From e9ac86f11b23310924058a045e0352b499c66d43 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 26 Feb 2019 13:26:14 +0100 Subject: edsp: Remove deprecated functions --- apt-pkg/edsp.cc | 330 +------------------------------------------------------- apt-pkg/edsp.h | 19 ---- 2 files changed, 2 insertions(+), 347 deletions(-) (limited to 'apt-pkg') diff --git a/apt-pkg/edsp.cc b/apt-pkg/edsp.cc index 2e39be377..0d5fe150b 100644 --- a/apt-pkg/edsp.cc +++ b/apt-pkg/edsp.cc @@ -73,52 +73,6 @@ template static bool WriteOkay(FileFd &output, Data&&... data) } /*}}}*/ // WriteScenarioVersion /*{{{*/ -static void WriteScenarioVersion(pkgDepCache &Cache, FILE* output, pkgCache::PkgIterator const &Pkg, - pkgCache::VerIterator const &Ver) -{ - fprintf(output, "Package: %s\n", Pkg.Name()); - fprintf(output, "Source: %s\n", Ver.SourcePkgName()); - fprintf(output, "Architecture: %s\n", Ver.Arch()); - fprintf(output, "Version: %s\n", Ver.VerStr()); - fprintf(output, "Source-Version: %s\n", Ver.SourceVerStr()); - if (Pkg.CurrentVer() == Ver) - fprintf(output, "Installed: yes\n"); - if (Pkg->SelectedState == pkgCache::State::Hold || - (Cache[Pkg].Keep() == true && Cache[Pkg].Protect() == true)) - fprintf(output, "Hold: yes\n"); - fprintf(output, "APT-ID: %d\n", Ver->ID); - if (PrioMap[Ver->Priority] != nullptr) - fprintf(output, "Priority: %s\n", PrioMap[Ver->Priority]); - if ((Pkg->Flags & pkgCache::Flag::Essential) == pkgCache::Flag::Essential) - fprintf(output, "Essential: yes\n"); - if (Ver->Section != 0) - fprintf(output, "Section: %s\n", Ver.Section()); - if ((Ver->MultiArch & pkgCache::Version::Allowed) == pkgCache::Version::Allowed) - fprintf(output, "Multi-Arch: allowed\n"); - else if ((Ver->MultiArch & pkgCache::Version::Foreign) == pkgCache::Version::Foreign) - fprintf(output, "Multi-Arch: foreign\n"); - else if ((Ver->MultiArch & pkgCache::Version::Same) == pkgCache::Version::Same) - fprintf(output, "Multi-Arch: same\n"); - std::set Releases; - for (pkgCache::VerFileIterator I = Ver.FileList(); I.end() == false; ++I) { - pkgCache::PkgFileIterator File = I.File(); - if (File.Flagged(pkgCache::Flag::NotSource) == false) { - string Release = File.RelStr(); - if (!Release.empty()) - Releases.insert(Release); - } - } - if (!Releases.empty()) { - fprintf(output, "APT-Release:\n"); - for (std::set::iterator R = Releases.begin(); R != Releases.end(); ++R) - fprintf(output, " %s\n", R->c_str()); - } - fprintf(output, "APT-Pin: %d\n", Cache.GetPolicy().GetPriority(Ver)); - if (Cache.GetCandidateVersion(Pkg) == Ver) - fprintf(output, "APT-Candidate: yes\n"); - if ((Cache[Pkg].Flags & pkgCache::Flag::Auto) == pkgCache::Flag::Auto) - fprintf(output, "APT-Automatic: yes\n"); -} static bool WriteScenarioVersion(FileFd &output, pkgCache::PkgIterator const &Pkg, pkgCache::VerIterator const &Ver) { @@ -138,44 +92,6 @@ static bool WriteScenarioVersion(FileFd &output, pkgCache::PkgIterator const &Pk } /*}}}*/ // WriteScenarioDependency /*{{{*/ -static void WriteScenarioDependency( FILE* output, pkgCache::VerIterator const &Ver) -{ - std::array dependencies; - bool orGroup = false; - for (pkgCache::DepIterator Dep = Ver.DependsList(); Dep.end() == false; ++Dep) - { - if (Dep.IsImplicit() == true) - continue; - if (orGroup == false) - dependencies[Dep->Type].append(", "); - dependencies[Dep->Type].append(Dep.TargetPkg().Name()); - if (Dep->Version != 0) - dependencies[Dep->Type].append(" (").append(pkgCache::CompTypeDeb(Dep->CompareOp)).append(" ").append(Dep.TargetVer()).append(")"); - if ((Dep->CompareOp & pkgCache::Dep::Or) == pkgCache::Dep::Or) - { - dependencies[Dep->Type].append(" | "); - orGroup = true; - } - else - orGroup = false; - } - for (size_t i = 1; i < dependencies.size(); ++i) - if (dependencies[i].empty() == false) - fprintf(output, "%s: %s\n", DepMap[i], dependencies[i].c_str()+2); - string provides; - for (pkgCache::PrvIterator Prv = Ver.ProvidesList(); Prv.end() == false; ++Prv) - { - if (Prv.IsMultiArchImplicit() == true) - continue; - if (provides.empty() == false) - provides.append(", "); - provides.append(Prv.Name()); - if (Prv->ProvideVersion != 0) - provides.append(" (= ").append(Prv.ProvideVersion()).append(")"); - } - if (provides.empty() == false) - fprintf(output, "Provides: %s\n", provides.c_str()); -} static bool WriteScenarioDependency(FileFd &output, pkgCache::VerIterator const &Ver, bool const OnlyCritical) { std::array dependencies; @@ -220,61 +136,6 @@ static bool WriteScenarioDependency(FileFd &output, pkgCache::VerIterator const } /*}}}*/ // WriteScenarioLimitedDependency /*{{{*/ -static void WriteScenarioLimitedDependency(FILE* output, - pkgCache::VerIterator const &Ver, - APT::PackageSet const &pkgset) -{ - std::array dependencies; - bool orGroup = false; - for (pkgCache::DepIterator Dep = Ver.DependsList(); Dep.end() == false; ++Dep) - { - if (Dep.IsImplicit() == true) - continue; - if (orGroup == false) - { - if (pkgset.find(Dep.TargetPkg()) == pkgset.end()) - continue; - if (dependencies[Dep->Type].empty() == false) - dependencies[Dep->Type].append(", "); - } - else if (pkgset.find(Dep.TargetPkg()) == pkgset.end()) - { - if ((Dep->CompareOp & pkgCache::Dep::Or) == pkgCache::Dep::Or) - continue; - dependencies[Dep->Type].erase(dependencies[Dep->Type].end()-3, dependencies[Dep->Type].end()); - orGroup = false; - continue; - } - dependencies[Dep->Type].append(Dep.TargetPkg().Name()); - if (Dep->Version != 0) - dependencies[Dep->Type].append(" (").append(pkgCache::CompTypeDeb(Dep->CompareOp)).append(" ").append(Dep.TargetVer()).append(")"); - if ((Dep->CompareOp & pkgCache::Dep::Or) == pkgCache::Dep::Or) - { - dependencies[Dep->Type].append(" | "); - orGroup = true; - } - else - orGroup = false; - } - for (size_t i = 1; i < dependencies.size(); ++i) - if (dependencies[i].empty() == false) - fprintf(output, "%s: %s\n", DepMap[i], dependencies[i].c_str()); - string provides; - for (pkgCache::PrvIterator Prv = Ver.ProvidesList(); Prv.end() == false; ++Prv) - { - if (Prv.IsMultiArchImplicit() == true) - continue; - if (pkgset.find(Prv.ParentPkg()) == pkgset.end()) - continue; - if (provides.empty() == false) - provides.append(", "); - provides.append(Prv.Name()); - if (Prv->ProvideVersion != 0) - provides.append(" (= ").append(Prv.ProvideVersion()).append(")"); - } - if (provides.empty() == false) - fprintf(output, "Provides: %s\n", provides.c_str()); -} static bool WriteScenarioLimitedDependency(FileFd &output, pkgCache::VerIterator const &Ver, std::vector const &pkgset, @@ -391,30 +252,6 @@ static bool WriteScenarioEDSPVersion(pkgDepCache &Cache, FileFd &output, pkgCach } /*}}}*/ // EDSP::WriteScenario - to the given file descriptor /*{{{*/ -bool EDSP::WriteScenario(pkgDepCache &Cache, FILE* output, OpProgress *Progress) -{ - if (Progress != NULL) - Progress->SubProgress(Cache.Head().VersionCount, _("Send scenario to solver")); - decltype(Cache.Head().VersionCount) p = 0; - std::vector archs = APT::Configuration::getArchitectures(); - for (pkgCache::PkgIterator Pkg = Cache.PkgBegin(); Pkg.end() == false; ++Pkg) - { - std::string const arch = Pkg.Arch(); - if (std::find(archs.begin(), archs.end(), arch) == archs.end()) - continue; - for (pkgCache::VerIterator Ver = Pkg.VersionList(); Ver.end() == false; ++Ver, ++p) - { - if (SkipUnavailableVersions(Cache, Pkg, Ver)) - continue; - WriteScenarioVersion(Cache, output, Pkg, Ver); - WriteScenarioDependency(output, Ver); - fprintf(output, "\n"); - if (Progress != NULL && p % 100 == 0) - Progress->Progress(p); - } - } - return true; -} bool EDSP::WriteScenario(pkgDepCache &Cache, FileFd &output, OpProgress *Progress) { if (Progress != NULL) @@ -443,28 +280,6 @@ bool EDSP::WriteScenario(pkgDepCache &Cache, FileFd &output, OpProgress *Progres } /*}}}*/ // EDSP::WriteLimitedScenario - to the given file descriptor /*{{{*/ -bool EDSP::WriteLimitedScenario(pkgDepCache &Cache, FILE* output, - APT::PackageSet const &pkgset, - OpProgress *Progress) -{ - if (Progress != NULL) - Progress->SubProgress(Cache.Head().VersionCount, _("Send scenario to solver")); - decltype(Cache.Head().PackageCount) p = 0; - for (APT::PackageSet::const_iterator Pkg = pkgset.begin(); Pkg != pkgset.end(); ++Pkg, ++p) - for (pkgCache::VerIterator Ver = Pkg.VersionList(); Ver.end() == false; ++Ver) - { - if (SkipUnavailableVersions(Cache, Pkg, Ver)) - continue; - WriteScenarioVersion(Cache, output, Pkg, Ver); - WriteScenarioLimitedDependency(output, Ver, pkgset); - fprintf(output, "\n"); - if (Progress != NULL && p % 100 == 0) - Progress->Progress(p); - } - if (Progress != NULL) - Progress->Done(); - return true; -} bool EDSP::WriteLimitedScenario(pkgDepCache &Cache, FileFd &output, std::vector const &pkgset, OpProgress *Progress) @@ -495,60 +310,6 @@ bool EDSP::WriteLimitedScenario(pkgDepCache &Cache, FileFd &output, } /*}}}*/ // EDSP::WriteRequest - to the given file descriptor /*{{{*/ -bool EDSP::WriteRequest(pkgDepCache &Cache, FILE* output, bool const Upgrade, - bool const DistUpgrade, bool const AutoRemove, - OpProgress *Progress) -{ - if (Progress != NULL) - Progress->SubProgress(Cache.Head().PackageCount, _("Send request to solver")); - decltype(Cache.Head().PackageCount) p = 0; - string del, inst; - for (pkgCache::PkgIterator Pkg = Cache.PkgBegin(); Pkg.end() == false; ++Pkg, ++p) - { - if (Progress != NULL && p % 100 == 0) - Progress->Progress(p); - string* req; - pkgDepCache::StateCache &P = Cache[Pkg]; - if (P.Delete() == true) - req = &del; - else if (P.NewInstall() == true || P.Upgrade() == true || P.ReInstall() == true || - (P.Mode == pkgDepCache::ModeKeep && (P.iFlags & pkgDepCache::Protected) == pkgDepCache::Protected)) - req = &inst; - else - continue; - req->append(" ").append(Pkg.FullName()); - } - fprintf(output, "Request: EDSP 0.5\n"); - - const char *arch = _config->Find("APT::Architecture").c_str(); - std::vector archs = APT::Configuration::getArchitectures(); - fprintf(output, "Architecture: %s\n", arch); - fprintf(output, "Architectures:"); - for (std::vector::const_iterator a = archs.begin(); a != archs.end(); ++a) - fprintf(output, " %s", a->c_str()); - fprintf(output, "\n"); - - if (del.empty() == false) - fprintf(output, "Remove: %s\n", del.c_str()+1); - if (inst.empty() == false) - fprintf(output, "Install: %s\n", inst.c_str()+1); - if (Upgrade == true) - fprintf(output, "Upgrade: yes\n"); - if (DistUpgrade == true) - fprintf(output, "Dist-Upgrade: yes\n"); - if (AutoRemove == true) - fprintf(output, "Autoremove: yes\n"); - auto const solver = _config->Find("APT::Solver", "internal"); - fprintf(output, "Solver: %s\n", solver.c_str()); - auto const solverconf = std::string("APT::Solver::") + solver + "::"; - if (_config->FindB(solverconf + "Strict-Pinning", _config->FindB("APT::Solver::Strict-Pinning", true)) == false) - fprintf(output, "Strict-Pinning: no\n"); - auto const solverpref = _config->Find(solverconf + "Preferences", _config->Find("APT::Solver::Preferences", "")); - if (solverpref.empty() == false) - fprintf(output, "Preferences: %s\n", solverpref.c_str()); - fprintf(output, "\n"); - return true; -} bool EDSP::WriteRequest(pkgDepCache &Cache, FileFd &output, unsigned int const flags, OpProgress *Progress) @@ -822,33 +583,7 @@ bool EDSP::ReadRequest(int const input, std::list &install, } } return false; -} -bool EDSP::ReadRequest(int const input, std::list &install, - std::list &remove, bool &upgrade, - bool &distUpgrade, bool &autoRemove) -{ - unsigned int flags; - auto const ret = ReadRequest(input, install, remove, flags); - autoRemove = (flags & Request::AUTOREMOVE); - if (flags & Request::UPGRADE_ALL) - { - if (flags & (Request::FORBID_NEW_INSTALL | Request::FORBID_REMOVE)) - { - upgrade = true; - distUpgrade = false; - } else { - upgrade = false; - distUpgrade = false; - } - } - else - { - upgrade = false; - distUpgrade = false; - } - return ret; -} - /*}}}*/ +} /*}}}*/ // EDSP::ApplyRequest - first stanza from the given file descriptor /*{{{*/ bool EDSP::ApplyRequest(std::list const &install, std::list const &remove, @@ -875,37 +610,6 @@ bool EDSP::ApplyRequest(std::list const &install, } /*}}}*/ // EDSP::WriteSolutionStanza - to the given file descriptor /*{{{*/ -bool EDSP::WriteSolution(pkgDepCache &Cache, FILE* output) -{ - bool const Debug = _config->FindB("Debug::EDSP::WriteSolution", false); - for (pkgCache::PkgIterator Pkg = Cache.PkgBegin(); Pkg.end() == false; ++Pkg) - { - if (Cache[Pkg].Delete() == true) - { - fprintf(output, "Remove: %d\n", _system->GetVersionMapping(Pkg.CurrentVer()->ID)); - if (Debug == true) - fprintf(output, "Package: %s\nVersion: %s\n", Pkg.FullName().c_str(), Pkg.CurrentVer().VerStr()); - } - else if (Cache[Pkg].NewInstall() == true || Cache[Pkg].Upgrade() == true) - { - pkgCache::VerIterator const CandVer = Cache.GetCandidateVersion(Pkg); - fprintf(output, "Install: %d\n", _system->GetVersionMapping(CandVer->ID)); - if (Debug == true) - fprintf(output, "Package: %s\nVersion: %s\n", Pkg.FullName().c_str(), CandVer.VerStr()); - } - else if (Cache[Pkg].Garbage == true) - { - fprintf(output, "Autoremove: %d\n", _system->GetVersionMapping(Pkg.CurrentVer()->ID)); - if (Debug == true) - fprintf(output, "Package: %s\nVersion: %s\n", Pkg.FullName().c_str(), Pkg.CurrentVer().VerStr()); - } - else - continue; - fprintf(output, "\n"); - } - - return true; -} bool EDSP::WriteSolutionStanza(FileFd &output, char const * const Type, pkgCache::VerIterator const &Ver) { bool Okay = output.Failed() == false; @@ -916,13 +620,6 @@ bool EDSP::WriteSolutionStanza(FileFd &output, char const * const Type, pkgCache } /*}}}*/ // EDSP::WriteProgess - pulse to the given file descriptor /*{{{*/ -bool EDSP::WriteProgress(unsigned short const percent, const char* const message, FILE* output) { - fprintf(output, "Progress: %s\n", TimeRFC1123(time(NULL), true).c_str()); - fprintf(output, "Percentage: %d\n", percent); - fprintf(output, "Message: %s\n\n", message); - fflush(output); - return true; -} bool EDSP::WriteProgress(unsigned short const percent, const char* const message, FileFd &output) { return WriteOkay(output, "Progress: ", TimeRFC1123(time(NULL), true), "\n", "Percentage: ", percent, "\n", @@ -934,11 +631,6 @@ static std::string formatMessage(std::string const &msg) { return SubstVar(SubstVar(APT::String::Strip(msg), "\n\n", "\n.\n"), "\n", "\n "); } -bool EDSP::WriteError(char const * const uuid, std::string const &message, FILE* output) { - fprintf(output, "Error: %s\n", uuid); - fprintf(output, "Message: %s\n\n", formatMessage(message).c_str()); - return true; -} bool EDSP::WriteError(char const * const uuid, std::string const &message, FileFd &output) { return WriteOkay(output, "Error: ", uuid, "\n", "Message: ", formatMessage(message), @@ -1019,11 +711,6 @@ static pid_t ExecuteExternal(char const* const type, char const * const binary, // EDSP::ExecuteSolver - fork requested solver and setup ipc pipes {{{*/ pid_t EDSP::ExecuteSolver(const char* const solver, int * const solver_in, int * const solver_out, bool) { return ExecuteExternal("solver", solver, "Dir::Bin::Solvers", solver_in, solver_out); -} -bool EDSP::ExecuteSolver(const char* const solver, int *solver_in, int *solver_out) { - if (ExecuteSolver(solver, solver_in, solver_out, true) == 0) - return false; - return true; } /*}}}*/ static bool CreateDumpFile(char const * const id, char const * const type, FileFd &output)/*{{{*/ @@ -1086,20 +773,7 @@ bool EDSP::ResolveExternal(const char* const solver, pkgDepCache &Cache, if (ExecWait(solver_pid, solver)) return ret; return false; -} -bool EDSP::ResolveExternal(const char* const solver, pkgDepCache &Cache, - bool const upgrade, bool const distUpgrade, - bool const autoRemove, OpProgress *Progress) { - unsigned int flags = 0; - if (autoRemove) - flags |= Request::AUTOREMOVE; - if (upgrade) - flags |= Request::UPGRADE_ALL | Request::FORBID_REMOVE | Request::FORBID_NEW_INSTALL; - if (distUpgrade) - flags |= Request::UPGRADE_ALL; - return ResolveExternal(solver, Cache, flags, Progress); -} - /*}}}*/ +} /*}}}*/ bool EIPP::OrderInstall(char const * const solver, pkgPackageManager * const PM, /*{{{*/ unsigned int const flags, OpProgress * const Progress) diff --git a/apt-pkg/edsp.h b/apt-pkg/edsp.h index 2f18d76eb..5eb72d48d 100644 --- a/apt-pkg/edsp.h +++ b/apt-pkg/edsp.h @@ -56,11 +56,6 @@ namespace EDSP /*{{{*/ bool WriteRequest(pkgDepCache &Cache, FileFd &output, unsigned int const flags = 0, OpProgress *Progress = NULL); - bool WriteRequest(pkgDepCache &Cache, FILE* output, - bool const upgrade = false, - bool const distUpgrade = false, - bool const autoRemove = false, - OpProgress *Progress = NULL) APT_DEPRECATED_MSG("Use FileFd-based interface instead"); /** \brief creates the scenario representing the package universe * @@ -80,7 +75,6 @@ namespace EDSP /*{{{*/ * \return true if universe was composed successfully, otherwise false */ bool WriteScenario(pkgDepCache &Cache, FileFd &output, OpProgress *Progress = NULL); - bool WriteScenario(pkgDepCache &Cache, FILE* output, OpProgress *Progress = NULL) APT_DEPRECATED_MSG("Use FileFd-based interface instead"); /** \brief creates a limited scenario representing the package universe * @@ -100,9 +94,6 @@ namespace EDSP /*{{{*/ bool WriteLimitedScenario(pkgDepCache &Cache, FileFd &output, std::vector const &pkgset, OpProgress *Progress = NULL); - bool WriteLimitedScenario(pkgDepCache &Cache, FILE* output, - APT::PackageSet const &pkgset, - OpProgress *Progress = NULL) APT_DEPRECATED_MSG("Use FileFd-based interface instead"); /** \brief waits and acts on the information returned from the solver * @@ -138,9 +129,6 @@ namespace EDSP /*{{{*/ */ bool ReadRequest(int const input, std::list &install, std::list &remove, unsigned int &flags); - APT_DEPRECATED_MSG("use the flag-based version instead") bool ReadRequest(int const input, std::list &install, - std::list &remove, bool &upgrade, - bool &distUpgrade, bool &autoRemove); /** \brief takes the request lists and applies it on the cache * @@ -171,7 +159,6 @@ namespace EDSP /*{{{*/ * \return true if stanza could be written, otherwise false */ bool WriteSolutionStanza(FileFd &output, char const * const Type, pkgCache::VerIterator const &Ver); - bool WriteSolution(pkgDepCache &Cache, FILE* output) APT_DEPRECATED_MSG("Use FileFd-based single-stanza interface instead"); /** \brief sends a progress report * @@ -180,7 +167,6 @@ namespace EDSP /*{{{*/ * \param output the front-end listens for progress report */ bool WriteProgress(unsigned short const percent, const char* const message, FileFd &output); - bool WriteProgress(unsigned short const percent, const char* const message, FILE* output) APT_DEPRECATED_MSG("Use FileFd-based interface instead"); /** \brief sends an error report * @@ -198,7 +184,6 @@ namespace EDSP /*{{{*/ * \param output the front-end listens for error messages */ bool WriteError(char const * const uuid, std::string const &message, FileFd &output); - bool WriteError(char const * const uuid, std::string const &message, FILE* output) APT_DEPRECATED_MSG("Use FileFd-based interface instead"); /** \brief executes the given solver and returns the pipe ends @@ -213,7 +198,6 @@ namespace EDSP /*{{{*/ * \return PID of the started solver or 0 if failure occurred */ pid_t ExecuteSolver(const char* const solver, int * const solver_in, int * const solver_out, bool /*overload*/); - APT_DEPRECATED_MSG("add a dummy bool parameter to use the overload returning a pid_t") bool ExecuteSolver(const char* const solver, int *solver_in, int *solver_out); /** \brief call an external resolver to handle the request * @@ -230,9 +214,6 @@ namespace EDSP /*{{{*/ bool ResolveExternal(const char* const solver, pkgDepCache &Cache, unsigned int const flags = 0, OpProgress *Progress = NULL); - APT_DEPRECATED_MSG("use the flag-based version instead") bool ResolveExternal(const char* const solver, pkgDepCache &Cache, - bool const upgrade, bool const distUpgrade, - bool const autoRemove, OpProgress *Progress = NULL); } /*}}}*/ class pkgPackageManager; -- cgit v1.2.3 From 88d3a9fde4ed1d1070ba0326569138f651cc60e8 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 26 Feb 2019 13:41:02 +0100 Subject: strutl: Remove deprecated functions --- apt-pkg/contrib/strutl.cc | 55 ----------------------------------------------- apt-pkg/contrib/strutl.h | 2 -- 2 files changed, 57 deletions(-) (limited to 'apt-pkg') diff --git a/apt-pkg/contrib/strutl.cc b/apt-pkg/contrib/strutl.cc index 50344d1fe..e854c5bf1 100644 --- a/apt-pkg/contrib/strutl.cc +++ b/apt-pkg/contrib/strutl.cc @@ -806,10 +806,6 @@ int StringToBool(const string &Text,int Default) // --------------------------------------------------------------------- /* This converts a time_t into a string time representation that is year 2000 compliant and timezone neutral */ -string TimeRFC1123(time_t Date) -{ - return TimeRFC1123(Date, false); -} string TimeRFC1123(time_t Date, bool const NumericTimezone) { struct tm Conv; @@ -1099,57 +1095,6 @@ bool FTPMDTMStrToTime(const char* const str,time_t &time) return true; } /*}}}*/ -// StrToTime - Converts a string into a time_t /*{{{*/ -// --------------------------------------------------------------------- -/* This handles all 3 popular time formats including RFC 1123, RFC 1036 - and the C library asctime format. It requires the GNU library function - 'timegm' to convert a struct tm in UTC to a time_t. For some bizzar - reason the C library does not provide any such function :< This also - handles the weird, but unambiguous FTP time format*/ -bool StrToTime(const string &Val,time_t &Result) -{ - struct tm Tm; - char Month[10]; - - // Skip the day of the week - const char *I = strchr(Val.c_str(), ' '); - - // Handle RFC 1123 time - Month[0] = 0; - if (sscanf(I," %2d %3s %4d %2d:%2d:%2d GMT",&Tm.tm_mday,Month,&Tm.tm_year, - &Tm.tm_hour,&Tm.tm_min,&Tm.tm_sec) != 6) - { - // Handle RFC 1036 time - if (sscanf(I," %2d-%3s-%3d %2d:%2d:%2d GMT",&Tm.tm_mday,Month, - &Tm.tm_year,&Tm.tm_hour,&Tm.tm_min,&Tm.tm_sec) == 6) - Tm.tm_year += 1900; - else - { - // asctime format - if (sscanf(I," %3s %2d %2d:%2d:%2d %4d",Month,&Tm.tm_mday, - &Tm.tm_hour,&Tm.tm_min,&Tm.tm_sec,&Tm.tm_year) != 6) - { - // 'ftp' time - if (sscanf(Val.c_str(),"%4d%2d%2d%2d%2d%2d",&Tm.tm_year,&Tm.tm_mon, - &Tm.tm_mday,&Tm.tm_hour,&Tm.tm_min,&Tm.tm_sec) != 6) - return false; - Tm.tm_mon--; - } - } - } - - Tm.tm_isdst = 0; - if (Month[0] != 0) - Tm.tm_mon = MonthConv(Month); - else - Tm.tm_mon = 0; // we don't have a month, so pick something - Tm.tm_year -= 1900; - - // Convert to local time and then to GMT - Result = timegm(&Tm); - return true; -} - /*}}}*/ // StrToNum - Convert a fixed length string to a number /*{{{*/ // --------------------------------------------------------------------- /* This is used in decoding the crazy fixed length string headers in diff --git a/apt-pkg/contrib/strutl.h b/apt-pkg/contrib/strutl.h index 9f74f8c2a..c25ce8054 100644 --- a/apt-pkg/contrib/strutl.h +++ b/apt-pkg/contrib/strutl.h @@ -66,7 +66,6 @@ std::string TimeToStr(unsigned long Sec); std::string Base64Encode(const std::string &Str); std::string OutputInDepth(const unsigned long Depth, const char* Separator=" "); std::string URItoFileName(const std::string &URI); -APT_DEPRECATED_MSG("Specify if GMT is required or a numeric timezone can be used") std::string TimeRFC1123(time_t Date); /** returns a datetime string as needed by HTTP/1.1 and Debian files. * * Note: The date will always be represented in a UTC timezone @@ -94,7 +93,6 @@ std::string TimeRFC1123(time_t Date, bool const NumericTimezone); */ bool RFC1123StrToTime(const char* const str,time_t &time) APT_MUSTCHECK; bool FTPMDTMStrToTime(const char* const str,time_t &time) APT_MUSTCHECK; -APT_DEPRECATED_MSG("Use RFC1123StrToTime or FTPMDTMStrToTime as needed instead") bool StrToTime(const std::string &Val,time_t &Result); std::string LookupTag(const std::string &Message,const char *Tag,const char *Default = 0); int StringToBool(const std::string &Text,int Default = -1); bool ReadMessages(int Fd, std::vector &List); -- cgit v1.2.3 From 680b916ce7203a40ebd0a3882b9a71ca77278a67 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 26 Feb 2019 13:44:23 +0100 Subject: fileutl: Remove deprecated functions such as gzFd() --- apt-pkg/contrib/fileutl.cc | 13 ------------- apt-pkg/contrib/fileutl.h | 15 --------------- 2 files changed, 28 deletions(-) (limited to 'apt-pkg') diff --git a/apt-pkg/contrib/fileutl.cc b/apt-pkg/contrib/fileutl.cc index 860739f68..d23e805e0 100644 --- a/apt-pkg/contrib/fileutl.cc +++ b/apt-pkg/contrib/fileutl.cc @@ -3014,19 +3014,6 @@ bool FileFd::FileFdError(const char *Description,...) { return false; } /*}}}*/ -gzFile FileFd::gzFd() { /*{{{*/ -#ifdef HAVE_ZLIB - GzipFileFdPrivate * const gzipd = dynamic_cast(d); - if (gzipd == nullptr) - return nullptr; - else - return gzipd->gz; -#else - return nullptr; -#endif -} - /*}}}*/ - // Glob - wrapper around "glob()" /*{{{*/ std::vector Glob(std::string const &pattern, int flags) { diff --git a/apt-pkg/contrib/fileutl.h b/apt-pkg/contrib/fileutl.h index 862880c31..bbfd0768e 100644 --- a/apt-pkg/contrib/fileutl.h +++ b/apt-pkg/contrib/fileutl.h @@ -133,20 +133,6 @@ class FileFd unsigned long long FileSize(); time_t ModificationTime(); - /* You want to use 'unsigned long long' if you are talking about a file - to be able to support large files (>2 or >4 GB) properly. - This shouldn't happen all to often for the indexes, but deb's might be… - And as the auto-conversation converts a 'unsigned long *' to a 'bool' - instead of 'unsigned long long *' we need to provide this explicitly - - otherwise applications magically start to fail… */ - bool Read(void *To,unsigned long long Size,unsigned long *Actual) APT_DEPRECATED_MSG("The Actual variable you pass in should be an unsigned long long") - { - unsigned long long R; - bool const T = Read(To, Size, &R); - *Actual = R; - return T; - } - bool Open(std::string FileName,unsigned int const Mode,CompressMode Compress,unsigned long const AccessMode = 0666); bool Open(std::string FileName,unsigned int const Mode,APT::Configuration::Compressor const &compressor,unsigned long const AccessMode = 0666); inline bool Open(std::string const &FileName,unsigned int const Mode, unsigned long const AccessMode = 0666) { @@ -163,7 +149,6 @@ class FileFd // Simple manipulators inline int Fd() {return iFd;}; inline void Fd(int fd) { OpenDescriptor(fd, ReadWrite);}; - gzFile gzFd() APT_DEPRECATED_MSG("Implementation detail, do not use to be able to support bzip2, xz and co") APT_PURE; inline bool IsOpen() {return iFd >= 0;}; inline bool Failed() {return (Flags & Fail) == Fail;}; -- cgit v1.2.3 From 5c812fa5c81bf3670f00bdb1c70a41aa5f11214c Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 26 Feb 2019 13:45:47 +0100 Subject: dpkgpm: Remove deprecated pkgDPkgPM::SendV2Pkgs() --- apt-pkg/deb/dpkgpm.cc | 4 ---- apt-pkg/deb/dpkgpm.h | 1 - 2 files changed, 5 deletions(-) (limited to 'apt-pkg') diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc index 061badd88..101571782 100644 --- a/apt-pkg/deb/dpkgpm.cc +++ b/apt-pkg/deb/dpkgpm.cc @@ -301,10 +301,6 @@ bool pkgDPkgPM::Remove(PkgIterator Pkg,bool Purge) // --------------------------------------------------------------------- /* This is part of the helper script communication interface, it sends very complete information down to the other end of the pipe.*/ -bool pkgDPkgPM::SendV2Pkgs(FILE *F) -{ - return SendPkgsInfo(F, 2); -} bool pkgDPkgPM::SendPkgsInfo(FILE * const F, unsigned int const &Version) { // This version of APT supports only v3, so don't sent higher versions diff --git a/apt-pkg/deb/dpkgpm.h b/apt-pkg/deb/dpkgpm.h index f58bcef67..67c141766 100644 --- a/apt-pkg/deb/dpkgpm.h +++ b/apt-pkg/deb/dpkgpm.h @@ -93,7 +93,6 @@ class pkgDPkgPM : public pkgPackageManager // Helpers bool RunScriptsWithPkgs(const char *Cnf); - APT_DEPRECATED_MSG("Use SendPkgInfo with the version as parameter instead") bool SendV2Pkgs(FILE *F); bool SendPkgsInfo(FILE * const F, unsigned int const &Version); void WriteHistoryTag(std::string const &tag, std::string value); std::string ExpandShortPackageName(pkgDepCache &Cache, -- cgit v1.2.3 From 9a67a621763485ab923d62c50dae12fe8fe2f49f Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 26 Feb 2019 13:46:34 +0100 Subject: orderlist: Remove deprecated VisitNode() variant --- apt-pkg/orderlist.h | 1 - 1 file changed, 1 deletion(-) (limited to 'apt-pkg') diff --git a/apt-pkg/orderlist.h b/apt-pkg/orderlist.h index 3fa02342b..bb21e1d7d 100644 --- a/apt-pkg/orderlist.h +++ b/apt-pkg/orderlist.h @@ -47,7 +47,6 @@ class pkgOrderList : protected pkgCache::Namespace bool Debug; // Main visit function - APT_DEPRECATED_MSG("Add a unique calling identifier as parameter for debugging output") bool VisitNode(PkgIterator Pkg) { return VisitNode(Pkg, "UNKNOWN"); }; bool VisitNode(PkgIterator Pkg, char const* from); bool VisitDeps(DepFunc F,PkgIterator Pkg); bool VisitRDeps(DepFunc F,PkgIterator Pkg); -- cgit v1.2.3 From 0dfacb3d014db4c9f337ce2be1a6997dbdc5bde1 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 26 Feb 2019 13:51:15 +0100 Subject: acquire-item: Remove deprecated members and functions --- apt-pkg/acquire-item.cc | 21 +++------------------ apt-pkg/acquire-item.h | 32 -------------------------------- 2 files changed, 3 insertions(+), 50 deletions(-) (limited to 'apt-pkg') diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index bb3bc1b56..cbfc91007 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -770,15 +770,13 @@ class APT_HIDDEN CleanupItem : public pkgAcqTransactionItem /*{{{*/ /*}}}*/ // Acquire::Item::Item - Constructor /*{{{*/ -APT_IGNORE_DEPRECATED_PUSH pkgAcquire::Item::Item(pkgAcquire * const owner) : - FileSize(0), PartialSize(0), Mode(0), ID(0), Complete(false), Local(false), + FileSize(0), PartialSize(0), ID(0), Complete(false), Local(false), QueueCounter(0), ExpectedAdditionalItems(0), Owner(owner), d(new Private()) { Owner->Add(this); Status = StatIdle; } -APT_IGNORE_DEPRECATED_POP /*}}}*/ // Acquire::Item::~Item - Destructor /*{{{*/ pkgAcquire::Item::~Item() @@ -1120,15 +1118,6 @@ bool pkgAcquire::Item::RenameOnError(pkgAcquire::Item::RenameOnErrorState const void pkgAcquire::Item::SetActiveSubprocess(const std::string &subprocess)/*{{{*/ { ActiveSubprocess = subprocess; - APT_IGNORE_DEPRECATED_PUSH - Mode = ActiveSubprocess.c_str(); - APT_IGNORE_DEPRECATED_POP -} - /*}}}*/ -// Acquire::Item::ReportMirrorFailure /*{{{*/ -void pkgAcquire::Item::ReportMirrorFailure(std::string const &FailCode) -{ - ReportMirrorFailureToCentral(*this, FailCode, FailCode); } /*}}}*/ std::string pkgAcquire::Item::HashSum() const /*{{{*/ @@ -3346,11 +3335,10 @@ pkgAcqIndex::~pkgAcqIndex() {} // --------------------------------------------------------------------- /* This just sets up the initial fetch environment and queues the first possibilitiy */ -APT_IGNORE_DEPRECATED_PUSH pkgAcqArchive::pkgAcqArchive(pkgAcquire *const Owner, pkgSourceList *const Sources, pkgRecords *const Recs, pkgCache::VerIterator const &Version, string &StoreFilename) : Item(Owner), d(NULL), LocalSource(false), Version(Version), Sources(Sources), Recs(Recs), - StoreFilename(StoreFilename), Vf(), + StoreFilename(StoreFilename), Trusted(false) { if (Version.Arch() == 0) @@ -3539,7 +3527,6 @@ pkgAcqArchive::pkgAcqArchive(pkgAcquire *const Owner, pkgSourceList *const Sourc Local = false; QueueURI(Desc); } -APT_IGNORE_DEPRECATED_POP /*}}}*/ bool pkgAcqArchive::QueueNext() /*{{{*/ { @@ -3865,11 +3852,10 @@ pkgAcqChangelog::~pkgAcqChangelog() /*{{{*/ /*}}}*/ // AcqFile::pkgAcqFile - Constructor /*{{{*/ -APT_IGNORE_DEPRECATED_PUSH pkgAcqFile::pkgAcqFile(pkgAcquire *const Owner, string const &URI, HashStringList const &Hashes, unsigned long long const Size, string const &Dsc, string const &ShortDesc, const string &DestDir, const string &DestFilename, - bool const IsIndexFile) : Item(Owner), d(NULL), Retries(0), IsIndexFile(IsIndexFile), ExpectedHashes(Hashes) + bool const IsIndexFile) : Item(Owner), d(NULL), IsIndexFile(IsIndexFile), ExpectedHashes(Hashes) { if(!DestFilename.empty()) DestFile = DestFilename; @@ -3900,7 +3886,6 @@ pkgAcqFile::pkgAcqFile(pkgAcquire *const Owner, string const &URI, HashStringLis QueueURI(Desc); } -APT_IGNORE_DEPRECATED_POP /*}}}*/ // AcqFile::Done - Item downloaded OK /*{{{*/ void pkgAcqFile::Done(string const &Message,HashStringList const &CalcHashes, diff --git a/apt-pkg/acquire-item.h b/apt-pkg/acquire-item.h index 70651d9e3..a45e9f7a4 100644 --- a/apt-pkg/acquire-item.h +++ b/apt-pkg/acquire-item.h @@ -102,11 +102,6 @@ class pkgAcquire::Item : public WeakPointable /*{{{*/ /** \brief How much of the object was already fetched. */ unsigned long long PartialSize; - /** \brief If not \b NULL, contains the name of a subprocess that - * is operating on this object (for instance, "gzip" or "gpgv"). - */ - APT_DEPRECATED_MSG("Use the std::string member ActiveSubprocess instead") const char *Mode; - /** \brief contains the name of the subprocess that is operating on this object * (for instance, "gzip", "rred" or "gpgv"). This is obsoleting #Mode from above * as it can manage the lifetime of included string properly. */ @@ -284,15 +279,6 @@ class pkgAcquire::Item : public WeakPointable /*{{{*/ /** \return \b true if this object is being fetched from a trusted source. */ virtual bool IsTrusted() const; - /** \brief Report mirror problem - * - * This allows reporting mirror failures back to a centralized - * server. The apt-report-mirror-failure script is called for this - * - * \param FailCode A short failure string that is send - */ - APT_DEPRECATED_MSG("Item::Failed does this for you") void ReportMirrorFailure(std::string const &FailCode); - /** \brief Set the name of the current active subprocess * * See also #ActiveSubprocess @@ -983,18 +969,6 @@ class pkgAcqArchive : public pkgAcquire::Item */ std::string &StoreFilename; - /** \brief The next file for this version to try to download. */ - APT_DEPRECATED_MSG("Unused member") - pkgCache::VerFileIterator Vf; - - /** \brief How many (more) times to try to find a new source from - * which to download this package version if it fails. - * - * Set from Acquire::Retries. - */ - APT_DEPRECATED_MSG("Unused member. See pkgAcqItem::Retries.") - unsigned int Retries; - /** \brief \b true if this version file is being downloaded from a * trusted source. */ @@ -1167,12 +1141,6 @@ class pkgAcqFile : public pkgAcquire::Item { void * const d; - /** \brief How many times to retry the download, set from - * Acquire::Retries. - */ - APT_DEPRECATED_MSG("Unused member. See pkgAcqItem::Retries.") - unsigned int Retries; - /** \brief Should this file be considered a index file */ bool IsIndexFile; -- cgit v1.2.3 From e1024dc0acf72b9615c0821f005364543775a58a Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 26 Feb 2019 14:36:42 +0100 Subject: fileutl: Merge Popen variants --- apt-pkg/contrib/fileutl.cc | 10 ---------- apt-pkg/contrib/fileutl.h | 4 +--- 2 files changed, 1 insertion(+), 13 deletions(-) (limited to 'apt-pkg') diff --git a/apt-pkg/contrib/fileutl.cc b/apt-pkg/contrib/fileutl.cc index d23e805e0..3b4a4a10c 100644 --- a/apt-pkg/contrib/fileutl.cc +++ b/apt-pkg/contrib/fileutl.cc @@ -3136,16 +3136,6 @@ bool Rename(std::string From, std::string To) /*{{{*/ return true; } /*}}}*/ -bool Popen(const char* Args[], FileFd &Fd, pid_t &Child, FileFd::OpenMode Mode)/*{{{*/ -{ - return Popen(Args, Fd, Child, Mode, true); -} - /*}}}*/ -bool Popen(const char* Args[], FileFd &Fd, pid_t &Child, FileFd::OpenMode Mode, bool CaptureStderr)/*{{{*/ -{ - return Popen(Args, Fd, Child, Mode, CaptureStderr, false); -} - /*}}}*/ bool Popen(const char *Args[], FileFd &Fd, pid_t &Child, FileFd::OpenMode Mode, bool CaptureStderr, bool Sandbox) /*{{{*/ { int fd; diff --git a/apt-pkg/contrib/fileutl.h b/apt-pkg/contrib/fileutl.h index bbfd0768e..fff49a757 100644 --- a/apt-pkg/contrib/fileutl.h +++ b/apt-pkg/contrib/fileutl.h @@ -279,9 +279,7 @@ std::vector Glob(std::string const &pattern, int flags=0); * \param Sandbox True if this should run sandboxed * \return true on success, false on failure with _error set */ -bool Popen(const char *Args[], FileFd &Fd, pid_t &Child, FileFd::OpenMode Mode, bool CaptureStderr, bool Sandbox) APT_HIDDEN; -bool Popen(const char* Args[], FileFd &Fd, pid_t &Child, FileFd::OpenMode Mode, bool CaptureStderr); -bool Popen(const char* Args[], FileFd &Fd, pid_t &Child, FileFd::OpenMode Mode); +bool Popen(const char *Args[], FileFd &Fd, pid_t &Child, FileFd::OpenMode Mode, bool CaptureStderr = true, bool Sandbox = false); APT_HIDDEN bool OpenConfigurationFileFd(std::string const &File, FileFd &Fd); -- cgit v1.2.3