Browse Source

add messages to our deprecation warnings in libapt

Git-Dch: Ignore
tags/debian/1.1.1
David Kalnischkies 5 years ago
parent
commit
5dd00edbcf
29 changed files with 101 additions and 111 deletions
  1. +1
    -1
      apt-inst/contrib/extracttar.h
  2. +1
    -1
      apt-pkg/acquire-item.h
  3. +1
    -1
      apt-pkg/acquire.h
  4. +1
    -1
      apt-pkg/algorithms.h
  5. +2
    -2
      apt-pkg/cachefile.h
  6. +2
    -2
      apt-pkg/cacheiterators.h
  7. +36
    -41
      apt-pkg/cacheset.h
  8. +1
    -1
      apt-pkg/contrib/fileutl.cc
  9. +2
    -2
      apt-pkg/contrib/fileutl.h
  10. +11
    -11
      apt-pkg/contrib/hashes.h
  11. +2
    -0
      apt-pkg/contrib/macros.h
  12. +3
    -2
      apt-pkg/contrib/sptr.h
  13. +1
    -1
      apt-pkg/contrib/strutl.h
  14. +1
    -1
      apt-pkg/deb/dpkgpm.h
  15. +1
    -1
      apt-pkg/depcache.h
  16. +1
    -1
      apt-pkg/edsp.h
  17. +2
    -2
      apt-pkg/indexcopy.h
  18. +2
    -13
      apt-pkg/indexfile.cc
  19. +8
    -3
      apt-pkg/indexfile.h
  20. +1
    -1
      apt-pkg/metaindex.h
  21. +1
    -1
      apt-pkg/orderlist.h
  22. +2
    -2
      apt-pkg/packagemanager.h
  23. +4
    -4
      apt-pkg/pkgcache.h
  24. +2
    -2
      apt-pkg/pkgcachegen.cc
  25. +2
    -2
      apt-pkg/pkgcachegen.h
  26. +4
    -4
      apt-pkg/pkgrecords.h
  27. +2
    -2
      apt-pkg/srcrecords.h
  28. +2
    -3
      apt-pkg/tagfile.h
  29. +2
    -3
      apt-pkg/upgrade.h

+ 1
- 1
apt-inst/contrib/extracttar.h View File

@@ -49,7 +49,7 @@ class ExtractTar
// 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:



+ 1
- 1
apt-pkg/acquire-item.h View File

@@ -105,7 +105,7 @@ class pkgAcquire::Item : public WeakPointable /*{{{*/
/** \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


+ 1
- 1
apt-pkg/acquire.h View File

@@ -364,7 +364,7 @@ class pkgAcquire
* 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; }



+ 1
- 1
apt-pkg/algorithms.h View File

@@ -142,7 +142,7 @@ class pkgProblemResolver /*{{{*/
// 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();


+ 2
- 2
apt-pkg/cachefile.h View File

@@ -64,13 +64,13 @@ class pkgCacheFile
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();



+ 2
- 2
apt-pkg/cacheiterators.h View File

@@ -157,7 +157,7 @@ class pkgCache::PkgIterator: public Iterator<Package, PkgIterator> {
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;}
@@ -514,7 +514,7 @@ 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 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

+ 36
- 41
apt-pkg/cacheset.h View File

@@ -76,8 +76,7 @@ public: /*{{{*/
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
*
@@ -89,10 +88,10 @@ public: /*{{{*/
*/
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
*
@@ -105,10 +104,10 @@ public: /*{{{*/
*/
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 {
@@ -145,8 +144,7 @@ public: /*{{{*/
*/
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
@@ -159,23 +157,21 @@ public: /*{{{*/
* \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);
@@ -316,7 +312,7 @@ public:
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
@@ -345,8 +341,7 @@ public:
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 };
@@ -361,25 +356,25 @@ APT_IGNORE_DEPRECATED_POP
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); }
@@ -445,7 +440,7 @@ public: /*{{{*/
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
@@ -520,10 +515,10 @@ APT_IGNORE_DEPRECATED_PUSH
\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);
}
@@ -799,7 +794,7 @@ public:
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,
@@ -818,7 +813,7 @@ public:
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
@@ -828,7 +823,7 @@ 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);
@@ -839,7 +834,7 @@ APT_IGNORE_DEPRECATED_POP
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);
@@ -850,7 +845,7 @@ APT_IGNORE_DEPRECATED_POP
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);
@@ -870,7 +865,7 @@ APT_IGNORE_DEPRECATED_POP
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,


+ 1
- 1
apt-pkg/contrib/fileutl.cc View File

@@ -2090,7 +2090,7 @@ bool FileFd::FileFdError(const char *Description,...) {
}
/*}}}*/

APT_DEPRECATED gzFile FileFd::gzFd() {
gzFile FileFd::gzFd() {
#ifdef HAVE_ZLIB
return d->gz;
#else


+ 2
- 2
apt-pkg/contrib/fileutl.h View File

@@ -97,7 +97,7 @@ class FileFd
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);
@@ -121,7 +121,7 @@ class FileFd
// 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;};


+ 11
- 11
apt-pkg/contrib/hashes.h View File

@@ -55,8 +55,8 @@ class HashString
// 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;
@@ -188,15 +188,15 @@ class Hashes
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)
@@ -205,9 +205,9 @@ 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 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();

@@ -238,11 +238,11 @@ APT_IGNORE_DEPRECATED_POP

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));
};


+ 2
- 0
apt-pkg/contrib/macros.h View File

@@ -72,6 +72,7 @@

#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))
@@ -79,6 +80,7 @@
#define APT_WEAK __attribute__((weak));
#else
#define APT_DEPRECATED
#define APT_DEPRECATED_MSG
#define APT_CONST
#define APT_PURE
#define APT_NORETURN


+ 3
- 2
apt-pkg/contrib/sptr.h View File

@@ -20,9 +20,10 @@
/*}}}*/
#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;
@@ -43,7 +44,7 @@ class APT_DEPRECATED SPtr
};

template <class T>
class APT_DEPRECATED SPtrArray
class APT_DEPRECATED_MSG("use std::unique_ptr instead") SPtrArray
{
public:
T *Ptr;


+ 1
- 1
apt-pkg/contrib/strutl.h View File

@@ -66,7 +66,7 @@ std::string URItoFileName(const std::string &URI);
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);


+ 1
- 1
apt-pkg/deb/dpkgpm.h View File

@@ -91,7 +91,7 @@ class pkgDPkgPM : public pkgPackageManager

// 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,


+ 1
- 1
apt-pkg/depcache.h View File

@@ -362,7 +362,7 @@ class pkgDepCache : protected pkgCache::Namespace
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;};


+ 1
- 1
apt-pkg/edsp.h View File

@@ -192,7 +192,7 @@ 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 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
*


+ 2
- 2
apt-pkg/indexcopy.h View File

@@ -116,9 +116,9 @@ class SigVerify /*{{{*/
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();


+ 2
- 13
apt-pkg/indexfile.cc View File

@@ -89,19 +89,12 @@ std::string pkgIndexFile::SourceInfo(pkgSrcRecords::Parser const &/*Record*/,
}
/*}}}*/
// 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;
@@ -113,11 +106,7 @@ APT_DEPRECATED bool pkgIndexFile::CheckLanguageCode(const char * const Lang)
}
/*}}}*/
// 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];


+ 8
- 3
apt-pkg/indexfile.h View File

@@ -143,9 +143,14 @@ class pkgIndexFile
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; };



+ 1
- 1
apt-pkg/metaindex.h View File

@@ -35,7 +35,7 @@ public:
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



+ 1
- 1
apt-pkg/orderlist.h View File

@@ -48,7 +48,7 @@ class pkgOrderList : protected pkgCache::Namespace
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);


+ 2
- 2
apt-pkg/packagemanager.h View File

@@ -113,7 +113,7 @@ class pkgPackageManager : protected pkgCache::Namespace
// 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
@@ -124,7 +124,7 @@ class pkgPackageManager : protected pkgCache::Namespace
// 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();


+ 4
- 4
apt-pkg/pkgcache.h View File

@@ -212,7 +212,7 @@ class pkgCache /*{{{*/
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);
@@ -413,7 +413,7 @@ struct pkgCache::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 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
@@ -602,7 +602,7 @@ struct pkgCache::Version
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

@@ -742,7 +742,7 @@ struct pkgCache::Provides
};
/*}}}*/
// 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


+ 2
- 2
apt-pkg/pkgcachegen.cc View File

@@ -1557,7 +1557,7 @@ static bool loadBackMMapFromFile(std::unique_ptr<pkgCacheGenerator> &Gen,
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,
@@ -1712,7 +1712,7 @@ public:
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)
{


+ 2
- 2
apt-pkg/pkgcachegen.h View File

@@ -191,8 +191,8 @@ class APT_HIDDEN pkgCacheListParser
};
/*}}}*/

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

+ 4
- 4
apt-pkg/pkgrecords.h View File

@@ -68,10 +68,10 @@ class pkgRecords::Parser /*{{{*/
* 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();};


+ 2
- 2
apt-pkg/srcrecords.h View File

@@ -33,8 +33,8 @@ APT_IGNORE_DEPRECATED_PUSH
// 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;
};


+ 2
- 3
apt-pkg/tagfile.h View File

@@ -163,15 +163,14 @@ class pkgTagFile
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



+ 2
- 3
apt-pkg/upgrade.h View File

@@ -28,9 +28,8 @@ namespace APT {
}
}

// 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

Loading…
Cancel
Save