Author: mlandres
Date: Thu Jun 19 17:42:55 2008
New Revision: 10408
URL: http://svn.opensuse.org/viewcvs/zypp?rev=10408&view=rev
Log:
backup
Modified:
trunk/libzypp/devel/devel.ma/CMakeLists.txt
trunk/libzypp/devel/devel.ma/MaTest.cc
trunk/libzypp/devel/devel.ma/Main.cc
Modified: trunk/libzypp/devel/devel.ma/CMakeLists.txt
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/devel/devel.ma/CMakeLists.txt?rev=10408&r1=10407&r2=10408&view=diff
==============================================================================
--- trunk/libzypp/devel/devel.ma/CMakeLists.txt (original)
+++ trunk/libzypp/devel/devel.ma/CMakeLists.txt Thu Jun 19 17:42:55 2008
@@ -44,7 +44,7 @@
${loop_var}.cc
)
TARGET_LINK_LIBRARIES( ${loop_var}
- zypp
+ zypp boost_signals
${QT_LIBRARIES}
)
ENDFOREACH( loop_var )
Modified: trunk/libzypp/devel/devel.ma/MaTest.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/devel/devel.ma/MaTest.cc?rev=10408&r1=10407&r2=10408&view=diff
==============================================================================
--- trunk/libzypp/devel/devel.ma/MaTest.cc (original)
+++ trunk/libzypp/devel/devel.ma/MaTest.cc Thu Jun 19 17:42:55 2008
@@ -1,12 +1,86 @@
#include <iostream>
+
+#include
+#include
+
#include
#include
-#include
using std::endl;
using std::cout;
+
+namespace boost
+{
+ template<class Tp>
+ std::ostream & operator<<( std::ostream & str, const signal<Tp> & obj )
+ {
+ return str << "Connected slots: " << obj.num_slots();
+ }
+
+ namespace signals
+ {
+ std::ostream & operator<<( std::ostream & str, const connection & obj )
+ {
+ return str << "Connection: "
+ << ( obj.connected() ? '*' : '_' )
+ << ( obj.blocked() ? 'B' : '_' )
+ ;
+ }
+ }
+}
+
using namespace zypp;
+using boost::signal;
+using boost::signals::connection;
+using boost::signals::trackable;
+
+struct HelloWorld
+{
+ HelloWorld() {++i;}
+ HelloWorld(const HelloWorld &) {++i;}
+ ~HelloWorld() { --i;}
+
+ void operator()(unsigned) const
+ {
+ USR << "Hello, World! " << i << std::endl;
+ }
+
+ static int i;
+};
+
+int HelloWorld::i = 0;
+
+struct M
+{
+ void ping() const
+ {
+ static unsigned i = 0;
+ _sigA( ++i );
+ }
+
+ typedef signal SigA;
+
+ SigA & siga() const { return _sigA; }
+
+ mutable SigA _sigA;
+};
+
+struct X : public trackable
+{
+ X() {++s;}
+ X( const X & ) {++s;}
+ ~X() {--s;}
+ static int s;
+
+ void pong( unsigned i ) const
+ {
+ DBG << s << ' ' << i << endl;
+ }
+};
+
+int X::s;
+
/******************************************************************
**
** FUNCTION NAME : main
@@ -15,24 +89,23 @@
int main( int argc, const char * argv[] )
{
--argc; ++argv; // skip arg 0
- sat::Pool satpool( sat::Pool::instance() );
- for ( ; argc; --argc, ++argv )
+ M m;
+ X xx;
+ m.siga().connect( boost::bind( &X::pong, &xx, _1 ) );
+ m.ping();
+
{
- cout << "Read: " << argv[0] << endl;
- satpool.addRepoSolv( argv[0] );
+ X x;
+ m.siga().connect( boost::bind( &X::pong, &x, _1 ) );
+ m.ping();
}
- cout << "Done: " << satpool << endl;
+ m.ping();
- if ( getenv("VERBOSE") )
- {
- for_( it, satpool.solvablesBegin(), satpool.solvablesEnd() )
- {
- cout << dump(*it) << endl;
- }
- }
+ ///////////////////////////////////////////
+ INT << "---STOP" << endl;
return 0;
}
Modified: trunk/libzypp/devel/devel.ma/Main.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/devel/devel.ma/Main.cc?rev=10408&r1=10407&r2=10408&view=diff
==============================================================================
--- trunk/libzypp/devel/devel.ma/Main.cc (original)
+++ trunk/libzypp/devel/devel.ma/Main.cc Thu Jun 19 17:42:55 2008
@@ -15,42 +15,9 @@
///////////////////////////////////////////////////////////////////
-RepoManager makeRepoManager( const Pathname & mgrdir_r )
-{
-
- RepoManagerOptions mgropt;
- mgropt.repoCachePath = mgrdir_r/"cache";
- mgropt.repoRawCachePath = mgrdir_r/"raw_cache";
- mgropt.knownReposPath = mgrdir_r/"repos";
+static const Pathname sysRoot( getenv("SYSROOT") ? getenv("SYSROOT") : "/Local/ROOT" );
- return RepoManager( mgropt );
-}
-
-struct Impl : public base::ReferenceCounted
-{
- Impl() : i(13) {}
- int i;
-};
-DEFINE_PTR_TYPE(Impl);
-IMPL_PTR_TYPE(Impl);
-
-inline std::ostream & operator<<( std::ostream & str, const Impl & obj )
-{ return str << &obj; }
-
-#define TCODE \
- SEC << endl; \
- MIL << "n " << _nimpl << endl; \
- MIL << "n " << (_nimpl?1:0) << endl; \
- MIL << "p " << _pimpl << endl; \
- MIL << "p " << (_pimpl?1:0) << endl; \
- MIL << "P " << _Pimpl << endl; \
- MIL << "P " << (_Pimpl?1:0) << endl; \
- MIL << "= " << (_nimpl == _pimpl) << endl; \
- MIL << "! " << (_nimpl != _pimpl) << endl; \
- MIL << "= " << (_Pimpl == _pimpl) << endl; \
- MIL << "! " << (_Pimpl != _pimpl) << endl; \
- MIL << "= " << (_pimpl == _pimpl) << endl; \
- MIL << "! " << (_pimpl != _pimpl) << endl;
+///////////////////////////////////////////////////////////////////
/******************************************************************
**
@@ -61,53 +28,21 @@
{
INT << "===[START]==========================================" << endl;
- {
- RW_pointer _nimpl;
- RW_pointer _pimpl(new Impl);
- RW_pointer _Pimpl(new Impl);
- TCODE;
- }
- {
- RW_pointer _nimpl;
- RW_pointer _pimpl(new Impl);
- RW_pointer _Pimpl(new Impl);
- TCODE;
- }
- {
- RW_pointer _nimpl;
- RW_pointer _pimpl(new Impl);
- RW_pointer _Pimpl(new Impl);
- TCODE;
- }
-
- INT << "===[END]============================================" << endl << endl;
- return 0;
+ //TmpDir tmp_dir;
+ //KeyRing keyring( tmp_dir.path() );
- RepoManager repoManager( makeRepoManager( "/ROOT" ) );
- RepoInfoList repos = repoManager.knownRepositories();
- SEC << repos << endl;
-
- if ( repos.empty() )
{
- RepoInfo nrepo;
- nrepo
- .setAlias( "factorytest" )
- .setName( "Test Repo for factory." )
- .setEnabled( true )
- .setAutorefresh( false )
- .addBaseUrl( Url("ftp://dist.suse.de/install/stable-x86/") );
-
- repoManager.addRepository( nrepo );
- repos = repoManager.knownRepositories();
- SEC << repos << endl;
-
-// SEC << "refreshMetadat" << endl;
-// repoManager.refreshMetadata( nrepo );
-// SEC << "buildCache" << endl;
-// repoManager.buildCache( nrepo );
-// SEC << "------" << endl;
+ Measure x( "INIT TARGET" );
+ {
+ {
+ //zypp::base::LogControl::TmpLineWriter shutUp;
+ getZYpp()->initializeTarget( sysRoot );
+ }
+ //getZYpp()->target()->load();
+ }
}
+
INT << "===[END]============================================" << endl << endl;
return 0;
}
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org