Author: jreidinger
Date: Thu Apr 17 15:56:43 2008
New Revision: 9681
URL: http://svn.opensuse.org/viewcvs/zypp?rev=9681&view=rev
Log:
fix multiple remove same repository
Modified:
trunk/zypper/src/zypper-utils.h
trunk/zypper/src/zypper.cc
Modified: trunk/zypper/src/zypper-utils.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper-utils.h?rev=9681&r1=9680&r2=9681&view=diff
==============================================================================
--- trunk/zypper/src/zypper-utils.h (original)
+++ trunk/zypper/src/zypper-utils.h Thu Apr 17 15:56:43 2008
@@ -7,6 +7,7 @@
#include "zypp/Url.h"
#include "zypp/Resolvable.h"
#include "zypp/Pathname.h"
+#include "zypp/RepoInfo.h"
#include "output/Out.h"
@@ -68,4 +69,11 @@
std::string & indent(std::string & text, int columns);
+//comparator for RepoInfo set
+class RepoInfoAliasComparator{
+ public: bool operator()(const zypp::RepoInfo &a, const zypp::RepoInfo& b){
+ return a.alias()http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper.cc?rev=9681&r1=9680&r2=9681&view=diff
==============================================================================
--- trunk/zypper/src/zypper.cc (original)
+++ trunk/zypper/src/zypper.cc Thu Apr 17 15:56:43 2008
@@ -56,7 +56,6 @@
RuntimeData gData;
parsed_opts copts; // command options
-
Zypper::Zypper()
: _argc(0), _argv(NULL), _out_ptr(NULL),
_command(ZypperCommand::NONE),
@@ -1823,13 +1822,13 @@
warn_if_zmd ();
//must store repository before remove to ensure correct match number
- list<RepoInfo> repo_to_remove;
+ set repo_to_remove;
for (vector<string>::const_iterator it = _arguments.begin();
it!= _arguments.end();++it){
RepoInfo repo;
if (match_repo(*this,*it,&repo))
{
- repo_to_remove.push_back(repo);
+ repo_to_remove.insert(repo);
}
else
{
@@ -1842,8 +1841,7 @@
}
}
- for (std::list<RepoInfo>::const_iterator it = repo_to_remove.begin();
- it!=repo_to_remove.end();++it)
+ for_ (it,repo_to_remove.begin(),repo_to_remove.end())
remove_repo(*this,*it);
break;
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org