From bd3963db8e154949ce361452ca340e2796c056b5 Mon Sep 17 00:00:00 2001 From: Michael Andres Date: Fri, 21 Jun 2013 20:18:13 +0200 Subject: [PATCH] backup --- tools/NameReqPrv.cc | 61 ++++++++++++++++++++++++++++++++--------------------- 1 file changed, 37 insertions(+), 24 deletions(-) diff --git a/tools/NameReqPrv.cc b/tools/NameReqPrv.cc index 11c41bf..9c0ea09 100644 --- a/tools/NameReqPrv.cc +++ b/tools/NameReqPrv.cc @@ -4,6 +4,7 @@ #include #include +#include static std::string appname( "NameReqPrv" ); @@ -78,6 +79,10 @@ void dDump( const std::string & spec_r ) for ( const auto & el : q ) { message << endl << "==============================" << endl << dump(el); + if ( isKind(el) ) + { + message << endl << "CONTENT: " << make(el)->contents(); + } } message << endl << "}" << endl; } @@ -250,39 +255,47 @@ int main( int argc, char * argv[] ) } else { - q.addString( qstr ); - q.setMatchRegex(); - q.setCaseSensitive( ! ignorecase ); - - if ( names ) - q.addAttribute( sat::SolvAttr::name ); - if ( provides ) - q.addDependency( sat::SolvAttr::provides ); - if ( requires ) - q.addDependency( sat::SolvAttr::requires ); - if ( conflicts ) - q.addDependency( sat::SolvAttr::conflicts ); - if ( obsoletes ) - q.addDependency( sat::SolvAttr::obsoletes ); - if ( recommends ) - q.addDependency( sat::SolvAttr::recommends ); - if ( supplements ) - q.addDependency( sat::SolvAttr::supplements ); + sat::Solvable::SplitIdent ident( qstr ); + if ( ident.kind() != ResKind::package ) + { + q.addKind( ident.kind() ); + q.addString( ident.name().asString() ); + } + else + q.addString( qstr ); + + q.setMatchRegex(); + q.setCaseSensitive( ! ignorecase ); + + if ( names ) + q.addAttribute( sat::SolvAttr::name ); + if ( provides ) + q.addDependency( sat::SolvAttr::provides ); + if ( requires ) + q.addDependency( sat::SolvAttr::requires ); + if ( conflicts ) + q.addDependency( sat::SolvAttr::conflicts ); + if ( obsoletes ) + q.addDependency( sat::SolvAttr::obsoletes ); + if ( recommends ) + q.addDependency( sat::SolvAttr::recommends ); + if ( supplements ) + q.addDependency( sat::SolvAttr::supplements ); } message << *argv << " [" << (ignorecase?'i':'_') << (names?'n':'_') << (requires?'r':'_') << (provides?'p':'_') - << (conflicts?'c':'_') << (obsoletes?'o':'_') << (recommends?'m':'_') << (supplements?'s':'_') << "] {" << endl; + << (conflicts?'c':'_') << (obsoletes?'o':'_') << (recommends?'m':'_') << (supplements?'s':'_') << "] {" << endl; for_( it, q.begin(), q.end() ) { tableOut( str::numstring( it->id() ), it->asString(), it->repository().name(), it->vendor().asString(), - str::numstring( PoolItem(*it)->buildtime() ) ); + str::numstring( PoolItem(*it)->buildtime() ) ); if ( ! it.matchesEmpty() ) { - for_( match, it.matchesBegin(), it.matchesEnd() ) - { - tableOut( "", "", "", match->inSolvAttr().asString().substr( 9, 3 )+": " +match->asString() ); - } + for_( match, it.matchesBegin(), it.matchesEnd() ) + { + tableOut( "", "", "", match->inSolvAttr().asString().substr( 9, 3 )+": " +match->asString() ); + } } } -- 2.7.4