]> git.saurik.com Git - apt.git/commitdiff
rename AddSelectedVersion() to a better public FromPackage()
authorDavid Kalnischkies <kalnischkies@gmail.com>
Tue, 29 Jun 2010 17:10:47 +0000 (19:10 +0200)
committerDavid Kalnischkies <kalnischkies@gmail.com>
Tue, 29 Jun 2010 17:10:47 +0000 (19:10 +0200)
cmdline/cacheset.cc
cmdline/cacheset.h

index 42bc79693521634aecaaca2a7265607493ea95b0..35ef74f9ae997de99154ffd817762489451074e0 100644 (file)
@@ -321,7 +321,7 @@ APT::VersionSet VersionSet::FromString(pkgCacheFile &Cache, std::string pkg,
        for (PackageSet::const_iterator P = pkgset.begin();
             P != pkgset.end(); ++P) {
                if (vertag == string::npos) {
-                       AddSelectedVersion(Cache, verset, P, fallback, helper);
+                       verset.insert(VersionSet::FromPackage(Cache, P, fallback, helper));
                        continue;
                }
                pkgCache::VerIterator V;
@@ -351,10 +351,10 @@ APT::VersionSet VersionSet::FromString(pkgCacheFile &Cache, std::string pkg,
        return verset;
 }
                                                                        /*}}}*/
-// AddSelectedVersion - add version from package based on fallback     /*{{{*/
-void VersionSet::AddSelectedVersion(pkgCacheFile &Cache, VersionSet &verset,
-               pkgCache::PkgIterator const &P, VersionSet::Version const &fallback,
-               CacheSetHelper &helper) {
+// FromPackage - versions from package based on fallback               /*{{{*/
+VersionSet VersionSet::FromPackage(pkgCacheFile &Cache, pkgCache::PkgIterator const &P,
+               VersionSet::Version const &fallback, CacheSetHelper &helper) {
+       VersionSet verset;
        pkgCache::VerIterator V;
        bool showErrors;
        switch(fallback) {
@@ -404,6 +404,7 @@ void VersionSet::AddSelectedVersion(pkgCacheFile &Cache, VersionSet &verset,
                        verset.insert(helper.canNotFindNewestVer(Cache, P));
                break;
        }
+       return verset;
 }
                                                                        /*}}}*/
 // getCandidateVer - Returns the candidate version of the given package        /*{{{*/
index 21c42c51109bdc5c2e7078158afc31bf57749870..bf863fb399a1b0bc5a3993975978f1874a7cfe2b 100644 (file)
@@ -291,6 +291,15 @@ public:                                                                    /*{{{*/
                return APT::VersionSet::FromString(Cache, pkg, CANDINST);
        }
 
+       /** \brief returns all versions specified for the package
+
+           \param Cache the package and versions are in
+           \param P the package in question
+           \param fallback the version(s) you want to get
+           \param helper the helper used for display and error handling */
+       static VersionSet FromPackage(pkgCacheFile &Cache, pkgCache::PkgIterator const &P,
+               VersionSet::Version const &fallback, CacheSetHelper &helper);
+
        struct Modifier {
                enum Position { NONE, PREFIX, POSTFIX };
                unsigned short ID;
@@ -330,11 +339,6 @@ protected:                                                         /*{{{*/
            \param Pkg we want the installed version from this package */
        static pkgCache::VerIterator getInstalledVer(pkgCacheFile &Cache,
                pkgCache::PkgIterator const &Pkg, CacheSetHelper &helper);
-
-       static void AddSelectedVersion(pkgCacheFile &Cache, VersionSet &verset,
-               pkgCache::PkgIterator const &P, VersionSet::Version const &fallback,
-               CacheSetHelper &helper);
-
                                                                        /*}}}*/
 };                                                                     /*}}}*/
 }