// Fork and reap gzip
bool StartGzip();
bool Done();
- APT_DEPRECATED bool Done(bool Force); // Force is ignored – and the default behaviour
+ APT_DEPRECATED_MSG("Parameter Force is ignored, use Done() instead.") bool Done(bool Force);
public:
/** \brief If not \b NULL, contains the name of a subprocess that
* is operating on this object (for instance, "gzip" or "gpgv").
*/
- APT_DEPRECATED const char *Mode;
+ 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
* if no lock file should be used. If set also all needed directories
* will be created.
*/
- APT_DEPRECATED bool Setup(pkgAcquireStatus *Progress = NULL, std::string const &Lock = "");
+ 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; }
// Try to resolve problems only by using keep
bool ResolveByKeep(OpProgress * const Progress = NULL);
- APT_DEPRECATED void InstallProtect();
+ APT_DEPRECATED_MSG("NOOP as MarkInstall enforces not overriding FromUser markings") void InstallProtect();
explicit pkgProblemResolver(pkgDepCache *Cache);
virtual ~pkgProblemResolver();
inline unsigned char &operator [](pkgCache::DepIterator const &I) const {return (*DCache)[I];};
bool BuildCaches(OpProgress *Progress = NULL,bool WithLock = true);
- APT_DEPRECATED bool BuildCaches(OpProgress &Progress,bool const &WithLock = true) { return BuildCaches(&Progress, WithLock); };
+ 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 bool Open(OpProgress &Progress,bool const &WithLock = true) { return Open(&Progress, WithLock); };
+ 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();
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 inline const char *Section() const;
+ 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;}
{return VerFileIterator(*Owner,Owner->VerFileP + S->FileList);}
inline pkgCache::DescFileIterator pkgCache::DescIterator::FileList() const
{return DescFileIterator(*Owner,Owner->DescFileP + S->FileList);}
-APT_DEPRECATED inline const char * pkgCache::PkgIterator::Section() const
+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
pkgCacheFile &Cache, const char * cmdline,
std::list<PkgModifier> const &mods);
- // use PackageFrom(PACKAGENAME, …) instead
- APT_DEPRECATED pkgCache::PkgIterator PackageFromName(pkgCacheFile &Cache, std::string const &pattern);
+ APT_DEPRECATED_MSG("use .PackageFrom(PACKAGENAME, …) instead") pkgCache::PkgIterator PackageFromName(pkgCacheFile &Cache, std::string const &pattern);
/** \brief be notified about the package being selected via pattern
*
*/
virtual void showPackageSelection(pkgCache::PkgIterator const &pkg, PkgSelector const select, std::string const &pattern);
// use the method above instead, react only on the type you need and let the base handle the rest if need be
- // this allows use to add new selection methods without breaking the ABI constantly with new virtual methods
- APT_DEPRECATED virtual void showTaskSelection(pkgCache::PkgIterator const &pkg, std::string const &pattern);
- APT_DEPRECATED virtual void showRegExSelection(pkgCache::PkgIterator const &pkg, std::string const &pattern);
- APT_DEPRECATED virtual void showFnmatchSelection(pkgCache::PkgIterator const &pkg, std::string const &pattern);
+ // this allows us to add new selection methods without breaking the ABI constantly with new virtual methods
+ APT_DEPRECATED_MSG("override .showPackageSelection and select with switch") virtual void showTaskSelection(pkgCache::PkgIterator const &pkg, std::string const &pattern);
+ APT_DEPRECATED_MSG("override .showPackageSelection and select with switch") virtual void showRegExSelection(pkgCache::PkgIterator const &pkg, std::string const &pattern);
+ APT_DEPRECATED_MSG("override .showPackageSelection and select with switch") virtual void showFnmatchSelection(pkgCache::PkgIterator const &pkg, std::string const &pattern);
/** \brief be notified if a package can't be found via pattern
*
*/
virtual void canNotFindPackage(enum PkgSelector const select, PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string const &pattern);
// same as above for showPackageSelection
- APT_DEPRECATED virtual void canNotFindTask(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string pattern);
- APT_DEPRECATED virtual void canNotFindRegEx(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string pattern);
- APT_DEPRECATED virtual void canNotFindFnmatch(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string pattern);
- APT_DEPRECATED virtual void canNotFindPackage(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string const &str);
+ APT_DEPRECATED_MSG("override .canNotFindPackage and select with switch") virtual void canNotFindTask(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string pattern);
+ APT_DEPRECATED_MSG("override .canNotFindPackage and select with switch") virtual void canNotFindRegEx(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string pattern);
+ APT_DEPRECATED_MSG("override .canNotFindPackage and select with switch") virtual void canNotFindFnmatch(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string pattern);
+ APT_DEPRECATED_MSG("override .canNotFindPackage and select with switch") virtual void canNotFindPackage(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string const &str);
/** \brief specifies which version(s) we want to refer to */
enum VerSelector {
*/
virtual void showVersionSelection(pkgCache::PkgIterator const &Pkg, pkgCache::VerIterator const &Ver,
enum VerSelector const select, std::string const &pattern);
- // renamed to have a similar interface to showPackageSelection
- APT_DEPRECATED virtual void showSelectedVersion(pkgCache::PkgIterator const &Pkg, pkgCache::VerIterator const Ver,
+ APT_DEPRECATED_MSG("use .showVersionSelection instead, similar to .showPackageSelection") virtual void showSelectedVersion(pkgCache::PkgIterator const &Pkg, pkgCache::VerIterator const Ver,
std::string const &ver, bool const verIsRel);
/** \brief be notified if a version can't be found for a package
* \param Pkg is the package we wanted a version from
*/
virtual void canNotFindVersion(enum VerSelector const select, VersionContainerInterface * const vci, pkgCacheFile &Cache, pkgCache::PkgIterator const &Pkg);
- // same as above for showPackageSelection
- APT_DEPRECATED virtual void canNotFindAllVer(VersionContainerInterface * const vci, pkgCacheFile &Cache, pkgCache::PkgIterator const &Pkg);
- APT_DEPRECATED virtual void canNotFindInstCandVer(VersionContainerInterface * const vci, pkgCacheFile &Cache,
+ APT_DEPRECATED_MSG("override .canNotFindVersion and select via switch") virtual void canNotFindAllVer(VersionContainerInterface * const vci, pkgCacheFile &Cache, pkgCache::PkgIterator const &Pkg);
+ APT_DEPRECATED_MSG("override .canNotFindVersion and select via switch") virtual void canNotFindInstCandVer(VersionContainerInterface * const vci, pkgCacheFile &Cache,
pkgCache::PkgIterator const &Pkg);
- APT_DEPRECATED virtual void canNotFindCandInstVer(VersionContainerInterface * const vci,
+ APT_DEPRECATED_MSG("override .canNotFindVersion and select via switch") virtual void canNotFindCandInstVer(VersionContainerInterface * const vci,
pkgCacheFile &Cache,
pkgCache::PkgIterator const &Pkg);
// the difference between canNotFind and canNotGet is that the later is more low-level
// and called from other places: In this case looking into the code is the only real answer…
virtual pkgCache::VerIterator canNotGetVersion(enum VerSelector const select, pkgCacheFile &Cache, pkgCache::PkgIterator const &Pkg);
- // same as above for showPackageSelection
- APT_DEPRECATED virtual pkgCache::VerIterator canNotFindNewestVer(pkgCacheFile &Cache,
+ APT_DEPRECATED_MSG("override .canNotGetVersion and select via switch") virtual pkgCache::VerIterator canNotFindNewestVer(pkgCacheFile &Cache,
pkgCache::PkgIterator const &Pkg);
- APT_DEPRECATED virtual pkgCache::VerIterator canNotFindCandidateVer(pkgCacheFile &Cache,
+ APT_DEPRECATED_MSG("override .canNotGetVersion and select via switch") virtual pkgCache::VerIterator canNotFindCandidateVer(pkgCacheFile &Cache,
pkgCache::PkgIterator const &Pkg);
- APT_DEPRECATED virtual pkgCache::VerIterator canNotFindInstalledVer(pkgCacheFile &Cache,
+ APT_DEPRECATED_MSG("override .canNotGetVersion and select via switch") virtual pkgCache::VerIterator canNotFindInstalledVer(pkgCacheFile &Cache,
pkgCache::PkgIterator const &Pkg);
virtual pkgCache::PkgIterator canNotFindPkgName(pkgCacheFile &Cache, std::string const &str);
inline const char *Name() const {return getType().Name(); }
inline std::string FullName(bool const Pretty) const { return getType().FullName(Pretty); }
inline std::string FullName() const { return getType().FullName(); }
- APT_DEPRECATED inline const char *Section() const {
+ APT_DEPRECATED_MSG("Use the .Section method of VerIterator instead") inline const char *Section() const {
APT_IGNORE_DEPRECATED_PUSH
return getType().Section();
APT_IGNORE_DEPRECATED_POP
virtual void clear() = 0;
virtual size_t size() const = 0;
- // FIXME: This is a bloody hack removed soon. Use CacheSetHelper::PkgSelector !
- enum APT_DEPRECATED Constructor { UNKNOWN = CacheSetHelper::UNKNOWN,
+ enum APT_DEPRECATED_MSG("Use CacheSetHelper::PkgSelector instead") Constructor { UNKNOWN = CacheSetHelper::UNKNOWN,
REGEX = CacheSetHelper::REGEX,
TASK = CacheSetHelper::TASK,
FNMATCH = CacheSetHelper::FNMATCH };
PackageContainerInterface& operator=(PackageContainerInterface const &other);
virtual ~PackageContainerInterface();
- APT_DEPRECATED static bool FromTask(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string pattern, CacheSetHelper &helper) {
+ APT_DEPRECATED_MSG("Use helper.PackageFrom(CacheSetHelper::TASK, …) instead") static bool FromTask(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string pattern, CacheSetHelper &helper) {
return helper.PackageFrom(CacheSetHelper::TASK, pci, Cache, pattern); }
- APT_DEPRECATED static bool FromRegEx(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string pattern, CacheSetHelper &helper) {
+ APT_DEPRECATED_MSG("Use helper.PackageFrom(CacheSetHelper::REGEX, …) instead") static bool FromRegEx(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string pattern, CacheSetHelper &helper) {
return helper.PackageFrom(CacheSetHelper::REGEX, pci, Cache, pattern); }
- APT_DEPRECATED static bool FromFnmatch(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string pattern, CacheSetHelper &helper) {
+ APT_DEPRECATED_MSG("Use helper.PackageFrom(CacheSetHelper::FNMATCH, …) instead") static bool FromFnmatch(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string pattern, CacheSetHelper &helper) {
return helper.PackageFrom(CacheSetHelper::FNMATCH, pci, Cache, pattern); }
- APT_DEPRECATED static bool FromGroup(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string pattern, CacheSetHelper &helper) {
+ APT_DEPRECATED_MSG("Use helper.PackageFrom(CacheSetHelper::PACKAGENAME, …) instead") static bool FromGroup(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string pattern, CacheSetHelper &helper) {
return helper.PackageFrom(CacheSetHelper::PACKAGENAME, pci, Cache, pattern); }
- APT_DEPRECATED static bool FromString(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string const &pattern, CacheSetHelper &helper) {
+ APT_DEPRECATED_MSG("Use helper.PackageFrom(CacheSetHelper::STRING, …) instead") static bool FromString(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string const &pattern, CacheSetHelper &helper) {
return helper.PackageFrom(CacheSetHelper::STRING, pci, Cache, pattern); }
- APT_DEPRECATED static bool FromCommandLine(PackageContainerInterface * const pci, pkgCacheFile &Cache, const char **cmdline, CacheSetHelper &helper) {
+ APT_DEPRECATED_MSG("Use helper.PackageFromCommandLine instead") static bool FromCommandLine(PackageContainerInterface * const pci, pkgCacheFile &Cache, const char **cmdline, CacheSetHelper &helper) {
return helper.PackageFromCommandLine(pci, Cache, cmdline); }
- APT_DEPRECATED typedef CacheSetHelper::PkgModifier Modifier;
+ APT_DEPRECATED_MSG("enum moved to CacheSetHelper::PkgModifier") typedef CacheSetHelper::PkgModifier Modifier;
APT_IGNORE_DEPRECATED_PUSH
- APT_DEPRECATED static pkgCache::PkgIterator FromName(pkgCacheFile &Cache, std::string const &pattern, CacheSetHelper &helper) {
+ APT_DEPRECATED_MSG("Use helper.PackageFromName instead") static pkgCache::PkgIterator FromName(pkgCacheFile &Cache, std::string const &pattern, CacheSetHelper &helper) {
return helper.PackageFromName(Cache, pattern); }
- APT_DEPRECATED static bool FromModifierCommandLine(unsigned short &modID, PackageContainerInterface * const pci,
+ APT_DEPRECATED_MSG("Use helper.PackageFromModifierCommandLine instead") static bool FromModifierCommandLine(unsigned short &modID, PackageContainerInterface * const pci,
pkgCacheFile &Cache, const char * cmdline,
std::list<Modifier> const &mods, CacheSetHelper &helper) {
return helper.PackageFromModifierCommandLine(modID, pci, Cache, cmdline, mods); }
PackageContainer() : PackageContainerInterface(CacheSetHelper::UNKNOWN) {}
explicit PackageContainer(CacheSetHelper::PkgSelector const &by) : PackageContainerInterface(by) {}
APT_IGNORE_DEPRECATED_PUSH
- APT_DEPRECATED explicit PackageContainer(Constructor const &by) : PackageContainerInterface((CacheSetHelper::PkgSelector)by) {}
+ APT_DEPRECATED_MSG("Construct with a CacheSetHelper::PkgSelector instead") explicit PackageContainer(Constructor const &by) : PackageContainerInterface((CacheSetHelper::PkgSelector)by) {}
APT_IGNORE_DEPRECATED_POP
template<typename Itr> PackageContainer(Itr first, Itr last) : PackageContainerInterface(CacheSetHelper::UNKNOWN), _cont(first, last) {}
#if __cplusplus >= 201103L
\param Cache the package is in
\param pattern String the package name should be extracted from
\param helper responsible for error and message handling */
- APT_DEPRECATED static pkgCache::PkgIterator FromName(pkgCacheFile &Cache, std::string const &pattern, CacheSetHelper &helper) {
+ APT_DEPRECATED_MSG("Use helper.PackageFromName instead") static pkgCache::PkgIterator FromName(pkgCacheFile &Cache, std::string const &pattern, CacheSetHelper &helper) {
return helper.PackageFromName(Cache, pattern);
}
- APT_DEPRECATED static pkgCache::PkgIterator FromName(pkgCacheFile &Cache, std::string const &pattern) {
+ APT_DEPRECATED_MSG("Use helper.PackageFromName instead") static pkgCache::PkgIterator FromName(pkgCacheFile &Cache, std::string const &pattern) {
CacheSetHelper helper;
return FromName(Cache, pattern, helper);
}
virtual size_t size() const = 0;
/** \brief specifies which version(s) will be returned if non is given */
- enum APT_DEPRECATED Version {
+ enum APT_DEPRECATED_MSG("enum moved to CacheSetHelper::VerSelector instead") Version {
ALL = CacheSetHelper::ALL,
CANDANDINST = CacheSetHelper::CANDANDINST,
CANDIDATE = CacheSetHelper::CANDIDATE,
enum CacheSetHelper::VerSelector const select) : ID(id), Alias(alias), Pos(pos),
SelectVersion(select) {}
APT_IGNORE_DEPRECATED_PUSH
- APT_DEPRECATED Modifier(unsigned short const &id, const char * const alias, Position const &pos,
+ APT_DEPRECATED_MSG("Construct with a CacheSetHelper::VerSelector instead") Modifier(unsigned short const &id, const char * const alias, Position const &pos,
Version const &select) : ID(id), Alias(alias), Pos(pos),
SelectVersion((CacheSetHelper::VerSelector)select) {}
APT_IGNORE_DEPRECATED_POP
const char **cmdline, CacheSetHelper::VerSelector const fallback,
CacheSetHelper &helper);
APT_IGNORE_DEPRECATED_PUSH
- APT_DEPRECATED static bool FromCommandLine(VersionContainerInterface * const vci, pkgCacheFile &Cache,
+ APT_DEPRECATED_MSG("Use CacheSetHelper::VerSelector as fallback selector") static bool FromCommandLine(VersionContainerInterface * const vci, pkgCacheFile &Cache,
const char **cmdline, Version const &fallback,
CacheSetHelper &helper) {
return FromCommandLine(vci, Cache, cmdline, (CacheSetHelper::VerSelector)fallback, helper);
std::string pkg, CacheSetHelper::VerSelector const fallback, CacheSetHelper &helper,
bool const onlyFromName = false);
APT_IGNORE_DEPRECATED_PUSH
- APT_DEPRECATED static bool FromString(VersionContainerInterface * const vci, pkgCacheFile &Cache,
+ APT_DEPRECATED_MSG("Use CacheSetHelper::VerSelector as fallback selector") static bool FromString(VersionContainerInterface * const vci, pkgCacheFile &Cache,
std::string pkg, Version const &fallback, CacheSetHelper &helper,
bool const onlyFromName = false) {
return FromString(vci, Cache, pkg, (CacheSetHelper::VerSelector)fallback, helper, onlyFromName);
pkgCache::PkgIterator const &P, CacheSetHelper::VerSelector const fallback,
CacheSetHelper &helper);
APT_IGNORE_DEPRECATED_PUSH
- APT_DEPRECATED static bool FromPackage(VersionContainerInterface * const vci, pkgCacheFile &Cache,
+ APT_DEPRECATED_MSG("Use CacheSetHelper::VerSelector as fallback selector") static bool FromPackage(VersionContainerInterface * const vci, pkgCacheFile &Cache,
pkgCache::PkgIterator const &P, Version const &fallback,
CacheSetHelper &helper) {
return FromPackage(vci, Cache, P, (CacheSetHelper::VerSelector)fallback, helper);
CacheSetHelper::VerSelector const selector,
CacheSetHelper &helper);
APT_IGNORE_DEPRECATED_PUSH
- APT_DEPRECATED static bool FromDependency(VersionContainerInterface * const vci,
+ APT_DEPRECATED_MSG("Use CacheSetHelper::VerSelector as fallback selector") static bool FromDependency(VersionContainerInterface * const vci,
pkgCacheFile &Cache,
pkgCache::DepIterator const &D,
Version const &selector,
}
/*}}}*/
-APT_DEPRECATED gzFile FileFd::gzFd() {
+gzFile FileFd::gzFd() {
#ifdef HAVE_ZLIB
return d->gz;
#else
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
+ 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);
// Simple manipulators
inline int Fd() {return iFd;};
inline void Fd(int fd) { OpenDescriptor(fd, ReadWrite);};
- gzFile gzFd() APT_DEPRECATED APT_PURE;
+ 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;};
// get hash type used
std::string HashType() const { return Type; };
std::string HashValue() const { return Hash; };
- APT_DEPRECATED std::string HashType() { return Type; };
- APT_DEPRECATED std::string HashValue() { 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;
public:
/* 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 MD5Summation MD5;
- APT_DEPRECATED SHA1Summation SHA1;
- APT_DEPRECATED SHA256Summation SHA256;
- APT_DEPRECATED SHA512Summation SHA512;
+ 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;
static const int UntilEOF = 0;
bool Add(const unsigned char * const Data, unsigned long long const Size);
- APT_DEPRECATED bool Add(const unsigned char * const Data, unsigned long long const Size, unsigned int const Hashes);
+ 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);
inline bool Add(const char * const Data)
{return Add((unsigned char const * const)Data,strlen(Data));};
inline bool Add(const unsigned char * const Beg,const unsigned char * const End)
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 bool AddFD(int const Fd,unsigned long long Size, unsigned int const Hashes);
+ 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 bool AddFD(FileFd &Fd,unsigned long long Size, unsigned int const Hashes);
+ 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();
public:
APT_IGNORE_DEPRECATED_PUSH
- APT_DEPRECATED bool AddFD(int const Fd, unsigned long long Size, bool const addMD5,
+ 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 bool AddFD(FileFd &Fd, unsigned long long Size, bool const addMD5,
+ 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));
};
#if APT_GCC_VERSION >= 0x0300
#define APT_DEPRECATED __attribute__ ((deprecated))
+ #define APT_DEPRECATED_MSG(X) __attribute__ ((deprecated(X)))
#define APT_CONST __attribute__((const))
#define APT_PURE __attribute__((pure))
#define APT_NORETURN __attribute__((noreturn))
#define APT_WEAK __attribute__((weak));
#else
#define APT_DEPRECATED
+ #define APT_DEPRECATED_MSG
#define APT_CONST
#define APT_PURE
#define APT_NORETURN
/*}}}*/
#ifndef SMART_POINTER_H
#define SMART_POINTER_H
+#include <apt-pkg/macros.h>
template <class T>
-class APT_DEPRECATED SPtr
+class APT_DEPRECATED_MSG("use std::unique_ptr instead") SPtr
{
public:
T *Ptr;
};
template <class T>
-class APT_DEPRECATED SPtrArray
+class APT_DEPRECATED_MSG("use std::unique_ptr instead") SPtrArray
{
public:
T *Ptr;
std::string TimeRFC1123(time_t Date);
bool RFC1123StrToTime(const char* const str,time_t &time) APT_MUSTCHECK;
bool FTPMDTMStrToTime(const char* const str,time_t &time) APT_MUSTCHECK;
-APT_DEPRECATED bool StrToTime(const std::string &Val,time_t &Result);
+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<std::string> &List);
// Helpers
bool RunScriptsWithPkgs(const char *Cnf);
- APT_DEPRECATED bool SendV2Pkgs(FILE *F);
+ 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,
inline pkgVersioningSystem &VS() {return *Cache->VS;};
// Policy implementation
- APT_DEPRECATED inline VerIterator GetCandidateVer(PkgIterator const &Pkg) {return /* GetCandidateVersion(Pkg); but for API compat: */ LocalPolicy->GetCandidateVer(Pkg);};
+ APT_DEPRECATED_MSG("Confusingly named method which returns the candidate as choosen by policy (NOT as choosen 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;};
* \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 bool ExecuteSolver(const char* const solver, int *solver_in, int *solver_out);
+ 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
*
bool CopyAndVerify(std::string CDROM,std::string Name,std::vector<std::string> &SigList,
std::vector<std::string> PkgList,std::vector<std::string> SrcList);
- APT_DEPRECATED static bool RunGPGV(std::string const &File, std::string const &FileOut,
+ 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 static bool RunGPGV(std::string const &File, std::string const &FileOut,
+ APT_DEPRECATED_MSG("Use ExecGPGV instead") static bool RunGPGV(std::string const &File, std::string const &FileOut,
int const &statusfd = -1);
SigVerify();
}
/*}}}*/
// IndexFile::TranslationsAvailable - Check if will use Translation /*{{{*/
-// ---------------------------------------------------------------------
-/* */
bool pkgIndexFile::TranslationsAvailable() {
return (APT::Configuration::getLanguages().empty() != true);
}
/*}}}*/
// IndexFile::CheckLanguageCode - Check the Language Code /*{{{*/
-// ---------------------------------------------------------------------
-/* 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).
- TODO: Remove method with next API break */
-APT_DEPRECATED bool pkgIndexFile::CheckLanguageCode(const char * const Lang)
+bool pkgIndexFile::CheckLanguageCode(const char * const Lang)
{
if (strlen(Lang) == 2 || (strlen(Lang) == 5 && Lang[2] == '_'))
return true;
}
/*}}}*/
// IndexFile::LanguageCode - Return the Language Code /*{{{*/
-// ---------------------------------------------------------------------
-/* As we have now possibly more than one LanguageCode this method is
- supersided by a) private classmembers or b) getLanguages().
- TODO: Remove method with next API break */
-APT_DEPRECATED std::string pkgIndexFile::LanguageCode() {
+std::string pkgIndexFile::LanguageCode() {
if (TranslationsAvailable() == false)
return "";
return APT::Configuration::getLanguages()[0];
virtual bool Merge(pkgCacheGenerator &/*Gen*/, OpProgress* const /*Prog*/) { return true; };
virtual pkgCache::PkgFileIterator FindInCache(pkgCache &Cache) const;
- static bool TranslationsAvailable();
- static bool CheckLanguageCode(const char * const Lang);
- static std::string LanguageCode();
+ 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
+ superseeded 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; };
HashStringList Hashes;
unsigned long long Size;
- APT_DEPRECATED HashString Hash;
+ APT_DEPRECATED_MSG("Use the HashStringList member Hashes instead of a hardcoded HashString") HashString Hash;
};
APT_IGNORE_DEPRECATED_POP
bool Debug;
// Main visit function
- APT_DEPRECATED bool VisitNode(PkgIterator Pkg) { return VisitNode(Pkg, "UNKNOWN"); };
+ 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);
// Do the installation
OrderResult DoInstall(APT::Progress::PackageManager *progress);
// compat
- APT_DEPRECATED OrderResult DoInstall(int statusFd=-1);
+ APT_DEPRECATED_MSG("Use APT::Progress::PackageManager subclass instead of fd") OrderResult DoInstall(int statusFd=-1);
// stuff that needs to be done before the fork() of a library that
// uses apt
// stuff that needs to be done after the fork
OrderResult DoInstallPostFork(APT::Progress::PackageManager *progress);
// compat
- APT_DEPRECATED OrderResult DoInstallPostFork(int statusFd=-1);
+ APT_DEPRECATED_MSG("Use APT::Progress::PackageManager subclass instead of fd") OrderResult DoInstallPostFork(int statusFd=-1);
// ?
bool FixMissing();
Provides *ProvideP;
Dependency *DepP;
DependencyData *DepDataP;
- APT_DEPRECATED StringItem *StringItemP;
+ APT_DEPRECATED_MSG("Not used anymore in cache generation and without a replacement") StringItem *StringItemP;
char *StrP;
virtual bool ReMap(bool const &Errorchecks = true);
* 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 map_stringitem_t Name;
+ 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
AllAllowed = All | Allowed };
/** \brief deprecated variant of No */
- static const APT_DEPRECATED VerMultiArch None = 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
};
/*}}}*/
// UNUSED StringItem structure /*{{{*/
-struct APT_DEPRECATED pkgCache::StringItem
+struct APT_DEPRECATED_MSG("No longer used in cache generation without a replacement") pkgCache::StringItem
{
/** \brief string this refers to */
map_ptrloc String; // StringItem
Gen.reset(new pkgCacheGenerator(Map.get(),Progress));
return true;
}
-APT_DEPRECATED bool pkgMakeStatusCache(pkgSourceList &List,OpProgress &Progress,
+bool pkgMakeStatusCache(pkgSourceList &List,OpProgress &Progress,
MMap **OutMap, bool AllowMem)
{ return pkgCacheGenerator::MakeStatusCache(List, &Progress, OutMap, AllowMem); }
bool pkgCacheGenerator::MakeStatusCache(pkgSourceList &List,OpProgress *Progress,
ScopedErrorMerge() { _error->PushToStack(); }
~ScopedErrorMerge() { _error->MergeWithStack(); }
};
-APT_DEPRECATED bool pkgMakeOnlyStatusCache(OpProgress &Progress,DynamicMMap **OutMap)
+bool pkgMakeOnlyStatusCache(OpProgress &Progress,DynamicMMap **OutMap)
{ return pkgCacheGenerator::MakeOnlyStatusCache(&Progress, OutMap); }
bool pkgCacheGenerator::MakeOnlyStatusCache(OpProgress *Progress,DynamicMMap **OutMap)
{
};
/*}}}*/
-bool pkgMakeStatusCache(pkgSourceList &List,OpProgress &Progress,
+APT_DEPRECATED_MSG("Use pkgCacheGenerator::MakeStatusCache instead") bool pkgMakeStatusCache(pkgSourceList &List,OpProgress &Progress,
MMap **OutMap = 0,bool AllowMem = false);
-bool pkgMakeOnlyStatusCache(OpProgress &Progress,DynamicMMap **OutMap);
+APT_DEPRECATED_MSG("Use pkgCacheGenerator::MakeOnlyStatusCache instead") bool pkgMakeOnlyStatusCache(OpProgress &Progress,DynamicMMap **OutMap);
#endif
* choose the hash to be used.
*/
virtual HashStringList Hashes() const { return HashStringList(); };
- APT_DEPRECATED std::string MD5Hash() const { return GetHashFromHashes("MD5Sum"); };
- APT_DEPRECATED std::string SHA1Hash() const { return GetHashFromHashes("SHA1"); };
- APT_DEPRECATED std::string SHA256Hash() const { return GetHashFromHashes("SHA256"); };
- APT_DEPRECATED std::string SHA512Hash() const { return GetHashFromHashes("SHA512"); };
+ 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();};
// Describes a single file
struct File
{
- APT_DEPRECATED std::string MD5Hash;
- APT_DEPRECATED unsigned long Size;
+ 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;
};
extern const char **TFRewritePackageOrder;
extern const char **TFRewriteSourceOrder;
-// Use pkgTagSection::Tag and pkgTagSection::Write() instead
APT_IGNORE_DEPRECATED_PUSH
-struct APT_DEPRECATED TFRewriteData
+struct APT_DEPRECATED_MSG("Use pkgTagSection::Tag and pkgTagSection::Write() instead") TFRewriteData
{
const char *Tag;
const char *Rewrite;
const char *NewTag;
};
-APT_DEPRECATED bool TFRewrite(FILE *Output,pkgTagSection const &Tags,const char *Order[],
+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
}
}
-// please use APT::Upgrade::Upgrade() instead
-APT_DEPRECATED bool pkgDistUpgrade(pkgDepCache &Cache);
-APT_DEPRECATED bool pkgAllUpgrade(pkgDepCache &Cache);
+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