Author: jkupec
Date: Mon Jul 28 15:22:19 2008
New Revision: 10675
URL: http://svn.opensuse.org/viewcvs/zypp?rev=10675&view=rev
Log:
- make install by name case-insensitive (bnc #412496)
Modified:
trunk/zypper/src/install.cc
trunk/zypper/src/install.h
Modified: trunk/zypper/src/install.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/install.cc?rev=10675&r1=10674&r2=10675&view=diff
==============================================================================
--- trunk/zypper/src/install.cc (original)
+++ trunk/zypper/src/install.cc Mon Jul 28 15:22:19 2008
@@ -15,84 +15,25 @@
extern ZYpp::Ptr God;
-// copied from yast2-pkg-bindings:PkgModuleFunctions::DoProvideNameKind
-bool ProvideProcess::operator()( const PoolItem& provider )
-{
- DBG << "Considering " << provider << endl;
- // 1. compatible arch
- // 2. best arch
- // 3. best edition
-
- // check the repository alias if it's specified
- if (!_repo.empty() && _repo != provider->repository().info().alias())
- {
- DBG << format ("Skipping repository %s (requested: %s)")
- % provider->repository().info().alias() % _repo << endl;
- return true;
- }
-
- bool is_installed;
- if (provider->isKind(ResKind::package))
- is_installed = provider.status().isInstalled();
- else
- is_installed = provider.isSatisfied();
-
- if (!is_installed)
- {
- // deselect the item if it's already selected,
- // only one item should be selected
- if (provider.status().isToBeInstalled()) {
- DBG << " Deselecting" << endl;
- provider.status().resetTransact(whoWantsIt);
- }
-
- // regarding items which are installable only
- if (!provider->arch().compatibleWith( _architecture )) {
- DBG << format ("provider %s has incompatible arch '%s'")
- % provider->name() % provider->arch().asString() << endl;
- }
- else if (!item) {
- DBG << " First match" << endl;
- item = provider;
- }
- else if (item->arch().compare( provider->arch() ) < 0) {
- DBG << " Better arch" << endl;
- item = provider;
- }
- else if (item->edition().compare( provider->edition() ) < 0) {
- DBG << " Better edition" << endl;
- item = provider;
- }
- }
- else {
- // store encountered target item (installed)
- installed_item = provider;
- if (!item) item = provider;
- }
-
- return true;
-}
-
-// ----------------------------------------------------------------------------
-
-// this does only resolvables with this _name_.
-// we could also act on _provides_
-// TODO edition, arch
+// TODO edition, arch ?
static void mark_for_install(Zypper & zypper,
const ResObject::Kind &kind,
const std::string &name,
const std::string & repo = "")
{
// name and kind match:
- ProvideProcess installer (ZConfig::instance().systemArchitecture(), repo);
DBG << "Iterating over [" << kind << "]" << name << endl;
- invokeOnEach(
- God->pool().byIdentBegin(kind, name),
- God->pool().byIdentEnd(kind, name),
- zypp::functor::functorRef