]> git.saurik.com Git - apt.git/commitdiff
explicit overload methods instead of adding parameters
authorDavid Kalnischkies <david@kalnischkies.de>
Fri, 7 Nov 2014 17:18:14 +0000 (18:18 +0100)
committerDavid Kalnischkies <david@kalnischkies.de>
Sat, 8 Nov 2014 13:29:25 +0000 (14:29 +0100)
Adding a new parameter (with a default) is an ABI break, but you can
overload a method, which is "just" an API break for everyone doing
references to this method (aka: nobody).

Git-Dch: Ignore

12 files changed:
apt-pkg/algorithms.cc
apt-pkg/algorithms.h
apt-pkg/contrib/configuration.cc
apt-pkg/contrib/configuration.h
apt-pkg/depcache.h
apt-pkg/indexrecords.cc
apt-pkg/indexrecords.h
apt-pkg/tagfile.cc
apt-pkg/tagfile.h
apt-pkg/upgrade.cc
apt-pkg/upgrade.h
debian/libapt-pkg4.15.symbols

index 71b5ac2c1607087668229fe49678bed00cfbde91..c8696b8add3df50cfb232c331bbf429d7ba2ea02 100644 (file)
@@ -640,6 +640,12 @@ bool pkgProblemResolver::DoUpgrade(pkgCache::PkgIterator Pkg)
 // ProblemResolver::Resolve - calls a resolver to fix the situation    /*{{{*/
 // ---------------------------------------------------------------------
 /* */
+#if APT_PKG_ABI < 413
+bool pkgProblemResolver::Resolve(bool BrokenFix)
+{
+   return Resolve(BrokenFix, NULL);
+}
+#endif
 bool pkgProblemResolver::Resolve(bool BrokenFix, OpProgress * const Progress)
 {
    std::string const solver = _config->Find("APT::Solver", "internal");
@@ -1138,6 +1144,12 @@ bool pkgProblemResolver::InstOrNewPolicyBroken(pkgCache::PkgIterator I)
 /* This is the work horse of the soft upgrade routine. It is very gental 
    in that it does not install or remove any packages. It is assumed that the
    system was non-broken previously. */
+#if APT_PKG_ABI < 413
+bool pkgProblemResolver::ResolveByKeep()
+{
+   return ResolveByKeep(NULL);
+}
+#endif
 bool pkgProblemResolver::ResolveByKeep(OpProgress * const Progress)
 {
    std::string const solver = _config->Find("APT::Solver", "internal");
index b6da1f2bf8f3f48e19821f3233c5cf6e5f4a89c8..2ac28c0d753a4b8896996a2f27bf8c4b3776c2bc 100644 (file)
@@ -138,10 +138,20 @@ class pkgProblemResolver                                          /*{{{*/
    inline void Clear(pkgCache::PkgIterator Pkg) {Flags[Pkg->ID] &= ~(Protected | ToRemove);};
 
    // Try to intelligently resolve problems by installing and removing packages
+#if APT_PKG_ABI >= 413
    bool Resolve(bool BrokenFix = false, OpProgress * const Progress = NULL);
+#else
+   bool Resolve(bool BrokenFix = false);
+   bool Resolve(bool BrokenFix, OpProgress * const Progress);
+#endif
 
    // Try to resolve problems only by using keep
+#if APT_PKG_ABI >= 413
    bool ResolveByKeep(OpProgress * const Progress = NULL);
+#else
+   bool ResolveByKeep();
+   bool ResolveByKeep(OpProgress * const Progress);
+#endif
 
    APT_DEPRECATED void InstallProtect();
 
index 4380d64b9ed2af6e930db118b5a73861ab36edb1..483d5bb1b7f1944070d2a1eb5af8e3bc80e086fe 100644 (file)
@@ -253,6 +253,12 @@ string Configuration::FindDir(const char *Name,const char *Default) const
 // Configuration::FindVector - Find a vector of values                 /*{{{*/
 // ---------------------------------------------------------------------
 /* Returns a vector of config values under the given item */
+#if APT_PKG_ABI < 413
+vector<string> Configuration::FindVector(const char *Name) const
+{
+   return FindVector(Name, "");
+}
+#endif
 vector<string> Configuration::FindVector(const char *Name, std::string const &Default) const
 {
    vector<string> Vec;
index 2ecea8beeeaa1a7bf0bd90e1bc123d34bcf46127..8d7d510375a0db30f111bdf2ba6b43b81562879f 100644 (file)
@@ -84,8 +84,16 @@ class Configuration
     *
     * \param Name of the parent node
     * \param Default list of values separated by commas */
+#if APT_PKG_ABI >= 413
    std::vector<std::string> FindVector(const char *Name, std::string const &Default = "") const;
    std::vector<std::string> FindVector(std::string const &Name, std::string const &Default = "") const { return FindVector(Name.c_str(), Default); };
+#else
+   std::vector<std::string> FindVector(const char *Name, std::string const &Default) const;
+   std::vector<std::string> FindVector(std::string const &Name, std::string const &Default) const { return FindVector(Name.c_str(), Default); };
+   std::vector<std::string> FindVector(const char *Name) const;
+   std::vector<std::string> FindVector(std::string const &Name) const { return FindVector(Name.c_str(), ""); };
+#endif
+
    int FindI(const char *Name,int const &Default = 0) const;
    int FindI(std::string const &Name,int const &Default = 0) const {return FindI(Name.c_str(),Default);};
    bool FindB(const char *Name,bool const &Default = false) const;
index 5554e1a696d54c7c0364dff7540d3ffb910f0072..20d263c67e11179492f211dcbf3f5135a137f5ca 100644 (file)
@@ -109,7 +109,7 @@ class pkgDepCache : protected pkgCache::Namespace
     *
     *  \return \b false if an error occurred.
     */
-   APT_HIDDEN bool MarkRequired(InRootSetFunc &rootFunc);
+   bool MarkRequired(InRootSetFunc &rootFunc);
 
    /** \brief Set the StateCache::Garbage flag on all packages that
     *  should be removed.
@@ -120,7 +120,7 @@ class pkgDepCache : protected pkgCache::Namespace
     *
     *  \return \b false if an error occurred.
     */
-   APT_HIDDEN bool Sweep();
+   bool Sweep();
 
    public:
    
index 0f27af32b8a074eb4472c1e7ef4b121c332eac5d..d65266f649a229e843401e8f6ebd0762ab2bfd8c 100644 (file)
@@ -270,10 +270,23 @@ void indexRecords::SetTrusted(bool const Trusted)
       this->Trusted = NEVER_TRUSTED;
 }
 
+#if APT_PKG_ABI >= 413
 indexRecords::indexRecords(const string &ExpectedDist) :
    Trusted(CHECK_TRUST), d(NULL), ExpectedDist(ExpectedDist), ValidUntil(0),
    SupportsAcquireByHash(false)
 {
 }
+#else
+indexRecords::indexRecords() :
+   Trusted(CHECK_TRUST), d(NULL), ExpectedDist(""), ValidUntil(0),
+   SupportsAcquireByHash(false)
+{
+}
+indexRecords::indexRecords(const string ExpectedDist) :
+   Trusted(CHECK_TRUST), d(NULL), ExpectedDist(ExpectedDist), ValidUntil(0),
+   SupportsAcquireByHash(false)
+{
+}
+#endif
 
 indexRecords::~indexRecords() {}
index 06b9dafa68899d5c9076eb4ff575f894c7e49bd4..35e534c12c0da9a6e582eb9d0d8dc8a9ab1e12fb 100644 (file)
@@ -42,8 +42,12 @@ class indexRecords
    std::map<std::string,checkSum *> Entries;
 
    public:
-
+#if APT_PKG_ABI >= 413
    indexRecords(const std::string &ExpectedDist = "");
+#else
+   indexRecords();
+   indexRecords(const std::string ExpectedDist);
+#endif
 
    // Lookup function
    virtual checkSum *Lookup(const std::string MetaKey);
index e667c495fd0fc68caade79dbb5ac957790fab914..3ee5c707684999b1dceb985c95e92324117c4ab8 100644 (file)
@@ -281,6 +281,12 @@ pkgTagSection::pkgTagSection()
 }
                                                                        /*}}}*/
 // TagSection::Scan - Scan for the end of the header information       /*{{{*/
+#if APT_PKG_ABI < 413
+bool pkgTagSection::Scan(const char *Start,unsigned long MaxLength)
+{
+   return Scan(Start, MaxLength, true);
+}
+#endif
 bool pkgTagSection::Scan(const char *Start,unsigned long MaxLength, bool const Restart)
 {
    Section = Start;
index 99e2a8d938a07cb18e7e5a6193d73631f7e7a214..ac6d42089fac2e06ae4a03645c9b20bb93668270 100644 (file)
@@ -86,7 +86,13 @@ class pkgTagSection
     * @return \b true if section end was found, \b false otherwise.
     *  Beware that internal state will be inconsistent if \b false is returned!
     */
+#if APT_PKG_ABI >= 413
    APT_MUSTCHECK bool Scan(const char *Start, unsigned long MaxLength, bool const Restart = true);
+#else
+   APT_MUSTCHECK bool Scan(const char *Start, unsigned long MaxLength, bool const Restart);
+   APT_MUSTCHECK bool Scan(const char *Start, unsigned long MaxLength);
+#endif
+
    inline unsigned long size() const {return Stop - Section;};
    void Trim();
    virtual void TrimRecord(bool BeforeRecord, const char* &End);
index 41e76802a6b0161a2b619059ff1f61c1106976c3..6c8721da8672ce1973c368d200d71d9be9d531eb 100644 (file)
@@ -24,7 +24,7 @@
    
    The problem resolver is used to resolve the problems.
  */
-bool pkgDistUpgrade(pkgDepCache &Cache, OpProgress * const Progress)
+static bool pkgDistUpgrade(pkgDepCache &Cache, OpProgress * const Progress)
 {
    std::string const solver = _config->Find("APT::Solver", "internal");
    if (solver != "internal")
@@ -119,6 +119,10 @@ 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        /*{{{*/
@@ -229,9 +233,13 @@ static bool pkgAllUpgradeWithNewPackages(pkgDepCache &Cache, OpProgress * const
 /* 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 */
-bool pkgAllUpgrade(pkgDepCache &Cache, OpProgress * const Progress)
+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      /*{{{*/
@@ -280,6 +288,12 @@ bool pkgMinimizeUpgrade(pkgDepCache &Cache)
 }
                                                                        /*}}}*/
 // APT::Upgrade::Upgrade - Upgrade using a specific strategy           /*{{{*/
+#if APT_PKG_ABI < 413
+bool APT::Upgrade::Upgrade(pkgDepCache &Cache, int mode)
+{
+   return Upgrade(Cache, mode, NULL);
+}
+#endif
 bool APT::Upgrade::Upgrade(pkgDepCache &Cache, int mode, OpProgress * const Progress)
 {
 APT_IGNORE_DEPRECATED_PUSH
index a3f693d86e4356978a070fd4b26469ca4a48c8f2..18b6aac7b03fedf7a25864c7538f3fc29b3545da 100644 (file)
@@ -20,17 +20,22 @@ namespace APT {
    namespace Upgrade {
       // FIXME: make this "enum class UpgradeMode {" once we enable c++11
       enum UpgradeMode {
-        ALLOW_EVERYTHING = 0,
          FORBID_REMOVE_PACKAGES = 1,
-         FORBID_INSTALL_NEW_PACKAGES = 2
+         FORBID_INSTALL_NEW_PACKAGES = 2,
+        ALLOW_EVERYTHING = 0
       };
+#if APT_PKG_ABI >= 413
       bool Upgrade(pkgDepCache &Cache, int UpgradeMode, OpProgress * const Progress = NULL);
+#else
+      bool Upgrade(pkgDepCache &Cache, int UpgradeMode);
+      bool Upgrade(pkgDepCache &Cache, int UpgradeMode, OpProgress * const Progress);
+#endif
    }
 }
 
 // please use APT::Upgrade::Upgrade() instead
-APT_DEPRECATED bool pkgDistUpgrade(pkgDepCache &Cache, OpProgress * const Progress = NULL);
-APT_DEPRECATED bool pkgAllUpgrade(pkgDepCache &Cache, OpProgress * const Progress = NULL);
+APT_DEPRECATED bool pkgDistUpgrade(pkgDepCache &Cache);
+APT_DEPRECATED bool pkgAllUpgrade(pkgDepCache &Cache);
 
 bool pkgMinimizeUpgrade(pkgDepCache &Cache);
 #endif
index 9888223a983fbac201fe906cf617a132b3ae68b2..5e0c0244df137883fad1b78ca44b836a02dc3306 100644 (file)
@@ -49,6 +49,8 @@ libapt-pkg.so.4.15 libapt-pkg4.15 #MINVER#
  (c++)"pkgPrioSortList(pkgCache&, pkgCache::Version**)@Base" 0.8.0
  (c++)"pkgMakeStatusCache(pkgSourceList&, OpProgress&, MMap**, bool)@Base" 0.8.0
  (c++)"pkgMinimizeUpgrade(pkgDepCache&)@Base" 0.8.0
+ (c++)"pkgAllUpgrade(pkgDepCache&)@Base" 0.8.0
+ (c++)"pkgDistUpgrade(pkgDepCache&)@Base" 0.8.0
  (c++)"GetListOfFilesInDir(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, bool const&)@Base" 0.8.0
  (c++)"GetListOfFilesInDir(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool const&, bool const&)@Base" 0.8.0
  (c++)"pkgMakeOnlyStatusCache(OpProgress&, DynamicMMap**)@Base" 0.8.0
@@ -233,6 +235,8 @@ libapt-pkg.so.4.15 libapt-pkg4.15 #MINVER#
  (c++)"pkgDepCache::CheckDep(pkgCache::DepIterator, int, pkgCache::PkgIterator&)@Base" 0.8.0
  (c++)"pkgDepCache::MarkAuto(pkgCache::PkgIterator const&, bool)@Base" 0.8.0
  (c++)"pkgDepCache::MarkKeep(pkgCache::PkgIterator const&, bool, bool, unsigned long)@Base" 0.8.0
+ (c++)"pkgDepCache::MarkRequired(pkgDepCache::InRootSetFunc&)@Base" 0.8.0
+ (c++)"pkgDepCache::Sweep()@Base" 0.8.0
  (c++)"pkgDepCache::pkgDepCache(pkgCache*, pkgDepCache::Policy*)@Base" 0.8.0
  (c++)"pkgDepCache::~pkgDepCache()@Base" 0.8.0
  (c++)"pkgSimulate::Policy::GetCandidateVer(pkgCache::PkgIterator const&)@Base" 0.8.0
@@ -1362,8 +1366,6 @@ libapt-pkg.so.4.15 libapt-pkg4.15 #MINVER#
  (c++)"Popen(char const**, FileFd&, int&, FileFd::OpenMode)@Base" 1.1~exp1
  (c++)"APT::String::Startswith(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@Base" 1.1~exp2
  (c++)"APT::Upgrade::Upgrade(pkgDepCache&, int, OpProgress*)@Base" 1.1~exp4
- (c++)"pkgAllUpgrade(pkgDepCache&, OpProgress*)@Base" 1.1~exp4
- (c++)"pkgDistUpgrade(pkgDepCache&, OpProgress*)@Base" 1.1~exp4
  (c++)"pkgProblemResolver::Resolve(bool, OpProgress*)@Base" 1.1~exp4
  (c++)"pkgProblemResolver::ResolveByKeep(OpProgress*)@Base" 1.1~exp4
  (c++)"pkgCache::PkgIterator::Section() const@Base" 1.1~exp4