Mailinglist Archive: zypp-commit (233 mails)

< Previous Next >
[zypp-commit] <libzypp> master : added kind query
  • From: Michael Andres <ma@xxxxxxx>
  • Date: Thu, 12 Nov 2009 10:14:41 +0100
  • Message-id: <E1N8WRI-0006QS-6H@xxxxxxxxxxxxxxxx>
ref: refs/heads/master
commit ba569399f280de21ebcfa7e92be64cf3207cf48e
Author: Michael Andres <ma@xxxxxxx>
Date: Thu Nov 12 10:14:41 2009 +0100

added kind query
---
tools/NameReqPrv.cc | 20 ++++++++++++++++++--
1 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/tools/NameReqPrv.cc b/tools/NameReqPrv.cc
index 65e7bfd..bb4eabd 100644
--- a/tools/NameReqPrv.cc
+++ b/tools/NameReqPrv.cc
@@ -78,7 +78,7 @@ int main( int argc, char * argv[] )
Pathname sysRoot("/");
sat::Pool satpool( sat::Pool::instance() );

- if ( (*argv) == std::string("--root") )
+ if ( argc && (*argv) == std::string("--root") )
{
--argc,++argv;
if ( ! argc )
@@ -92,7 +92,7 @@ int main( int argc, char * argv[] )
}

bool onlyInstalled( false );
- if ( (*argv) == std::string("--installed") )
+ if ( argc && (*argv) == std::string("--installed") )
{
--argc,++argv;
onlyInstalled = true;
@@ -184,6 +184,21 @@ int main( int argc, char * argv[] )

PoolQuery q;
std::string qstr( *argv );
+
+ if ( *argv == ResKind::product )
+ {
+ q.addKind( ResKind::product );
+ }
+ else if ( *argv == ResKind::patch )
+ {
+ q.addKind( ResKind::patch );
+ }
+ else if ( *argv == ResKind::pattern )
+ {
+ q.addKind( ResKind::pattern );
+ }
+ else
+ {
q.addString( qstr );
q.setMatchRegex();
q.setCaseSensitive( ! ignorecase );
@@ -194,6 +209,7 @@ int main( int argc, char * argv[] )
q.addDependency( sat::SolvAttr::provides );
if ( requires )
q.addDependency( sat::SolvAttr::requires );
+ }

message << *argv << " [" << (ignorecase?'i':'_') << (names?'n':'_') <<
(requires?'r':'_') << (provides?'p':'_') << "] {" << endl;

--
To unsubscribe, e-mail: zypp-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages