#undef OUTS
}
-void wsoft()
-{
- ResPool pool( ResPool::instance() );
- for_( it, pool.begin(), pool.end() )
- {
- if ( it->status().isSoftLocked() )
- INT << "SL: " << *it << endl;
- }
-}
-
/******************************************************************
**
** FUNCTION NAME : main
///////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////
- if ( 1 )
- {
- PoolItem pi ( getPi<Pattern>("apparmor") );
- MIL << pi << endl;
- if ( pi )
- {
- Pattern::constPtr p( pi->asKind<Pattern>() );
- MIL << p << endl;
- if ( p )
- {
- p->contents();
- }
- }
- }
+ sat::SolvAttr mattr( "repository:timestamp" );
- if ( 0 )
+ sat::LookupAttr query( mattr );
+ MIL << "---" << mattr << "---" << query.size() << endl;
+ for_( it, query.begin(), query.end() )
{
- CapabilitySet caps;
- caps.insert( Capability("pattern:multimedia") );
- caps.insert( Capability("pattern:gnome_basis") );
- caps.insert( Capability("pattern:imaging") );
- caps.insert( Capability("pattern:office") );
- caps.insert( Capability("pattern:non_oss") );
- caps.insert( Capability("pattern:non_oss_java") );
- caps.insert( Capability("pattern:gnome_admin") );
- caps.insert( Capability("pattern:gnome_internet") );
- caps.insert( Capability("xsane") );
- caps.insert( Capability("pattern:gnome_utilities") );
- caps.insert( Capability("pattern:games") );
- caps.insert( Capability("pattern:xgl") );
- INT << caps << endl;
-
- sat::WhatProvides prv1( Capability("pattern:multimedia") );
- DBG << (prv1.begin()==prv1.begin()) << endl;
-
- sat::WhatProvides prv( caps );
- DBG << (prv.begin()==prv.begin()) << endl;
-// MIL << prv.empty() << endl;
-// MIL << prv.size() << endl;
-// for_( it, prv.begin(), prv.end() )
-// {
-// INT << *it << endl;
-// }
-// MIL << ( prv.begin() == prv.end() ) << endl;
-// // MIL << ( prv.begin() == prv.begin() ) << endl;
-// MIL << ( prv.end() == prv.end() ) << endl;
-
- sat::WhatProvides::const_iterator i1( prv.begin() );
- sat::WhatProvides::const_iterator i2( prv.begin() );
- sat::WhatProvides::const_iterator i3( i2 );
- DBG << (i1==i1) << endl;
- DBG << (i1==i2) << endl;
- DBG << (i1==i3) << endl;
- DBG << (i2==i2) << endl;
- DBG << (i1==i3) << endl;
- DBG << (i3==i3) << endl;
-
- dumpRange( SEC, make_filter_begin( filter::byKind<Package>(), prv ),
- make_filter_end( filter::byKind<Package>(), prv ) ) << endl;
-
+ MIL << *it << endl;
}
- if ( 1 )
- {
- PoolItem pi ( getPi<Pattern>("gnome") );
- MIL << pi << endl;
- Pattern::constPtr p( pi->asKind<Pattern>() );
- if ( p )
- {
- p->depends();
- MIL << p->depends() << endl;
- }
- }
//////////////////////////////////////////////////////////////////
INT << "===[END]============================================" << endl << endl;
-------------------------------------------------------------------
+Thu Oct 9 17:37:18 CEST 2008 - ma@suse.de
+
+- Adapt to satsolvers 'big solv data change'.
+- revision 11294
+
+-------------------------------------------------------------------
Thu Oct 9 17:18:18 CEST 2008 - schubi@suse.de
- Taking the right solution actions for locked resolvables (bnc #400840)
namespace zypp
{ /////////////////////////////////////////////////////////////////
+#warning CHECK FOR MEMLEAK DUE TO MISSING dataiterator_free
+
///////////////////////////////////////////////////////////////////
//
// CLASS NAME : PoolQuery::Impl
invokeOnEach(ai->second.begin(), ai->second.end(), EmptyFilter(), MyInserter(joined));
string s = createRegex(joined);
_rcattrs.insert(pair<sat::SolvAttr, string>(ai->first, s));
-
+
// switch to regex for multiple strings
if (joined.size() > 1)
_cflags = (_cflags & ~SEARCH_STRINGMASK) | SEARCH_REGEX;
_cflags);
}
- if ((_cflags & SEARCH_STRINGMASK) == SEARCH_REGEX && _rdit->regex_err != 0)
+ if ((_cflags & SEARCH_STRINGMASK) == SEARCH_REGEX && _rdit->matcher.error != 0)
ZYPP_THROW(Exception(str::form(
_("Invalid regular expression '%s': regcomp returned %d"),
- _rcstrings.c_str(), _rdit->regex_err)));
+ _rcstrings.c_str(), _rdit->matcher.error)));
PoolQuery::const_iterator it(_rdit, this);
it.increment();
bool PoolQueryIterator::matchSolvable()
{
- _sid = base().get()->solvid;
+ _sid = base().get()->entry;
bool new_solvable = true;
bool matches = !_do_matching;
}
else
regex_p = _regex.get();
-
+#warning wrap matcher an use it
matches = ::dataiterator_match(base().get(), _flags, regex_p);
}
else
// trying to reach a matching attribute or the next solvable
// thus resulting to a problem in the equal() method
++base_reference();
- new_solvable = base().get()->solvid != _sid;
+ new_solvable = base().get()->entry != _sid;
}
// no more attributes in this repo, return
else
void PoolQuery::setEdition(const Edition & edition, const Rel & op)
- {
+ {
_pimpl->_edition = edition;
_pimpl->_op = op;
}
{ return _pimpl->_flags & SEARCH_STRINGMASK; }
bool PoolQuery::matchFiles() const
{ return (_pimpl->_flags & SEARCH_STRINGMASK) == SEARCH_FILES; }
-
+
bool PoolQuery::matchWord() const
{ return _pimpl->_match_word; }
for_( it, kinds().begin(), kinds().end() )
{
- str << PoolQueryAttr::kindAttr.asString() << ": "
+ str << PoolQueryAttr::kindAttr.asString() << ": "
<< it->idStr() << delim ;
}
str << PoolQueryAttr::stringTypeAttr.asString() << ": exact" << delim;
break;
case SEARCH_SUBSTRING:
- str << PoolQueryAttr::stringTypeAttr.asString()
+ str << PoolQueryAttr::stringTypeAttr.asString()
<< ": substring" << delim;
break;
case SEARCH_GLOB:
return _repo->name;
}
+#warning FIX to iterator
zypp::Date Repository::generatedTimestamp() const
{
::Dataiterator di;
- ::dataiterator_init(&di, get(), 0, 0, 0, SEARCH_EXTRA | SEARCH_NO_STORAGE_SOLVABLE);
+ ::dataiterator_init(&di, get(), REPOENTRY_META, REPOSITORY_TIMESTAMP, 0, 0);
if (::dataiterator_step(&di))
{
do
while (::dataiterator_step(&di));
}
else
- {
+ {
if ( isSystemRepo() )
return 0;
ERR << "the attribute generated timestamp does not exist in the repo" << endl;
}
-
- return Date();
+
+ return Date();
}
-
+
zypp::Date Repository::suggestedExpirationTimestamp() const
{
::Dataiterator di;
- ::dataiterator_init(&di, get(), 0, 0, 0, SEARCH_EXTRA | SEARCH_NO_STORAGE_SOLVABLE);
+ ::dataiterator_init(&di, get(), REPOENTRY_META, REPOSITORY_EXPIRE, 0, 0);
Date generated = generatedTimestamp();
// do not calculate over a missing generated
// timestamp
if ( generated == Date() )
return Date();
-
+
if (::dataiterator_step(&di))
{
do
while (::dataiterator_step(&di));
}
else
- {
+ {
if ( isSystemRepo() )
return 0;
ERR << "the attribute suggested expiration timestamp does not exist in the repo" << endl;
}
-
+
return Date();
}
Repository::Keywords Repository::keywords() const
{ return Keywords(sat::SolvAttr::repositoryKeywords); }
-
+
Repository::Products Repository::products() const
{ return Products(sat::SolvAttr::repositoryProducts); }
// system repo is not mirrored
if ( isSystemRepo() )
return false;
-
+
Date suggested = suggestedExpirationTimestamp();
-
+
// if no data, don't suggest
- if ( suggested == Date() )
+ if ( suggested == Date() )
return false;
return suggestedExpirationTimestamp() < Date::now();
}
-
+
bool Repository::providesUpdatesFor( const std::string &key ) const
{
return false;
}
-
+
bool Repository::isUpdateRepo() const
{
return false;
return str << "DeltaCandidates::Impl";
}
+ ///////////////////////////////////////////////////////////////////
+ //
+ // class DeltaCandidates
+ //
+ ///////////////////////////////////////////////////////////////////
+
DeltaCandidates::DeltaCandidates(const std::list<Repository> & repos,
const std::string & pkgname)
: _pimpl( new Impl(repos, pkgname) )
it != _pimpl->repos.end(); ++it )
{
DBG << "package: " << package << endl;
- for (int i = 0; i < it->get()->nextra; ++i)
{
::Dataiterator di;
::dataiterator_init(&di
, it->get() // in this repo
- , -1 - i // in this extra
- , DELTA_PACKAGE_NAME // with this attribute
- , _pimpl->pkgname.empty() ? 0 : _pimpl->pkgname.c_str() // of this value
- , SEARCH_EXTRA | SEARCH_NO_STORAGE_SOLVABLE | SEARCH_STRING);
+ , REPOENTRY_META // in metadata
+ , REPOSITORY_DELTAINFO, 0, 0 );
+
while (::dataiterator_step(&di))
{
- DeltaRpm delta(*it, di.solvid);
- DBG << "checking delta: " << delta << endl;
- if ( ! package
- || ( package->name() == delta.name()
- && package->edition() == delta.edition()
- && package->arch() == delta.arch() ) )
- {
- DBG << "got delta candidate" << endl;
- candidates.push_back( delta );
- }
+ ::dataiterator_setpos( &di );
+ ::Dataiterator di2;
+ ::dataiterator_init(&di2
+ , it->get() // in this repo
+ , REPOENTRY_POS // in metadata
+ , DELTA_PACKAGE_NAME
+ , _pimpl->pkgname.empty() ? 0 : _pimpl->pkgname.c_str() // of this value
+ , SEARCH_STRING);
+ while (::dataiterator_step(&di2))
+ {
+ ::dataiterator_setpos( &di2 );
+ DeltaRpm delta(*it, REPOENTRY_POS);
+ DBG << "checking delta: " << delta << endl;
+ if ( ! package
+ || ( package->name() == delta.name()
+ && package->edition() == delta.edition()
+ && package->arch() == delta.arch() ) )
+ {
+ DBG << "got delta candidate" << endl;
+ candidates.push_back( delta );
+ }
+ }
}
}
}
{
MIL << "creating deltarpm from repo " << repo.alias() << ", id " << extraid << endl;
::Dataiterator di;
- ::dataiterator_init(&di, repo.get(), extraid, 0, 0, SEARCH_EXTRA | SEARCH_NO_STORAGE_SOLVABLE);
+ ::dataiterator_init(&di, repo.get(), extraid, 0, 0, 0);
string locdir;
string locname;
}
case DELTA_DOWNLOADSIZE:
{
- loc.setDownloadSize(di.kv.num);
+ loc.setDownloadSize(ByteCount(di.kv.num, ByteCount::K));
break;
}
case DELTA_CHECKSUM:
ERR << "the extra does not exist in the repo" << endl;
//! \todo FIXME here + in sat tools
- loc.setLocation(locdir + "/" + locname + "-" + locevr + "." + locsuffix);
+ loc.setLocation(locdir + "/" + locname + "-" + locevr + "." + locsuffix);
setLocation(loc);
base.setSequenceinfo(seqname + "-" + seqevr + "-" + seqnum);
setBaseversion(base);
if ( _attr == SolvAttr::noAttr )
return iterator();
+#warning Need to call dataiterator_free
scoped_ptr< ::_Dataiterator> dip( new ::Dataiterator );
// needed while LookupAttr::iterator::dip_equal does ::memcmp:
::memset( dip.get(), 0, sizeof(::_Dataiterator) );
{ return _dip ? Repository( _dip->repo ) : Repository::noRepository; }
Solvable LookupAttr::iterator::inSolvable() const
- { return _dip ? Solvable( _dip->solvid ) : Solvable::noSolvable; }
+ { return _dip ? Solvable( _dip->entry ) : Solvable::noSolvable; }
SolvAttr LookupAttr::iterator::inSolvAttr() const
{ return _dip ? SolvAttr( _dip->key->name ) : SolvAttr::noAttr; }