#include "zypp/RepoManager.h"
#include "zypp/Repository.h"
#include "zypp/RepoInfo.h"
-
+#include "zypp/TriBool.h"
#include "zypp/repo/PackageProvider.h"
#include "zypp/ResPoolProxy.h"
INT << rs << endl;
}
-bool querycompare( const PoolQuery & q )
+bool querycompare( const PoolQuery & q, bool verbose = true )
{
q.begin();
SEC << q << endl;
for_( it, q.begin(), q.end() )
{
++nc;
- //DBG << it << endl;
+ if ( verbose )
+ DBG << it << endl;
}
- MIL << nc << endl;
+ SEC << "--> MATCHES: " << nc << endl;
}
return true;
}
+#include "zypp/MediaProducts.h"
+
/******************************************************************
**
** FUNCTION NAME : main
*/
int main( int argc, char * argv[] )
try {
- --argc;
- ++argv;
+ --argc,++argv;
zypp::base::LogControl::instance().logToStdErr();
INT << "===[START]==========================================" << endl;
ZConfig::instance();
+ USR << ZConfig::instance().rpmInstallFlags() << endl;
+
+ return 0;
+
ResPool pool( ResPool::instance() );
sat::Pool satpool( sat::Pool::instance() );
///////////////////////////////////////////////////////////////////
- Match m( Match::GLOB );
- SEC << m << endl;
- SEC << Match::REGEX << endl;
-
- m = Match::GLOB;
- SEC << m << endl;
- m = Match::NOTHING
- | Match::GLOB;
- SEC << m << endl;
- m = Match::GLOB
- | Match::STRING;
- SEC << m << endl;
- m = Match::FILES
- | Match::NOTHING;
- SEC << m << endl;
- m = Match::FILES - Match::STRING;
- SEC << m << endl;
-
- SEC << (Match::FILES==Match::NOTHING) << endl;
- SEC << (Match::FILES!=Match::NOTHING) << endl;
-
- ///////////////////////////////////////////////////////////////////
-
- std::string search("devel");
-
- PoolQuery q;
- //querycompare( q );
-
- q.addString(search);
- //q.addAttribute(sat::SolvAttr::name, "augeas" );
- //q.addAttribute(sat::SolvAttr::name );
- q.addAttribute(sat::SolvAttr::summary);
- q.setMatchSubstring();
- //q.setMatchExact();
- q.setCaseSensitive( false );
-
- //q.addRepo( "11.1-update" );
- //q.addRepo( "@System" );
+ {
+ PoolQuery q;
+ q.setCaseSensitive( false );
+ q.setMatchSubstring();
+ q.addString( "xteddy" );
+ q.addDependency( sat::SolvAttr::provides, "libzypp", Rel::EQ, Edition("4.2.6") );
+ q.addDependency( sat::SolvAttr::name, "zypper", Rel::LE, Edition("4.2.6") );
+ //q.addDependency( sat::SolvAttr::name, Capability("kernel-default") );
+ q.addKind( ResKind::package );
+ querycompare( q );
+ }
+ //////////////////////////////////////////////////////////////////
+ INT << "===[END]============================================" << endl << endl;
+ zypp::base::LogControl::instance().logNothing();
+ return 0;
- //q.addKind( ResKind::package );
- //q.addKind( ResKind::pattern );
- //q.addKind( ResKind::patch );
+ {
+ PoolQuery q;
+ q.setCaseSensitive( false );
+ q.setMatchSubstring();
+ q.addAttribute( sat::SolvAttr::provides, "libzypp" );
+ q.addKind( ResKind::package );
+ querycompare( q, false );
+
+ q.setMatchExact();
+ querycompare( q, false );
+
+ q.addString( "xteddy" );
+ querycompare( q, false );
+ }
+ {
+ PoolQuery q;
+ q.setCaseSensitive( false );
+ q.setMatchExact();
+ q.addKind( ResKind::package );
- //q.setEdition( Edition("1.0"), Rel::GE );
+ q.addAttribute( sat::SolvAttr::provides, "xteddy" );
+ querycompare( q, false );
+ }
- q.setMatchFiles();
+ {
+ PoolQuery q;
+ q.setCaseSensitive( false );
+ q.setMatchSubstring();
+ q.addDependency( sat::SolvAttr::provides, "libzypp" );
+ q.addKind( ResKind::package );
+ querycompare( q, false );
+
+ q.setMatchExact();
+ querycompare( q, false );
+
+ q.addString( "xteddy" );
+ querycompare( q, false );
+ }
+ {
+ PoolQuery q;
+ q.setCaseSensitive( false );
+ q.setMatchExact();
+ q.addKind( ResKind::package );
+
+ q.addDependency( sat::SolvAttr::provides, "xteddy" );
+ querycompare( q, false );
+ }
- querycompare( q );
#if 0
getZYpp()->resolver()->addRequire( Capability("amarok") );
#include "Tools.h"
-#include "zypp/pool/GetResolvablesToInsDel.h"
-static TestSetup test( Arch_x86_64 ); // use x86_64 as system arch
+#include <zypp/PoolQuery.h>
+
+///////////////////////////////////////////////////////////////////
+
+static const Pathname sysRoot( getenv("SYSROOT") ? getenv("SYSROOT") : "/Local/ROOT" );
+
+///////////////////////////////////////////////////////////////////
bool solve()
{
bool rres = false;
{
//zypp::base::LogControl::TmpLineWriter shutUp;
- rres = test.resolver().resolvePool();
+ //rres = test.resolver().resolvePool();
}
if ( ! rres )
{
++argv;
zypp::base::LogControl::instance().logToStdErr();
INT << "===[START]==========================================" << endl;
+ ZConfig::instance();
+ TestSetup::LoadSystemAt( sysRoot );
+ ///////////////////////////////////////////////////////////////////
+ ResPool pool( ResPool::instance() );
+ sat::Pool satpool( sat::Pool::instance() );
+ ///////////////////////////////////////////////////////////////////
+ dumpRange( USR, satpool.reposBegin(), satpool.reposEnd() ) << endl;
+ USR << "pool: " << pool << endl;
+ ///////////////////////////////////////////////////////////////////
- test.loadTarget(); // initialize and load target
- test.loadRepo( Url("iso:/?iso=/mounts/dist/install/openSUSE-11.1-Beta2-DONTUSE/kiwi.out.dvd-i586.iso") );
+ if ( 1 )
+ {
+ Measure x("-");
+ sat::LookupAttr q( sat::SolvAttr::updateReference );
+ for_( res, q.begin(), q.end() )
+ {
+ MIL << res << endl;
+ }
+ }
- ResPool pool( test.pool() );
- Resolver & resolver( test.resolver() );
+ if ( 0 )
+ {
+ Measure( "x" );
- resolver.addRequire( Capability("glibc") );
- resolver.addRequire( Capability("zlib") );
- resolver.addRequire( Capability("lsb-buildenv") );
- solve();
- vdumpPoolStats( USR << "Transacting:"<< endl,
- make_filter_begin<resfilter::ByTransact>(pool),
- make_filter_end<resfilter::ByTransact>(pool) ) << endl;
+ PoolQuery q;
+ q.setMatchSubstring();
+ q.setCaseSensitive( false );
+ q.addAttribute( sat::SolvAttr::updateReference );
- pool::GetResolvablesToInsDel collect( pool, pool::GetResolvablesToInsDel::ORDER_BY_MEDIANR );
- MIL << "GetResolvablesToInsDel:" << endl << collect << endl;
+ 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;
+ }
+ }
+ }
+ }
+ }
///////////////////////////////////////////////////////////////////
INT << "===[END]============================================" << endl << endl;