Author: mlandres
Date: Tue Feb 19 16:08:32 2008
New Revision: 8814
URL: http://svn.opensuse.org/viewcvs/zypp?rev=8814&view=rev
Log:
backup
Modified:
trunk/libzypp/devel/devel.ma/NewPool.cc
trunk/libzypp/devel/devel.ma/Tools.h
Modified: trunk/libzypp/devel/devel.ma/NewPool.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/devel/devel.ma/NewPool.cc?rev=8814&r1=8813&r2=8814&view=diff
==============================================================================
--- trunk/libzypp/devel/devel.ma/NewPool.cc (original)
+++ trunk/libzypp/devel/devel.ma/NewPool.cc Tue Feb 19 16:08:32 2008
@@ -5,6 +5,7 @@
#include
#include
#include
+#include
#include
#include
@@ -414,10 +415,57 @@
#undef OUTS
}
-void foo( int i, const Capability & c )
-{
- WAR << c << endl;
-}
+///////////////////////////////////////////////////////////////////
+namespace zypp
+{ /////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////
+namespace sat
+{ /////////////////////////////////////////////////////////////////
+
+ class ByLocaleSupport
+ {
+ private:
+ typedef bool (sat::Solvable::*LS1) (const Locale &) const;
+ typedef bool (sat::Solvable::*LS2) (const LocaleSet &) const;
+
+ public:
+ /** Solvables with locale support. */
+ ByLocaleSupport()
+ : _sel( mem_fun_ref( &sat::Solvable::supportsLocales ) )
+ {}
+
+ /** Solvables supporting \c locale_r. */
+ ByLocaleSupport( const Locale & locale_r )
+ : _sel( bind( mem_fun_ref( (LS1)&sat::Solvable::supportsLocale ), _1, locale_r ) )
+ {}
+
+ /** Solvables supporting at least one locale in \c locales_r. */
+ ByLocaleSupport( const LocaleSet & locales_r )
+ : _sel( bind( boost::mem_fun_ref( (LS2)&sat::Solvable::supportsLocale ), _1, locales_r ) )
+ {}
+
+ public:
+ bool operator()( const sat::Solvable & solv_r ) const
+ { return _sel && _sel( solv_r ); }
+
+
+ template<class _Solv>
+ bool operator()( const _Solv & solv_r ) const
+ { return operator()( solv_r.satSolvable() ); }
+
+ private:
+ function _sel;
+ };
+
+
+ /////////////////////////////////////////////////////////////////
+} // namespace sat
+///////////////////////////////////////////////////////////////////
+
+ /////////////////////////////////////////////////////////////////
+} // namespace zypp
+///////////////////////////////////////////////////////////////////
+
/******************************************************************
**
@@ -474,7 +522,7 @@
}
}
- if ( 1 )
+ if ( 0 )
{
Measure x( "INIT TARGET" );
{
@@ -483,9 +531,55 @@
}
}
- satpool.addRepoSolv( "/Local/ROOT/cache/openSUSE-11.0.solv" );
USR << "pool: " << pool << endl;
+ ///////////////////////////////////////////////////////////////////
+
+ satpool.addRequestedLocale( Locale("de") );
+ satpool.addRequestedLocale( Locale("cs") );
+
+ LocaleSet s;
+ s.insert( Locale("de") );
+
+// MIL << satpool.getAvailableLocales() << endl;
+
+ {
+ Measure x( "de" );
+ sat::ByLocaleSupport f( Locale("de") );
+ for_( it, satpool.filterBegin(f), satpool.filterEnd(f) )
+ {
+ MIL << *it << endl;
+ }
+ }
+ {
+ Measure x( "ja" );
+ sat::ByLocaleSupport f( s );
+ for_( it, satpool.filterBegin(f), satpool.filterEnd(f) )
+ {
+ MIL << *it << endl;
+ }
+ }
+ {
+ Measure x( "requested" );
+ sat::ByLocaleSupport f( satpool.getRequestedLocales() );
+ for_( it, satpool.filterBegin(f), satpool.filterEnd(f) )
+ {
+ MIL << *it << endl;
+ }
+ }
+ {
+ Measure x( "requested" );
+ sat::ByLocaleSupport f( satpool.getRequestedLocales() );
+ for_( it, pool.filterBegin(f), pool.filterEnd(f) )
+ {
+ MIL << *it << endl;
+ }
+ }
+
+
+ //MIL << sat::WhatProvides( Capability("amarok") ) << endl;
+ //MIL << sat::WhatProvides( Capability("amarok == 1.4.7-37.4") ) << endl;
+ if ( 0 )
{
Measure x( "Upgrade" );
UpgradeStatistics u;
Modified: trunk/libzypp/devel/devel.ma/Tools.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/devel/devel.ma/Tools.h?rev=8814&r1=8813&r2=8814&view=diff
==============================================================================
--- trunk/libzypp/devel/devel.ma/Tools.h (original)
+++ trunk/libzypp/devel/devel.ma/Tools.h Tue Feb 19 16:08:32 2008
@@ -31,11 +31,6 @@
///////////////////////////////////////////////////////////////////
-#define for_(IT,BEG,END) for ( typeof(BEG) IT = BEG; IT != END; ++IT )
-
-///////////////////////////////////////////////////////////////////
-//
-
void waitForInput()
{
int i;
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org