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

Andreas Hanke at Labix Tracker tracker at labix.org
Fri Oct 6 15:41:56 PDT 2006


Andreas Hanke <andreas.hanke at gmx-topmail.de> added the comment:

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 at i686" should succeed even if ffmpeg at 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?

----------
status: unread -> chatting

_______________________________________
Labix issue tracker <tracker at labix.org>
<http://tracker.labix.org/issue215>
_______________________________________



More information about the Smart mailing list