From 917e7a20f5f378d4394bb2fd684e1be2f3c1f1d4 Mon Sep 17 00:00:00 2001 From: Johannes Winkelmann Date: Fri, 8 Sep 2006 14:00:35 +0000 Subject: [PATCH] prt-get: promote compareShadowPair git-svn-id: https://crux.nu/svn/tools/prt-get/trunk@1839 0b5ae1c7-2405-0410-a7fc-ba219f786e1e --- src/repository.cpp | 12 +++++++----- src/repository.h | 3 +++ 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/repository.cpp b/src/repository.cpp index 0616096..789eb8e 100644 --- a/src/repository.cpp +++ b/src/repository.cpp @@ -64,10 +64,10 @@ const map& Repository::packages() const /*! - Returns a map of duplicate packages in the repository. The key is the name - of the package, the value a pair where \a first the shadowed port and + Returns a sorted list of duplicate packages in the repository. + In the pairs \a first is the shadowed port and \a second is the port which preceeds over \a first - \return a map of duplicate packages in the repository + \return a list of duplicate packages in the repository */ const list< pair >& Repository::shadowedPackages() const { @@ -140,7 +140,8 @@ void Repository::searchMatchingPackages( const string& pattern, } } -int compareShadowPair(pair& p1, pair& p2) +int Repository::compareShadowPair(pair& p1, + pair& p2) { return p1.second->name() < p2.second->name(); } @@ -231,7 +232,8 @@ void Repository::initFromFS( const list< pair >& rootList, // no such package found, add m_packageMap[name] = p; } else if ( listDuplicate ) { - m_shadowedPackages.push_back(make_pair( p, hidden->second )); + m_shadowedPackages.push_back( + make_pair( p, hidden->second )); } else { delete p; } diff --git a/src/repository.h b/src/repository.h index df6ca4c..43c7885 100644 --- a/src/repository.h +++ b/src/repository.h @@ -69,6 +69,9 @@ public: static const std::string EXTERNAL_DEPENDENCY_FILE; private: + static int compareShadowPair(pair& p1, + pair& p2); + static const std::string CACHE_VERSION; bool m_useRegex;