Mailinglist Archive: zypp-commit (233 mails)

< Previous Next >
[zypp-commit] <zypper> master : al/rl: Support 'kind:name' notation if -t is not given (bnc 551956)
  • From: Michael Andres <ma@xxxxxxx>
  • Date: Fri, 6 Nov 2009 14:52:13 +0100
  • Message-id: <E1N6PrW-0008Q0-2A@xxxxxxxxxxxxxxxx>
ref: refs/heads/master
commit 6383c882eed96039bc084707e13b9d2de89bf1ec
Author: Michael Andres <ma@xxxxxxx>
Date: Fri Nov 6 14:52:13 2009 +0100

al/rl: Support 'kind:name' notation if -t is not given (bnc 551956)

It's convenient, and as -t not supported by rl, it's the only way
to tell to remove a specific non-package lock.
---
src/Zypper.cc | 4 ++--
src/locks.cc | 21 +++++++++++++++++----
zypper.spec.cmake | 2 +-
3 files changed, 20 insertions(+), 7 deletions(-)

diff --git a/src/Zypper.cc b/src/Zypper.cc
index bf8c9ce..51b8ec5 100644
--- a/src/Zypper.cc
+++ b/src/Zypper.cc
@@ -3932,8 +3932,8 @@ void Zypper::doCommand()
kinds.insert(kind);
}
}
- else
- kinds.insert(ResKind::package);
+ //else
+ // let add_locks determine the appropriate type (bnc #551956)

add_locks(*this, _arguments, kinds);

diff --git a/src/locks.cc b/src/locks.cc
index b08540c..428b5b4 100644
--- a/src/locks.cc
+++ b/src/locks.cc
@@ -124,9 +124,19 @@ void add_locks(Zypper & zypper, const Zypper::ArgList &
args, const ResKindSet &
for_(it,args.begin(),args.end())
{
PoolQuery q;
- q.addAttribute(sat::SolvAttr::name, *it);
- for_(itk, kinds.begin(), kinds.end())
- q.addKind(*itk);
+ if ( kinds.empty() ) // derive it from the name
+ {
+ sat::Solvable::SplitIdent split( *it );
+ q.addAttribute( sat::SolvAttr::name, split.name().asString() );
+ q.addKind( split.kind() );
+ }
+ else
+ {
+ q.addAttribute(sat::SolvAttr::name, *it);
+ for_(itk, kinds.begin(), kinds.end()) {
+ q.addKind(*itk);
+ }
+ }
q.setMatchGlob();
parsed_opts::const_iterator itr;
//TODO rug compatibility for more arguments with version restrict
@@ -185,7 +195,10 @@ void remove_locks(Zypper & zypper, const Zypper::ArgList &
args)
//TODO fill query in one method to have consistent add/remove
//TODO what to do with repo and kinds?
PoolQuery q;
- q.addAttribute(sat::SolvAttr::name, *args_it);
+ // derive kind from the name: (rl should also support -t)
+ sat::Solvable::SplitIdent split( *args_it );
+ q.addAttribute( sat::SolvAttr::name, split.name().asString() );
+ q.addKind( split.kind() );
q.setMatchGlob();
parsed_opts::const_iterator itr;
if ((itr = copts.find("repo")) != copts.end())
diff --git a/zypper.spec.cmake b/zypper.spec.cmake
index 600be44..908bcb4 100644
--- a/zypper.spec.cmake
+++ b/zypper.spec.cmake
@@ -11,7 +11,7 @@
# norootforbuild

Name: @PACKAGE@
-BuildRequires: libzypp-devel >= 6.21.0 boost-devel >= 1.33.1 gettext-devel >=
0.15
+BuildRequires: libzypp-devel >= 6.21.4 boost-devel >= 1.33.1 gettext-devel >=
0.15
BuildRequires: readline-devel >= 5.1 augeas-devel >= 0.5.0
BuildRequires: gcc-c++ >= 4.1 cmake >= 2.4.6
Requires: procps
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages