3 #include "zypp/base/Easy.h"
4 #include "zypp/base/LogTools.h"
5 #include "zypp/base/InputStream.h"
6 #include "zypp/base/ReferenceCounted.h"
7 #include "zypp/base/NonCopyable.h"
8 #include "zypp/base/PtrTypes.h"
10 #include "zypp/TmpPath.h"
11 #include "zypp/RepoManager.h"
16 ///////////////////////////////////////////////////////////////////
18 RepoManager makeRepoManager( const Pathname & mgrdir_r )
21 RepoManagerOptions mgropt;
22 mgropt.repoCachePath = mgrdir_r/"cache";
23 mgropt.repoRawCachePath = mgrdir_r/"raw_cache";
24 mgropt.knownReposPath = mgrdir_r/"repos";
26 return RepoManager( mgropt );
29 struct Impl : public base::ReferenceCounted
34 DEFINE_PTR_TYPE(Impl);
37 inline std::ostream & operator<<( std::ostream & str, const Impl & obj )
38 { return str << &obj; }
42 MIL << "n " << _nimpl << endl; \
43 MIL << "n " << (_nimpl?1:0) << endl; \
44 MIL << "p " << _pimpl << endl; \
45 MIL << "p " << (_pimpl?1:0) << endl; \
46 MIL << "P " << _Pimpl << endl; \
47 MIL << "P " << (_Pimpl?1:0) << endl; \
48 MIL << "= " << (_nimpl == _pimpl) << endl; \
49 MIL << "! " << (_nimpl != _pimpl) << endl; \
50 MIL << "= " << (_Pimpl == _pimpl) << endl; \
51 MIL << "! " << (_Pimpl != _pimpl) << endl; \
52 MIL << "= " << (_pimpl == _pimpl) << endl; \
53 MIL << "! " << (_pimpl != _pimpl) << endl;
55 /******************************************************************
57 ** FUNCTION NAME : main
58 ** FUNCTION TYPE : int
60 int main( int argc, char * argv[] )
62 INT << "===[START]==========================================" << endl;
65 RW_pointer<Impl,rw_pointer::Intrusive<Impl> > _nimpl;
66 RW_pointer<Impl,rw_pointer::Intrusive<Impl> > _pimpl(new Impl);
67 RW_pointer<Impl,rw_pointer::Intrusive<Impl> > _Pimpl(new Impl);
71 RW_pointer<Impl,rw_pointer::Shared<Impl> > _nimpl;
72 RW_pointer<Impl,rw_pointer::Shared<Impl> > _pimpl(new Impl);
73 RW_pointer<Impl,rw_pointer::Shared<Impl> > _Pimpl(new Impl);
77 RW_pointer<Impl,rw_pointer::Scoped<Impl> > _nimpl;
78 RW_pointer<Impl,rw_pointer::Scoped<Impl> > _pimpl(new Impl);
79 RW_pointer<Impl,rw_pointer::Scoped<Impl> > _Pimpl(new Impl);
83 INT << "===[END]============================================" << endl << endl;
86 RepoManager repoManager( makeRepoManager( "/ROOT" ) );
87 RepoInfoList repos = repoManager.knownRepositories();
94 .setAlias( "factorytest" )
95 .setName( "Test Repo for factory." )
97 .setAutorefresh( false )
98 .addBaseUrl( Url("ftp://dist.suse.de/install/stable-x86/") );
100 repoManager.addRepository( nrepo );
101 repos = repoManager.knownRepositories();
102 SEC << repos << endl;
104 // SEC << "refreshMetadat" << endl;
105 // repoManager.refreshMetadata( nrepo );
106 // SEC << "buildCache" << endl;
107 // repoManager.buildCache( nrepo );
108 // SEC << "------" << endl;
111 INT << "===[END]============================================" << endl << endl;