Cannot switch architecture of an installed RPM with rpm-force defaulting to False

Bug #244524 reported by Rehan Khan
2
Affects Status Importance Assigned to Milestone
Smart Package Manager
New
Undecided
Unassigned

Bug Description

Imported: http://tracker.labix.org/issue215

Reason: Review Issue

further details: https://blueprints.launchpad.net/smart/+spec/bug-reporting-migration

msg1115 (view) Author: darkmerlin Date: 2007-03-12.15:34:01

Now, in 0.5 version of smart it didn't work. If I have to change arch from i586
to i686 Smart select i586 package for uninstall and i686 for install BUT then I
want to apply changes it say that package is already installed.

IMHO The problem is smart check if package is installed before that it will be
uninstalled and doesn't check for arch... The best way is to change process for
calculating changing in this way:
1. Exclude uninstalling packages (without checking relations).
2. Include installing packages (without checking relations, but with checking
existing and installing files)
3. Check relations.

msg755 (view) Author: netmask Date: 2006-10-07.14:48:29

This issue is being inspected.

On a first look, the patch proposed isn't the best one, but we're working on the
final solution.

msg752 (view) Author: ahanke Date: 2006-10-06.22:41:56

The most trivial patch one could imagine is:

###
--- smart/backends/rpm/pm.py
+++ smart/backends/rpm/pm.py
@@ -206,8 +206,8 @@
         if forcerpmorder or sysconf.get("rpm-order"):
             ts.order()
         probfilter = rpm.RPMPROB_FILTER_OLDPACKAGE
+ probfilter |= rpm.RPMPROB_FILTER_REPLACEPKG
         if force or reinstall:
- probfilter |= rpm.RPMPROB_FILTER_REPLACEPKG
             probfilter |= rpm.RPMPROB_FILTER_REPLACEOLDFILES
             probfilter |= rpm.RPMPROB_FILTER_REPLACENEWFILES
         ts.setProbFilter(probfilter)

###

I'm currently unsure how to proceed.

IMHO the command "smart install ffmpeg@i686" should succeed even if ffmpeg@i586
is already installed, or vice versa. Currently it does not, unless "rpm-force"
is set to True, but IMHO this should work without "rpm-force=True". The only way
to accomplish that is using RPMPROB_FILTER_REPLACEPKG in the problem filter.
(Note that this is not the same as --force, just a subset of it, and does not
have anything to do with filesystem clashes.)

Ideas:

- Always use RPMPROB_FILTER_REPLACEPKG, as in the patch above. Advantage:
Simple; Disadvantage: Ugly. On the other hand, always using
RPMPROB_FILTER_OLDPACKAGE, which is currently the case, isn't much prettier.

- Automatically detect the cases where RPMPROB_FILTER_REPLACEPKG would be
necessary for a transaction to succeed (switching the architecture of an
installed package is one of them) and use RPMPROB_FILTER_REPLACEPKG just in
these corner cases. Advantage: This would be the prettiest solution.
Disadvantage: Not trivial to do.

- Introduce a new sysconfig option "rpm-replacepkgs" that can be set
independently of "rpm-force". Use RPMPROB_FILTER_REPLACEPKG just if this is set.
Advantage: Easily customizable. Disadvantage: There are already quite a lot of
backend-specific sysconfig options.

Any input which direction you prefer?

msg712 (view) Author: ahanke Date: 2006-09-18.23:13:21

rpm-force defaults to False in svn.

This breaks switching the architecture of installed RPMs.

For example, I installed ffmpeg@i586 by mistake. Trying to install ffmpeg@i686
in the GUI results in the error message:

package ffmpeg-0.4.9-7.pm.svn20060918 is already installed

After changing rpm-force back to True, it's working as expected.

The reinstall and downgrade cases are not affected by this problem, they are
working correctly even with rpm-force defaulting to False. So I guess they are
handled as exception, this needs to be extended to cover the architecture
switching case as well.

This is SUSE 10.1 (i686) with rpm-4.4.2

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.