#
SET(LIBZYPP_MAJOR "16")
SET(LIBZYPP_COMPATMINOR "0")
-SET(LIBZYPP_MINOR "8")
+SET(LIBZYPP_MINOR "9")
SET(LIBZYPP_PATCH "0")
#
-# LAST RELEASED: 16.8.0 (0)
+# LAST RELEASED: 16.9.0 (0)
# (The number in parenthesis is LIBZYPP_COMPATMINOR)
#=======
-------------------------------------------------------------------
+Thu Apr 27 16:03:32 CEST 2017 - ma@suse.de
+
+- PoolQuery: Treat explicit queries for 'kind:name' correctly
+ (bsc#1035729)
+- version 16.9.0 (0)
+
+-------------------------------------------------------------------
Fri Apr 21 16:23:51 CEST 2017 - ma@suse.de
- Add API to control resolver job to update all packages (FATE#320653)
"Project-Id-Version: zypp.hu\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-11-21 15:07+0100\n"
-"PO-Revision-Date: 2017-04-20 15:38+0000\n"
-"Last-Translator: Robert Taisz <robert.taisz@emerald.hu>\n"
+"PO-Revision-Date: 2017-04-21 14:59+0000\n"
+"Last-Translator: Janos Stampf <jstampf@consell.hu>\n"
"Language-Team: Hungarian "
"<https://l10n.opensuse.org/projects/libzypp/master/hu/>\n"
"Language: hu\n"
#: zypp/thread/Mutex.cc:47
msgid "Can't initialize recursive mutex"
-msgstr "A rekurzív mutex attribútum nem inicializálható"
+msgstr "A rekurzív mutex attribútum inicializációja sikertelen"
#: zypp/thread/Mutex.cc:77
msgid "Can't acquire the mutex lock"
#: zypp/target/TargetImpl.cc:449
#, c-format, boost-format
msgid "%s already executed as %s)"
-msgstr "%s már futtatva volt: %s)"
+msgstr "%s már futtatva volt mint %s)"
#: zypp/target/TargetImpl.cc:459
msgid " execution skipped while aborting"
* match, it's also suitable for sub-structure (flexarray) inspection
* (\see \ref sat::LookupAttr::iterator::solvAttrSubEntry).
*
+ * (bsc#1035729) If SolvAttr::name searches for an explicit \c kind:name,
+ * this \c kind is stored in \ref kindPredicate and will overwrite any
+ * 'global' kind restriction applied via \ref PoolQuery::addKind. This
+ * task can't be passed off to a predicate, as \ref PoolQueryMatcher::isAMatch
+ * must accept only explicit-kind-checking predicate matches, in case the
+ * 'global' kind restriction woudl otherwise discard the match.
+ *
* \note: \see \ref addPredicate for further constraints.
*/
struct AttrMatchData
AttrMatchData()
{}
+ AttrMatchData( sat::SolvAttr attr_r )
+ : attr( attr_r )
+ {}
+
AttrMatchData( sat::SolvAttr attr_r, const StrMatcher & strMatcher_r )
: attr( attr_r )
, strMatcher( strMatcher_r )
}
sat::SolvAttr attr;
- StrMatcher strMatcher;
+ StrMatcher strMatcher;
Predicate predicate;
std::string predicateStr;
+ ResKind kindPredicate = ResKind::nokind; // holds the 'kind' part if SolvAttr:name looks for an explicit 'kind:name'
};
/** \relates AttrMatchData */
inline std::ostream & operator<<( std::ostream & str, const AttrMatchData & obj )
{
str << obj.attr << ": " << obj.strMatcher;
+ if ( obj.kindPredicate )
+ str << " +(" << obj.kindPredicate << ")";
if ( obj.predicate )
str << " +(" << obj.predicateStr << ")";
return str;
if ( joined.size() > 1 ) // switch to regex for multiple strings
cflags.setModeRegex();
- _attrMatchList.push_back( AttrMatchData( it->attr,
- StrMatcher( rcstrings, cflags ),
- it->predicate, it->predicateStr ) );
+ // copy and exchange the StrMatcher
+ AttrMatchData nattr( *it );
+ nattr.strMatcher = StrMatcher( rcstrings, cflags ),
+ _attrMatchList.push_back( std::move(nattr) );
}
else
{
void PoolQuery::addDependency( const sat::SolvAttr & attr, const std::string & name, const Rel & op, const Edition & edition, const Arch & arch )
{
+ // SolvAttr::name with explicit 'kind:name' will overwrite the default _kinds
+ ResKind explicitKind;
+ if ( attr == sat::SolvAttr::name ) explicitKind = ResKind::explicitBuiltin( name );
+
switch ( op.inSwitch() )
{
case Rel::ANY_e: // no additional constraint on edition.
- if ( arch.empty() ) // no additional constraint on arch.
+ if ( arch.empty() && !explicitKind ) // no additional constraint on arch/kind
{
addAttribute( attr, name );
return;
// Match::OTHER indicates need to compile
// (merge global search strings into name).
- AttrMatchData attrMatchData( attr, StrMatcher( name, Match::OTHER ) );
+ AttrMatchData attrMatchData( attr );
+ if ( !explicitKind )
+ attrMatchData.strMatcher = StrMatcher( name, Match::OTHER );
+ else
+ {
+ // ResKind::explicitBuiltin call above asserts the presence of the ':' in name
+ attrMatchData.strMatcher = StrMatcher( strchr( name.c_str(), ':')+1, Match::OTHER );
+ attrMatchData.kindPredicate = explicitKind;
+ }
if ( isDependencyAttribute( attr ) )
attrMatchData.addPredicate( EditionRangePredicate( op, edition, arch ) );
}
/////////////////////////////////////////////////////////////////////
sat::Solvable inSolvable( base_r.inSolvable() );
- // Kind restriction:
- if ( ! _kinds.empty() && ! inSolvable.isKind( _kinds.begin(), _kinds.end() ) )
- {
- base_r.nextSkipSolvable();
- return false;
- }
-
// Edition restriction:
if ( _op != Rel::ANY && !compareByRel( _op, inSolvable.edition(), _edition, Edition::Match() ) )
{
base_r.nextSkipSolvable();
return false;
}
+
+ // Kind restriction:
+ // Delay the decision to nextSkipSolvable and return false, as there may be
+ // some explicit kind:name predicate which overrules the global kinds.
+ bool globalKindOk =( _kinds.empty() || inSolvable.isKind( _kinds.begin(), _kinds.end() ) );
+
/////////////////////////////////////////////////////////////////////
// string and predicate matching:
{
// String matching was done by the base iterator.
// Now check any predicate:
- const AttrMatchData::Predicate & predicate( _attrMatchList.front().predicate );
- if ( ! predicate || predicate( base_r ) )
+ const AttrMatchData & matchData( _attrMatchList.front() );
+
+ if ( matchData.kindPredicate )
+ {
+ if ( matchData.kindPredicate != inSolvable.kind() )
+ {
+ base_r.nextSkipSolvable(); // this matchData will never match in this solvable
+ return false;
+ }
+ }
+ else if ( !globalKindOk )
+ return false; // only matching kindPredicate could overwrite this
+
+ if ( !matchData.predicate || matchData.predicate( base_r ) )
return true;
- return false; // no skip as there may be more occurrences od this attr.
+ return false; // no skip as there may be more occurrences in this solvable of this attr.
}
// Here: search all attributes ;(
for_( mi, _attrMatchList.begin(), _attrMatchList.end() )
{
const AttrMatchData & matchData( *mi );
+
+ if ( matchData.kindPredicate )
+ {
+ if ( matchData.kindPredicate != inSolvable.kind() )
+ continue; // this matchData does not apply
+ }
+ else if ( !globalKindOk )
+ continue; // only matching kindPredicate could overwrite this
+
sat::LookupAttr q( matchData.attr, inSolvable );
if ( matchData.strMatcher ) // an empty searchstring matches always
q.setStrMatcher( matchData.strMatcher );
Impl()
{}
- Impl( const std::string & search_r, const Match & flags_r )
- : _search( search_r )
+ Impl( std::string search_r, const Match & flags_r )
+ : _search( std::move(search_r) )
, _flags( flags_r )
{}
{ return _search; }
/** Set a new searchstring. */
- void setSearchstring( const std::string & string_r )
- { invalidate(); _search = string_r; }
+ void setSearchstring( std::string string_r )
+ { invalidate(); _search = std::move(string_r); }
/** The current search flags. */
const Match & flags() const
StrMatcher::StrMatcher( const std::string & search_r )
: _pimpl( new Impl( search_r, Match::STRING ) )
{}
+ StrMatcher::StrMatcher( std::string && search_r )
+ : _pimpl( new Impl( std::move(search_r), Match::STRING ) )
+ {}
StrMatcher::StrMatcher( const std::string & search_r, const Match & flags_r )
: _pimpl( new Impl( search_r, flags_r ) )
{}
+ StrMatcher::StrMatcher( std::string && search_r, const Match & flags_r )
+ : _pimpl( new Impl( std::move(search_r), flags_r ) )
+ {}
StrMatcher::StrMatcher( const std::string & search_r, const Match::Mode & flags_r )
: _pimpl( new Impl( search_r, flags_r ) )
{}
+ StrMatcher::StrMatcher( std::string && search_r, const Match::Mode & flags_r )
+ : _pimpl( new Impl( std::move(search_r), flags_r ) )
+ {}
StrMatcher::StrMatcher( const std::string & search_r, int flags_r )
: _pimpl( new Impl( search_r, Match(flags_r) ) )
{}
+ StrMatcher::StrMatcher( std::string && search_r, int flags_r )
+ : _pimpl( new Impl( std::move(search_r), Match(flags_r) ) )
+ {}
void StrMatcher::compile() const
{ return _pimpl->compile(); }
void StrMatcher::setSearchstring( const std::string & string_r )
{ _pimpl->setSearchstring( string_r ); }
+ void StrMatcher::setSearchstring( std::string && string_r )
+ { _pimpl->setSearchstring( std::move(string_r) ); }
void StrMatcher::setSearchstring( const std::string & string_r, const Match & flags_r )
{
_pimpl->setSearchstring( string_r );
_pimpl->setFlags( flags_r );
}
+ void StrMatcher::setSearchstring( std::string && string_r, const Match & flags_r )
+ {
+ _pimpl->setSearchstring( std::move(string_r) );
+ _pimpl->setFlags( flags_r );
+ }
const Match & StrMatcher::flags() const
{ return _pimpl->flags(); }
/** Ctor from string matches in \ref Match::STRING mode per default. */
StrMatcher( const std::string & search_r );
+ /** \overload for rvalues */
+ StrMatcher( std::string && search_r );
/** Ctor taking string and \ref Match flags. */
StrMatcher( const std::string & search_r, const Match & flags_r );
+ /** \overload for rvalues */
+ StrMatcher( std::string && search_r, const Match & flags_r );
/** Ctor taking string and \ref Match::Mode.
* Needed because we want them to be treated as \ref Match,
* and not as \ref int as the compiler woud do.
*/
StrMatcher( const std::string & search_r, const Match::Mode & flags_r );
+ /** \overload for rvalues */
+ StrMatcher( std::string && search_r, const Match::Mode & flags_r );
/** Low level interface wraps \a flags into \ref Match. */
StrMatcher( const std::string & search_r, int flags_r );
+ /** \overload for rvalues */
+ StrMatcher( std::string && search_r, int flags_r );
/** Evaluate in a boolean context <tt>( ! searchstring().empty() )</tt>. */
explicit operator bool() const
/** Set a new searchstring. */
void setSearchstring( const std::string & string_r );
+ /** \overload for rvalues */
+ void setSearchstring( std::string && string_r );
/** Set a new searchstring and flags. */
void setSearchstring( const std::string & string_r, const Match & flags_r );
+ /** \overload for rvalues */
+ void setSearchstring( std::string && string_r, const Match & flags_r );
/** The current search flags. */
const Match & flags() const;