Author: mlandres
Date: Wed Apr 11 15:33:10 2007
New Revision: 5337
URL: http://svn.opensuse.org/viewcvs/zypp?rev=5337&view=rev
Log: (empty)
Modified:
trunk/libzypp/devel/devel.ma/AOUT.cc
trunk/libzypp/devel/devel.ma/CMakeLists.txt
trunk/libzypp/devel/devel.ma/Parse.cc
Modified: trunk/libzypp/devel/devel.ma/AOUT.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/devel/devel.ma/AOUT.cc?rev=5337&r1=5336&r2=5337&view=diff
==============================================================================
--- trunk/libzypp/devel/devel.ma/AOUT.cc (original)
+++ trunk/libzypp/devel/devel.ma/AOUT.cc Wed Apr 11 15:33:10 2007
@@ -1,32 +1,19 @@
#include <iostream>
#include <fstream>
+#include <string>
+#include <list>
-#include
-
-#define DBG std::cout
-#define MIL std::cout
-#define WAR std::cerr
-#define ERR std::cerr
+#include
+#include
+#include
using std::endl;
+using namespace zypp;
///////////////////////////////////////////////////////////////////
namespace parse
{ /////////////////////////////////////////////////////////////////
- std::string getline( std::istream & str )
- {
- static const unsigned tmpBuffLen = 1024;
- static char tmpBuff[tmpBuffLen];
- std::string ret;
- do {
- str.clear();
- str.getline( tmpBuff, tmpBuffLen ); // always writes '\0' terminated
- ret += tmpBuff;
- } while( str.rdstate() == std::ios::failbit );
-
- return ret;
- }
/////////////////////////////////////////////////////////////////
} // namespace parse
@@ -42,7 +29,14 @@
{
DBG << "===[START]==========================================" << endl;
+ const char * _l[] = { "a", "b", "c", "a", "b", "c" };
+ std::liststd::string l( _l, _l+(sizeof(_l)/sizeof(*_l)) );
+ DBG << l << endl;
+
+ std::list<PackageKeyword> k( l.begin(), l.end() );
+ DBG << k << endl;
+ dumpRange( MIL, PackageKeyword::allBegin(), PackageKeyword::allEnd() );
DBG << "===[END]============================================" << endl;
Modified: trunk/libzypp/devel/devel.ma/CMakeLists.txt
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/devel/devel.ma/CMakeLists.txt?rev=5337&r1=5336&r2=5337&view=diff
==============================================================================
--- trunk/libzypp/devel/devel.ma/CMakeLists.txt (original)
+++ trunk/libzypp/devel/devel.ma/CMakeLists.txt Wed Apr 11 15:33:10 2007
@@ -45,6 +45,7 @@
)
TARGET_LINK_LIBRARIES( ${loop_var}
boost_filesystem boost_regex
+ zypp
)
ENDFOREACH( loop_var )
Modified: trunk/libzypp/devel/devel.ma/Parse.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/devel/devel.ma/Parse.cc?rev=5337&r1=5336&r2=5337&view=diff
==============================================================================
--- trunk/libzypp/devel/devel.ma/Parse.cc (original)
+++ trunk/libzypp/devel/devel.ma/Parse.cc Wed Apr 11 15:33:10 2007
@@ -19,6 +19,7 @@
#include "zypp/Package.h"
#include "zypp/Pattern.h"
#include "zypp/Language.h"
+#include "zypp/PackageKeyword.h"
#include "zypp/NameKindProxy.h"
#include "zypp/pool/GetResolvablesToInsDel.h"
@@ -186,6 +187,13 @@
MIL << p->installtime() << endl;
}
+void doPkg( const PoolItem & pi )
+{
+ Package::constPtr p( asKind<Package>(pi) );
+ MIL << p << endl;
+ DBG << p->keywords() << endl;
+}
+
///////////////////////////////////////////////////////////////////
/******************************************************************
**
@@ -207,12 +215,11 @@
//zypp::base::LogControl::TmpLineWriter shutUp;
SourceManager::sourceManager()->restore( root );
-
if ( SourceManager::sourceManager()->allSources().empty() )
{
{
zypp::base::LogControl::TmpLineWriter shutUp;
- Source_Ref src1( createSource( "dir:/Local/SLES10" ) );
+ Source_Ref src1( createSource( "dir:/dist/install/SLP/openSUSE-10.3-Build00300-DVD/i386/DVD1" ) );
SourceManager::sourceManager()->addSource( src1 );
SourceManager::sourceManager()->store( root, true );
}
@@ -228,75 +235,18 @@
}
}
- Source_Ref src1( *SourceManager::sourceManager()->Source_begin() );
- getZYpp()->addResolvables( src1.resolvables() );
+ std::for_each( SourceManager::sourceManager()->Source_begin(),
+ SourceManager::sourceManager()->Source_end(),
+ AddResolvables() );
ResPool pool( getZYpp()->pool() );
-
- src1.providePackage( asKind<Package>(*pool.byKindBegin<Package>()) );
-
- INT << "===[END]============================================" << endl << endl;
- zypp::base::LogControl::instance().logNothing();
- return 0;
-
-
- PoolItem prod( *pool.byKindBegin<Product>() );
- showProd( prod );
- PoolItem pac( *pool.byNameBegin("java-1_4_2-sun-plugin") );
-
- if ( 1 )
- {
- zypp::base::LogControl::TmpLineWriter shutUp;
- getZYpp()->initTarget( sysRoot );
- USR << "Added target: " << pool << endl;
- }
-
- prod.status().setTransact( true, ResStatus::USER );
- pac.status().setTransact( true, ResStatus::USER );
- ZYppCommitPolicy policy;
- policy.rpmNoSignature();
- ZYppCommitResult res( getZYpp()->commit( policy ) );
-
- SEC << res << endl;
-
- zypp::base::LogControl::instance().logNothing();
- return 0;
-
-
-
- if ( 1 )
- {
-#define selt(K,N) selectForTransact( nameKindProxy<K>( pool, #N ) )
- selt( Script, fetchmsttfonts.sh-patch-fetchmsttfonts.sh-2 );
-#undef selt
- }
-
- vdumpPoolStats( USR << "Transacting:"<< endl,
- make_filter_beginresfilter::ByTransact(pool),
- make_filter_endresfilter::ByTransact(pool) ) << endl;
-
- if ( 1 ) {
- bool eres, rres;
- {
- //zypp::base::LogControl::TmpLineWriter shutUp;
- //zypp::base::LogControl::instance().logfile( "SOLVER" );
- eres = getZYpp()->resolver()->establishPool();
- rres = getZYpp()->resolver()->resolvePool();
- }
- MIL << "est " << eres << " slv " << rres << endl;
- }
-
- dumpPoolStats( USR << "Transacting:"<< endl,
- make_filter_beginresfilter::ByTransact(pool),
- make_filter_endresfilter::ByTransact(pool) ) << endl;
-
-
- if ( 1 )
- {
- ZYppCommitPolicy policy;
- policy.rpmNoSignature();
- ZYppCommitResult res( getZYpp()->commit( policy ) );
- }
+ dumpRange( USR << "PackageKeywords: " << PackageKeyword::allSize(),
+ PackageKeyword::allBegin(),
+ PackageKeyword::allEnd() ) << endl;
+
+ std::for_each( pool.byKindBegin<Package>(),
+ pool.byKindEnd<Package>(),
+ doPkg );
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