ref: refs/heads/master
commit 98f1bec57a8a79f0c3eac51aeb4510678c1938e6
Author: Michael Andres
Date: Fri Aug 7 12:28:18 2009 +0200
backup
---
devel/devel.ma/Main.cc | 56 +++++++++++++++++++++++++++++++----
devel/devel.ma/main.cc | 76 ++++++++++++-----------------------------------
2 files changed, 70 insertions(+), 62 deletions(-)
diff --git a/devel/devel.ma/Main.cc b/devel/devel.ma/Main.cc
index 55c0f42..8443087 100644
--- a/devel/devel.ma/Main.cc
+++ b/devel/devel.ma/Main.cc
@@ -1,11 +1,13 @@
#include "Tools.h"
#include
+#include
///////////////////////////////////////////////////////////////////
//static const Pathname sysRoot( getenv("SYSROOT") ? getenv("SYSROOT") : "/Local/ROOT" );
static const Pathname sysRoot( "/tmp/Local/ma/DNL-test" );
+//static const Pathname sysRoot( "/" );
///////////////////////////////////////////////////////////////////
@@ -14,17 +16,45 @@ bool solve()
bool rres = false;
{
//zypp::base::LogControl::TmpLineWriter shutUp;
- //rres = test.resolver().resolvePool();
+ rres = getZYpp()->resolver()->resolvePool();
}
if ( ! rres )
{
ERR << "resolve " << rres << endl;
+ getZYpp()->resolver()->problems();
return false;
}
MIL << "resolve " << rres << endl;
return true;
}
+bool upgrade()
+{
+ bool rres = false;
+ {
+ //zypp::base::LogControl::TmpLineWriter shutUp;
+ Measure x( "Upgrade" );
+ rres = getZYpp()->resolver()->doUpgrade();
+ }
+ if ( ! rres )
+ {
+ Measure x( "Upgrade Error" );
+ ERR << "upgrade " << rres << endl;
+ getZYpp()->resolver()->problems();
+ return false;
+ }
+ MIL << "upgrade " << rres << endl;
+ return true;
+}
+
+namespace zypp
+{
+ namespace target
+ {
+ void writeUpgradeTestcase();
+ }
+}
+
int main( int argc, char * argv[] )
try {
--argc;
@@ -33,6 +63,7 @@ try {
INT << "===[START]==========================================" << endl;
ZConfig::instance();
TestSetup::LoadSystemAt( sysRoot );
+ getZYpp()->initializeTarget( sysRoot );
///////////////////////////////////////////////////////////////////
ResPool pool( ResPool::instance() );
sat::Pool satpool( sat::Pool::instance() );
@@ -41,12 +72,25 @@ try {
USR << "pool: " << pool << endl;
///////////////////////////////////////////////////////////////////
+ if ( 1 )
+ {
+ getZYpp()->resolver()->addRequire( Capability("emacs") );
+ solve();
+ vdumpPoolStats( USR << "Transacting:"<< endl,
+ make_filter_beginresfilter::ByTransact(pool),
+ make_filter_endresfilter::ByTransact(pool) ) << endl;
+ }
+
- getZYpp()->resolver()->addRequire( Capability("xteddy") );
- solve();
- vdumpPoolStats( USR << "Transacting:"<< endl,
- make_filter_beginresfilter::ByTransact(pool),
- make_filter_endresfilter::ByTransact(pool) ) << endl;
+ {
+ ZYppCommitPolicy policy;
+ policy.dryRun( true );
+ policy.downloadMode( DownloadOnly );
+
+ USR << policy << endl;
+ ZYppCommitResult result( getZYpp()->commit( policy ) );
+ USR << result << endl;
+ }
///////////////////////////////////////////////////////////////////
diff --git a/devel/devel.ma/main.cc b/devel/devel.ma/main.cc
index 28bddb7..948d73f 100644
--- a/devel/devel.ma/main.cc
+++ b/devel/devel.ma/main.cc
@@ -1,37 +1,31 @@
#include "Tools.h"
+#include
+#include
#include
+#include
+
///////////////////////////////////////////////////////////////////
-static const Pathname sysRoot( getenv("SYSROOT") ? getenv("SYSROOT") : "/Local/ROOT" );
+Pathname sysRoot( getenv("SYSROOT") ? getenv("SYSROOT") : "/Local/ROOT" );
///////////////////////////////////////////////////////////////////
-bool solve()
-{
- bool rres = false;
- {
- //zypp::base::LogControl::TmpLineWriter shutUp;
- //rres = test.resolver().resolvePool();
- }
- if ( ! rres )
- {
- ERR << "resolve " << rres << endl;
- return false;
- }
- MIL << "resolve " << rres << endl;
- return true;
-}
-
int main( int argc, char * argv[] )
try {
--argc;
++argv;
zypp::base::LogControl::instance().logToStdErr();
INT << "===[START]==========================================" << endl;
+ if ( argc )
+ {
+ unsetenv("SYSROOT");
+ sysRoot = Pathname(*argv);
+ setenv( "ZYPP_CONF", (sysRoot/"etc/zypp.conf").c_str(), true );
+ }
ZConfig::instance();
- TestSetup::LoadSystemAt( sysRoot );
+ //TestSetup::LoadSystemAt( sysRoot );
///////////////////////////////////////////////////////////////////
ResPool pool( ResPool::instance() );
sat::Pool satpool( sat::Pool::instance() );
@@ -40,46 +34,16 @@ try {
USR << "pool: " << pool << endl;
///////////////////////////////////////////////////////////////////
- if ( 1 )
- {
- Measure x("-");
- sat::LookupAttr q( sat::SolvAttr::updateReference );
- for_( res, q.begin(), q.end() )
- {
- MIL << res << endl;
- }
- }
-
- if ( 0 )
{
- Measure( "x" );
-
- PoolQuery q;
- q.setMatchSubstring();
- q.setCaseSensitive( false );
- q.addAttribute( sat::SolvAttr::updateReference );
-
- for_( it, q.begin(), q.end() )
- {
- // for each matching patch
- MIL << *it << endl;
-
- if ( 0 )
- {
- for_( d, it.matchesBegin(), it.matchesEnd() )
- {
- // for each matching updateReferenceId in that patch:
- DBG << " - " << d->inSolvAttr() << "\t\"" << d->asString() << "\" has type \""
- << d->subFind( sat::SolvAttr::updateReferenceType ).asString() << "\"" << endl;
- for_( s, d->subBegin(), d->subEnd() )
- {
- DBG << " -" << s.inSolvAttr() << "\t\"" << s.asString() << "\"" << endl;
- }
- }
- }
- }
+ Measure x("x");
+ CheckAccessDeleted checker;
+ USR << checker << endl;
}
-
+ SEC << CheckAccessDeleted::findService( "syslog" ) << endl;
+ SEC << CheckAccessDeleted::findService( "syslogd" ) << endl;
+ SEC << CheckAccessDeleted::findService( "ssh" ) << endl;
+ SEC << CheckAccessDeleted::findService( "sshd" ) << endl;
+ SEC << CheckAccessDeleted::findService( 3844 ) << endl;
///////////////////////////////////////////////////////////////////
INT << "===[END]============================================" << endl << endl;
zypp::base::LogControl::instance().logNothing();
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org