- Fix Deltarpm_test. Running the test polluted the source tree.
# 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)
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
}
repoManager.loadFromCache( nrepo );
-#endif
///////////////////////////////////////////////////////////////////
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
UpgradeStatistics u;
getZYpp()->resolver()->doUpgrade( u );
}
+
///////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////
}
}
+
+ //////////////////////////////////////////////////////////////////
+ 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;
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);
-------------------------------------------------------------------
+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.
#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"
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
{
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()
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);
}
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 ); }
///////////////////////////////////////////////////////////////////
//
/** 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 );
/** 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
{
*/
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
{
//
// 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;
return str;
}
+ /** \relates KeyRing::DefaultAccept */
+ ZYPP_DECLARE_OPERATORS_FOR_FLAGS( KeyRing::DefaultAccept );
+
///////////////////////////////////////////////////////////////////
namespace target