[zypp-commit] r7976 - in /trunk/libzypp/zypp/sat: Pool.cc Pool.h Repo.cc Repo.h Solvable.cc Solvable.h
Author: mlandres Date: Thu Nov 29 13:10:09 2007 New Revision: 7976 URL: http://svn.opensuse.org/viewcvs/zypp?rev=7976&view=rev Log: add @system repo Modified: trunk/libzypp/zypp/sat/Pool.cc trunk/libzypp/zypp/sat/Pool.h trunk/libzypp/zypp/sat/Repo.cc trunk/libzypp/zypp/sat/Repo.h trunk/libzypp/zypp/sat/Solvable.cc trunk/libzypp/zypp/sat/Solvable.h Modified: trunk/libzypp/zypp/sat/Pool.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/sat/Pool.cc?rev=7976&r1=7975&r2=7976&view=diff ============================================================================== --- trunk/libzypp/zypp/sat/Pool.cc (original) +++ trunk/libzypp/zypp/sat/Pool.cc Thu Nov 29 13:10:09 2007 @@ -37,6 +37,12 @@ namespace sat { ///////////////////////////////////////////////////////////////// + const std::string & Pool::systemRepoName() + { + static const std::string _val( "@System" ); + return _val; + } + ::_Pool * Pool::get() const { return myPool().getPool(); } @@ -112,11 +118,6 @@ return Repo(); } - void Pool::reposErase( const std::string & name_r ) - { - reposFind( name_r ).eraseFromPool(); - } - Repo Pool::addRepoSolv( const Pathname & file_r, const std::string & name_r ) { // Using a temporay repo! (The additional parenthesis are required.) @@ -129,11 +130,6 @@ return tmprepo; } - Repo Pool::addRepoSolv( const Pathname & file_r ) - { - return addRepoSolv( file_r, file_r.basename() ); - } - /****************************************************************** ** ** FUNCTION NAME : operator<< Modified: trunk/libzypp/zypp/sat/Pool.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/sat/Pool.h?rev=7976&r1=7975&r2=7976&view=diff ============================================================================== --- trunk/libzypp/zypp/sat/Pool.h (original) +++ trunk/libzypp/zypp/sat/Pool.h Thu Nov 29 13:10:09 2007 @@ -15,6 +15,7 @@ #include <iosfwd> #include "zypp/sat/detail/PoolMember.h" +#include "zypp/sat/Repo.h" /////////////////////////////////////////////////////////////////// namespace zypp @@ -87,7 +88,16 @@ /** Remove a \ref Repo named \c name_r. * \see \ref Repo::eraseFromPool */ - void reposErase( const std::string & name_r ); + void reposErase( const std::string & name_r ) + { reposFind( name_r ).eraseFromPool(); } + + public: + /** Reserved system repo name \c @System. */ + static const std::string & systemRepoName(); + + /** Return the system repo. */ + Repo systemRepo() + { return reposInsert( systemRepoName() ); } public: /** Load \ref Solvables from a solv-file into a \ref Repo named \c name_r. @@ -97,7 +107,8 @@ */ Repo addRepoSolv( const Pathname & file_r, const std::string & name_r ); /** \overload Using the files basename as \ref Repo name. */ - Repo addRepoSolv( const Pathname & file_r ); + Repo addRepoSolv( const Pathname & file_r ) + { return addRepoSolv( file_r, file_r.basename() ); } public: /** Whether \ref Pool contains solvables. */ Modified: trunk/libzypp/zypp/sat/Repo.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/sat/Repo.cc?rev=7976&r1=7975&r2=7976&view=diff ============================================================================== --- trunk/libzypp/zypp/sat/Repo.cc (original) +++ trunk/libzypp/zypp/sat/Repo.cc Thu Nov 29 13:10:09 2007 @@ -20,7 +20,7 @@ #include "zypp/sat/detail/PoolImpl.h" #include "zypp/sat/Repo.h" -#include "zypp/sat/Solvable.h" +#include "zypp/sat/Pool.h" using std::endl; @@ -46,6 +46,12 @@ ::_Repo * _repo( get() ); \ if ( ! _repo ) ZYPP_THROW( VAL ) + bool Repo::isSystemRepo() const + { + NO_REPO_RETURN( false ); + return( Pool::systemRepoName() == _repo->name ); + } + std::string Repo::name() const { NO_REPO_RETURN( std::string() ); Modified: trunk/libzypp/zypp/sat/Repo.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/sat/Repo.h?rev=7976&r1=7975&r2=7976&view=diff ============================================================================== --- trunk/libzypp/zypp/sat/Repo.h (original) +++ trunk/libzypp/zypp/sat/Repo.h Thu Nov 29 13:10:09 2007 @@ -56,6 +56,9 @@ /** Evaluate \ref Repo in a boolean context (\c != \c norepo). */ using base::SafeBool<Repo>::operator bool_type; + /** Return whether this is the system repo. */ + bool isSystemRepo() const; + public: /** The repos name (alias?). */ std::string name() const; Modified: trunk/libzypp/zypp/sat/Solvable.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/sat/Solvable.cc?rev=7976&r1=7975&r2=7976&view=diff ============================================================================== --- trunk/libzypp/zypp/sat/Solvable.cc (original) +++ trunk/libzypp/zypp/sat/Solvable.cc Thu Nov 29 13:10:09 2007 @@ -57,6 +57,9 @@ return nosolvable; } + bool Solvable::isSystem() const + { return repo().isSystemRepo(); } + NameId Solvable::name() const { NO_SOLVABLE_RETURN( NameId() ); @@ -96,7 +99,8 @@ if ( ! obj ) return str << "sat::solvable()"; - return str << "sat::solvable(" << obj.id() << "|" << obj.name() << '-' << obj.evr() << '.' << obj.arch() << "){" + return str << "sat::solvable(" << obj.id() << "|" + << obj.name() << '-' << obj.evr() << '.' << obj.arch() << "){" << obj.repo().name() << "}"; } Modified: trunk/libzypp/zypp/sat/Solvable.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/sat/Solvable.h?rev=7976&r1=7975&r2=7976&view=diff ============================================================================== --- trunk/libzypp/zypp/sat/Solvable.h (original) +++ trunk/libzypp/zypp/sat/Solvable.h Thu Nov 29 13:10:09 2007 @@ -50,12 +50,16 @@ /** Evaluate \ref Solvable in a boolean context (\c != \c nosolvable). */ using base::SafeBool<Solvable>::operator bool_type; + /** Return whether this \ref Solvable belongs to the system repo. */ + bool isSystem() const; + public: NameId name() const; EvrId evr() const; ArchId arch() const; VendorId vendor() const; + public: Repo repo() const; public: -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org
participants (1)
-
mlandres@svn.opensuse.org