Author: mlandres Date: Fri Sep 19 13:25:51 2008 New Revision: 11102 URL: http://svn.opensuse.org/viewcvs/zypp?rev=11102&view=rev Log: - Moved DefaultAcceptBits enum to class KeyRing (formerly KeyRingReort). - Fix Deltarpm_test. Running the test polluted the source tree. Modified: trunk/libzypp/VERSION.cmake trunk/libzypp/devel/devel.ma/NewPool.cc trunk/libzypp/devel/devel.ma/Tools.h trunk/libzypp/package/libzypp.changes trunk/libzypp/tests/zypp/Deltarpm_test.cc trunk/libzypp/zypp/KeyRing.cc trunk/libzypp/zypp/KeyRing.h Modified: trunk/libzypp/VERSION.cmake URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/VERSION.cmake?rev=11102&r1=11101&r2=11102&view=diff ============================================================================== --- trunk/libzypp/VERSION.cmake (original) +++ trunk/libzypp/VERSION.cmake Fri Sep 19 13:25:51 2008 @@ -59,8 +59,8 @@ # changes file. See './mkChangelog -h' for help. # SET(LIBZYPP_MAJOR "5") -SET(LIBZYPP_COMPATMINOR "11") -SET(LIBZYPP_MINOR "11") +SET(LIBZYPP_COMPATMINOR "12") +SET(LIBZYPP_MINOR "12") SET(LIBZYPP_PATCH "0") # # LAST RELEASED: 5.11.0 (11) Modified: trunk/libzypp/devel/devel.ma/NewPool.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/devel/devel.ma/NewPool.cc?rev=11102&r1=11101&r2=11102&view=diff ============================================================================== --- trunk/libzypp/devel/devel.ma/NewPool.cc (original) +++ trunk/libzypp/devel/devel.ma/NewPool.cc Fri Sep 19 13:25:51 2008 @@ -444,6 +444,14 @@ INT << "===[START]==========================================" << endl; ZConfig::instance(); + Edition a("4.21.3-2"); + DBG << a << endl; + DBG << (a == a) << endl; + DBG << (a.match(a)) << endl; + /////////////////////////////////////////////////////////////////// + INT << "===[END]============================================" << endl << endl; + zypp::base::LogControl::instance().logNothing(); + return 0; #if 0 @@ -485,7 +493,6 @@ } repoManager.loadFromCache( nrepo ); -#endif /////////////////////////////////////////////////////////////////// @@ -515,6 +522,24 @@ if ( 1 ) { RepoManager repoManager( makeRepoManager( sysRoot ) ); + ServiceInfoList services = repoManager.knownServices(); + + for ( ServiceInfoList::iterator it = services.begin(); it != services.end(); ++it ) + { + ServiceInfo & nservice( *it ); + SEC << nservice << endl; + + if ( ! nservice.enabled() ) + continue; + + repoManager.refreshService( nservice ); + + } + } + + if ( 1 ) + { + RepoManager repoManager( makeRepoManager( sysRoot ) ); RepoInfoList repos = repoManager.knownRepositories(); // launch repos @@ -581,6 +606,7 @@ UpgradeStatistics u; getZYpp()->resolver()->doUpgrade( u ); } + /////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////// @@ -598,6 +624,45 @@ } } + + ////////////////////////////////////////////////////////////////// + INT << "===[END]============================================" << endl << endl; + zypp::base::LogControl::instance().logNothing(); + return 0; + for_( it, pool.byKindBegin<Product>(), pool.byKindEnd<Product>() ) + { + MIL << *it << endl; + DBG << (*it)->provides() << endl; + } + + sat::WhatProvides prv( Capability("product()") ); + SEC << prv << endl; + for_( it, prv.begin(), prv.end() ) + { + + MIL << *it << endl; + MIL << it->provides() << endl; + } + + Capability cap; + + cap = Capability( "sles-release" ); + prv = sat::WhatProvides( cap ); + MIL << cap << ": " << prv << endl; + + cap = Capability( "sles-release == 11" ); + prv = sat::WhatProvides( cap ); + MIL << cap << ": " << prv << endl; + + +// PoolItem pi ( getPi<Package>("sles-release", Edition("11.0") ) ); + + ////////////////////////////////////////////////////////////////// + INT << "===[END]============================================" << endl << endl; + zypp::base::LogControl::instance().logNothing(); + return 0; + + //SEC << zypp::getZYpp()->diskUsage() << endl; //vdumpPoolStats( USR << "Pool:"<< endl, pool.begin(), pool.end() ) << endl; Modified: trunk/libzypp/devel/devel.ma/Tools.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/devel/devel.ma/Tools.h?rev=11102&r1=11101&r2=11102&view=diff ============================================================================== --- trunk/libzypp/devel/devel.ma/Tools.h (original) +++ trunk/libzypp/devel/devel.ma/Tools.h Fri Sep 19 13:25:51 2008 @@ -158,7 +158,7 @@ for_(it, pool.byNameBegin(name_r), pool.byNameEnd(name_r) ) { if ( !ret && isKind<_Res>( (*it).resolvable() ) - && ( ed_r == Edition() || ed_r == (*it)->edition() ) + && ( ed_r == Edition() || ed_r.match((*it)->edition()) == 0 ) && ( arch_r == Arch() || arch_r == (*it)->arch() ) ) { ret = (*it); Modified: trunk/libzypp/package/libzypp.changes URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/package/libzypp.changes?rev=11102&r1=11101&r2=11102&view=diff ============================================================================== --- trunk/libzypp/package/libzypp.changes (original) +++ trunk/libzypp/package/libzypp.changes Fri Sep 19 13:25:51 2008 @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Fri Sep 19 13:17:38 CEST 2008 - ma@suse.de + +- Moved DefaultAcceptBits enum to class KeyRing (formerly KeyRingReort). +- revision 11102 + +------------------------------------------------------------------- Thu Sep 18 16:11:23 CEST 2008 - ma@suse.de - Use service alias as namespace for it's repositories aliases. Modified: trunk/libzypp/tests/zypp/Deltarpm_test.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/tests/zypp/Deltarpm_test.cc?rev=11102&r1=11101&r2=11102&view=diff ============================================================================== --- trunk/libzypp/tests/zypp/Deltarpm_test.cc (original) +++ trunk/libzypp/tests/zypp/Deltarpm_test.cc Fri Sep 19 13:25:51 2008 @@ -8,6 +8,7 @@ #include "zypp/base/Logger.h" #include "zypp/base/Exception.h" +#include "zypp/TmpPath.h" #include "zypp/PathInfo.h" #include "zypp/RepoManager.h" #include "zypp/sat/Pool.h" @@ -26,21 +27,14 @@ BOOST_AUTO_TEST_CASE(delta) { - KeyRingTestReceiver rec; - rec.answerAcceptUnknownKey(true); -// rec.answerImportKey(true); - Pathname rootdir(TEST_DIR ); - RepoManagerOptions opts(rootdir); - opts.repoRawCachePath = rootdir; - opts.repoSolvCachePath = rootdir; - opts.knownReposPath = rootdir; - opts.knownServicesPath = rootdir; + KeyRing::setDefaultAccept( KeyRing::ACCEPT_UNKNOWNKEY | KeyRing::ACCEPT_UNSIGNED_FILE ); - RepoManager rm(opts); + TmpDir rootdir; + RepoManager rm( RepoManagerOptions::makeTestSetup( rootdir ) ); RepoInfo updates; updates.setAlias("updates"); - updates.addBaseUrl(Url(string("dir:") + rootdir.absolutename().asString() )); + updates.addBaseUrl( Pathname(TEST_DIR).asUrl() ); try { @@ -61,7 +55,7 @@ BOOST_CHECK(it->name() == "libzypp"); BOOST_CHECK(it->edition() == Edition("4.21.3-2")); BOOST_CHECK(it->arch() == "i386"); - BOOST_CHECK(it->baseversion().edition().match(Edition("4.21.3-1")) + BOOST_CHECK(it->baseversion().edition().match(Edition("4.21.3-1")) ||it->baseversion().edition().match(Edition("4.21.2-3"))); cout << it->name() << " - " << it->edition() << " - " << it->arch() @@ -69,10 +63,9 @@ cout << (it->edition() == "4.21.3-2") << endl; // fine cout << (it->edition() == Edition("4.21.3-2")) << endl; // fine - cout << (it->edition().match(Edition("4.21.3-2"))) << endl; //! \todo FIXME says no - cout << (it->edition().match("4.21.3-2")) << endl; //! \todo FIXME says no + cout << (it->edition().match(Edition("4.21.3-2")) == 0) << endl; // !match returns -1,0,1 + cout << (it->edition().match("4.21.3-2") == 0) << endl; // !match returns -1,0,1 } //! \todo FIXME Edition("0:4.21.3-2") != Edition("4.21.3-2") (not even does Edition("0:4.21.3-2").match(Edition("4.21.3-2")) - rm.cleanCache(updates); } Modified: trunk/libzypp/zypp/KeyRing.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/KeyRing.cc?rev=11102&r1=11101&r2=11102&view=diff ============================================================================== --- trunk/libzypp/zypp/KeyRing.cc (original) +++ trunk/libzypp/zypp/KeyRing.cc Fri Sep 19 13:25:51 2008 @@ -55,34 +55,34 @@ namespace { - KeyRingReport::DefaultAccept _keyRingDefaultAccept( KeyRingReport::ACCEPT_NOTHING ); + KeyRing::DefaultAccept _keyRingDefaultAccept( KeyRing::ACCEPT_NOTHING ); } - KeyRingReport::DefaultAccept KeyRingReport::defaultAccept() + KeyRing::DefaultAccept KeyRing::defaultAccept() { return _keyRingDefaultAccept; } - void KeyRingReport::setDefaultAccept( DefaultAccept value_r ) + void KeyRing::setDefaultAccept( DefaultAccept value_r ) { - MIL << "Set new default accept: " << value_r << endl; + MIL << "Set new KeyRing::DefaultAccept: " << value_r << endl; _keyRingDefaultAccept = value_r; } /////////////////////////////////////////////////////////////////// bool KeyRingReport::askUserToAcceptUnsignedFile( const string &file ) - { return _keyRingDefaultAccept.testFlag( ACCEPT_UNSIGNED_FILE ); } + { return _keyRingDefaultAccept.testFlag( KeyRing::ACCEPT_UNSIGNED_FILE ); } bool KeyRingReport::askUserToAcceptUnknownKey( const string &file, const string &id ) - { return _keyRingDefaultAccept.testFlag( ACCEPT_UNKNOWNKEY ); } + { return _keyRingDefaultAccept.testFlag( KeyRing::ACCEPT_UNKNOWNKEY ); } bool KeyRingReport::askUserToTrustKey( const PublicKey &key ) - { return _keyRingDefaultAccept.testFlag( TRUST_KEY ); } + { return _keyRingDefaultAccept.testFlag( KeyRing::TRUST_KEY ); } bool KeyRingReport::askUserToImportKey( const PublicKey &key) - { return _keyRingDefaultAccept.testFlag( IMPORT_KEY ); } + { return _keyRingDefaultAccept.testFlag( KeyRing::IMPORT_KEY ); } bool KeyRingReport::askUserToAcceptVerificationFailed( const string &file, const PublicKey &key ) - { return _keyRingDefaultAccept.testFlag( ACCEPT_VERIFICATION_FAILED ); } + { return _keyRingDefaultAccept.testFlag( KeyRing::ACCEPT_VERIFICATION_FAILED ); } /////////////////////////////////////////////////////////////////// // @@ -91,25 +91,14 @@ /** KeyRing implementation. */ struct KeyRing::Impl { - Impl(const Pathname &baseTmpDir) - : _trusted_tmp_dir(baseTmpDir, "zypp-trusted-kr") - , _general_tmp_dir(baseTmpDir, "zypp-general-kr") - , _base_dir( baseTmpDir ) - + Impl( const Pathname & baseTmpDir ) + : _trusted_tmp_dir( baseTmpDir, "zypp-trusted-kr" ) + , _general_tmp_dir( baseTmpDir, "zypp-general-kr" ) + , _base_dir( baseTmpDir ) { + MIL << "Current KeyRing::DefaultAccept: " << _keyRingDefaultAccept << endl; } - /* - Impl( const Pathname &general_kr, const Pathname &trusted_kr ) - { - filesystem::assert_dir(general_kr); - filesystem::assert_dir(trusted_kr); - - generalKeyRing() = general_kr; - trustedKeyRing() = trusted_kr; - } - */ - void importKey( const PublicKey &key, bool trusted = false); void deleteKey( const string &id, bool trusted ); Modified: trunk/libzypp/zypp/KeyRing.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/KeyRing.h?rev=11102&r1=11101&r2=11102&view=diff ============================================================================== --- trunk/libzypp/zypp/KeyRing.h (original) +++ trunk/libzypp/zypp/KeyRing.h Fri Sep 19 13:25:51 2008 @@ -33,7 +33,12 @@ /** Callbacks from signature verification workflow. * - * Per default all methods answer \c false. + * Per default all methods answer \c false. This may be canged + * by calling \ref KeyRing::setDefaultAccept. + * \code + * KeyRing::setDefaultAccept( KeyRing::ACCEPT_UNSIGNED_FILE | KeyRing::ACCEPT_VERIFICATION_FAILED ); + * \endcode + * \see \ref KeyRing */ struct KeyRingReport : public callback::ReportBase { @@ -78,29 +83,7 @@ */ virtual bool askUserToAcceptVerificationFailed( const std::string &filedesc, const PublicKey &key ); - public: - /** \name Query/change the default values. - * Per default all methods answer \c false. - */ - //@{ - enum DefaultAcceptBits - { - ACCEPT_NOTHING = 0x0000, - ACCEPT_UNSIGNED_FILE = 0x0001, - ACCEPT_UNKNOWNKEY = 0x0002, - TRUST_KEY = 0x0004, - IMPORT_KEY = 0x0008, - ACCEPT_VERIFICATION_FAILED = 0x0010, - }; - ZYPP_DECLARE_FLAGS(DefaultAccept,DefaultAcceptBits); - - /** Get the active accept bits. */ - static DefaultAccept defaultAccept(); - /** Set the active accept bits. */ - static void setDefaultAccept( DefaultAccept value_r ); - //@} }; - ZYPP_DECLARE_OPERATORS_FOR_FLAGS(KeyRingReport::DefaultAccept); struct KeyRingSignals : public callback::ReportBase { @@ -133,12 +116,43 @@ // // CLASS NAME : KeyRing // - /** Class that represent a text and multiple translations. + /** Gpg key handling. + * */ - class KeyRing : public base::ReferenceCounted, private base::NonCopyable + class KeyRing : public base::ReferenceCounted, private base::NonCopyable { friend std::ostream & operator<<( std::ostream & str, const KeyRing & obj ); + public: + /** \name Default answers in verification workflow. + * Per default all answers are \c false. + */ + //@{ + /** \ref DefaultAccept flags (\see \ref base::Flags) are used to + * define the default callback answers during signature verification. + * \code + * KeyRingReport::setDefaultAccept( KeyRing::ACCEPT_UNSIGNED_FILE | ACCEPT_VERIFICATION_FAILED ); + * \endcode + * \see \ref KeyRingReport. + */ + enum DefaultAcceptBits + { + ACCEPT_NOTHING = 0x0000, + ACCEPT_UNSIGNED_FILE = 0x0001, + ACCEPT_UNKNOWNKEY = 0x0002, + TRUST_KEY = 0x0004, + IMPORT_KEY = 0x0008, + ACCEPT_VERIFICATION_FAILED = 0x0010, + }; + ZYPP_DECLARE_FLAGS( DefaultAccept, DefaultAcceptBits ); + + /** Get the active accept bits. */ + static DefaultAccept defaultAccept(); + + /** Set the active accept bits. */ + static void setDefaultAccept( DefaultAccept value_r ); + //@} + public: /** Implementation */ class Impl; @@ -257,6 +271,9 @@ return str; } + /** \relates KeyRing::DefaultAccept */ + ZYPP_DECLARE_OPERATORS_FOR_FLAGS( KeyRing::DefaultAccept ); + /////////////////////////////////////////////////////////////////// namespace target -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org