ref: refs/heads/master
commit b672e267458368448bcf10cad877719f9b78687f
Author: Ján Kupec
Date: Mon Jul 27 16:45:42 2009 +0200
Fixed installing rpms with epoch (bnc #404048)
---
src/Zypper.cc | 1 +
src/install.cc | 21 ++++++++++++++++-----
2 files changed, 17 insertions(+), 5 deletions(-)
diff --git a/src/Zypper.cc b/src/Zypper.cc
index 31ae08e..7fef72d 100644
--- a/src/Zypper.cc
+++ b/src/Zypper.cc
@@ -3138,6 +3138,7 @@ void Zypper::doCommand()
{
string nvrcap =
header->tag_name() + "=" +
+ str::numstring(header->tag_epoch()) + ":" +
header->tag_version() + "-" +
header->tag_release();
DBG << "rpm package capability: " << nvrcap << endl;
diff --git a/src/install.cc b/src/install.cc
index d63cd6d..c6978a4 100755
--- a/src/install.cc
+++ b/src/install.cc
@@ -554,16 +554,26 @@ void install_remove(Zypper & zypper,
string::size_type pos;
// force repository specified by prefixing 'repo:' to the package name
+ //! \todo FIXME this causes problems when requesting symbols containing
+ //! ':', like perl(Foo::Bar) or package with specified epoch.
+ //! Maybe we should drop or introduce another
+ //! way to enforce repo per package.
if (!force_by_capability &&
- //! \todo FIXME this causes problems when requesting symbols containing
- //! ':', like perl(Foo::Bar). Maybe we should drop or introduce another
- //! way to enforce repo per package.
(pos = str.rfind(':')) != string::npos &&
!(str.find("perl(") == 0)) // bnc #433679
{
repo = str.substr(0, pos);
- str = str.substr(pos + 1);
- force_by_name = true; // until there is a solver API for this
+ if (match_repo(zypper, repo, &RepoInfo()))
+ {
+ str = str.substr(pos + 1);
+ force_by_name = true; //! \todo until there is a solver API for this
+ DBG << "will install " << str << " from repo " << repo << endl;
+ }
+ // not a repo, continue as usual
+ else
+ {
+ repo.clear();
+ }
}
// force arch with '.'
@@ -589,6 +599,7 @@ void install_remove(Zypper & zypper,
{
DBG << "Unknown arch (" << arch << ") in package " << str
<< ", will treat it like part of the name" << endl;
+ arch.clear();
/*
zypper.out().error(
str::form(_("Unknown architecture '%s'"), arch.c_str()),
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org