Imported Upstream version 14.45.0
[platform/upstream/libzypp.git] / devel / devel.ma / main.cc
1 #include "Tools.h"
2
3 #include <zypp/ResPool.h>
4 #include <zypp/ResObjects.h>
5 #include <zypp/PoolQuery.h>
6
7 #include <zypp/misc/CheckAccessDeleted.h>
8
9 ///////////////////////////////////////////////////////////////////
10
11 Pathname sysRoot( getenv("SYSROOT") ? getenv("SYSROOT") : "/Local/ROOT" );
12
13 ///////////////////////////////////////////////////////////////////
14
15 int main( int argc, char * argv[] )
16 try {
17   --argc;
18   ++argv;
19   zypp::base::LogControl::instance().logToStdErr();
20   INT << "===[START]==========================================" << endl;
21   if ( argc )
22   {
23     unsetenv("SYSROOT");
24     sysRoot = Pathname(*argv);
25     setenv( "ZYPP_CONF", (sysRoot/"etc/zypp.conf").c_str(), true );
26   }
27   ZConfig::instance();
28   //TestSetup::LoadSystemAt( sysRoot );
29   ///////////////////////////////////////////////////////////////////
30   ResPool   pool( ResPool::instance() );
31   sat::Pool satpool( sat::Pool::instance() );
32   ///////////////////////////////////////////////////////////////////
33   dumpRange( USR, satpool.reposBegin(), satpool.reposEnd() ) << endl;
34   USR << "pool: " << pool << endl;
35   ///////////////////////////////////////////////////////////////////
36
37   {
38     Measure x("x");
39     CheckAccessDeleted checker;
40     USR << checker << endl;
41   }
42   SEC << CheckAccessDeleted::findService( "syslog" ) << endl;
43   SEC << CheckAccessDeleted::findService( "syslogd" ) << endl;
44   SEC << CheckAccessDeleted::findService( "ssh" ) << endl;
45   SEC << CheckAccessDeleted::findService( "sshd" ) << endl;
46   SEC << CheckAccessDeleted::findService( 3844 ) << endl;
47   ///////////////////////////////////////////////////////////////////
48   INT << "===[END]============================================" << endl << endl;
49   zypp::base::LogControl::instance().logNothing();
50   return 0;
51 }
52 catch ( const Exception & exp )
53 {
54   INT << exp << endl << exp.historyAsString();
55 }
56 catch (...)
57 {}
58