Bug 25439 - urpmi --downgrade regression
Summary: urpmi --downgrade regression
Status: RESOLVED INVALID
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: Cauldron
Hardware: All Linux
Priority: Normal normal
Target Milestone: ---
Assignee: RPM stack maintainers
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-09-14 14:52 CEST by Jani Välimaa
Modified: 2020-03-02 23:34 CET (History)
3 users (show)

See Also:
Source RPM: urpmi / rpm
CVE:
Status comment:


Attachments

Description Jani Välimaa 2019-09-14 14:52:24 CEST
Perhaps this is a bug in new rpm? Previously urpmi --downgrade re-installed pkgs, but it's not working anymore.

Mageia 7:
==========
$ LC_ALL=C sudo urpmi --downgrade nano
The following package has to be removed for others to be upgraded:
nano-4.2-1.mga7.x86_64
 (in order to install nano-4.2-1.mga7.x86_64) (y/N) y


    
installing nano-4.2-1.mga7.x86_64.rpm from /var/cache/urpmi/rpms               
Preparing...                     #############################################
      1/1: nano                  #############################################
      1/1: removing nano-4.2-1.mga7.x86_64
                                 #############################################
 
Current Cauldron:
=================
$ LC_ALL=C sudo urpmi --downgrade nano
The following package has to be removed for others to be upgraded:
nano-4.4-1.mga8.x86_64
 (in order to install nano-4.4-1.mga8.x86_64) (y/N) y


installing nano-4.4-1.mga8.x86_64.rpm from /var/cache/urpmi/rpms
Preparing...                     #############################################
Installation failed:	package nano-4.4-1.mga8.x86_64 is already installed
Comment 1 Morgan Leijström 2019-10-15 12:19:47 CEST
In the Cauldron case the installed version is the same as it wants to install.

I wonder if it is a regression, or same behaviour under similar circumstances;

Cauldron do not use update repo.

What happens if you simulate the situation in mga7?  i.e disable update repo, uninstall nano, install nano, and then tries to downgrade when there is only one version available?

CC: (none) => fri

Comment 2 Jani Välimaa 2019-10-15 20:30:07 CEST
In both cases the version is the same. There's no nano update for mga7. I'd say it worked in current Cauldron until rpm version upgrade.

I've used --downgrade to reinstall pkgs for quite some time with cauldron as I don't really use stable releases.
Comment 3 Thierry Vignaud 2020-03-02 16:01:23 CET
There's no bug there.
--downgrade can only work if there's 2 different version of the same pkgs in enabled media

Status: NEW => RESOLVED
Resolution: (none) => INVALID
CC: (none) => thierry.vignaud

Comment 4 Morgan Leijström 2020-03-02 17:38:35 CET
Why do it even try if there is no downgrade to do?
Martin Whitaker 2020-03-02 20:47:31 CET

See Also: (none) => https://bugs.mageia.org/show_bug.cgi?id=26284

Comment 5 Martin Whitaker 2020-03-02 20:52:49 CET
--replacepkgs now appears to do what --downgrade used to do (different from what it does in Mageia 7).

CC: (none) => mageia

Comment 6 Thierry Vignaud 2020-03-02 23:02:35 CET
Nope, nothing has changed on that front
urpmi -replacepkgs --replacefiles enable to reinstall the same pkg
--downgrade will downgrade to an older version of the pkg (or to the same version  if no other version is available)

And yes it would be cleaner not to attempt a downgrade if it cannot be performed but it has always been like this.
It's a very dumb implementation...
Comment 7 Martin Whitaker 2020-03-02 23:26:48 CET
(In reply to Thierry Vignaud from comment #6)
> Nope, nothing has changed on that front

Sorry, but that's plainly not true.

On my mga7 system --downgrade removes the old package, --replacepkgs doesn't. This makes a difference if you are testing new builds of a rpm, and change the files or directories. With --replacepkgs, the old files/directories will be left in place.

On a cauldron system --downgrade fails and --replacepkgs behaves like --downgrade on the mga7 system.

For example:

-- mga7 --------------------------------
# urpmi --downgrade grub2-mageia-theme
The following package has to be removed for others to be upgraded:
grub2-mageia-theme-2.02.0-15.mga7.noarch
 (in order to install grub2-mageia-theme-2.02.0-15.mga7.noarch) (y/N) y


    ftp://mimir/mageia/distrib/7/x86_64: media/core/release/grub2-mageia-theme-2.02.0-15.mga7.noarch.rpm
installing grub2-mageia-theme-2.02.0-15.mga7.noarch.rpm from /var/cache/urpmi/rpms                                 
Preparing...                     #################################################################################
      1/1: grub2-mageia-theme    #################################################################################
      1/1: removing grub2-mageia-theme-2.02.0-15.mga7.noarch
                                 #################################################################################
# urpmi --replacepkgs grub2-mageia-theme


    ftp://mimir/mageia/distrib/7/x86_64: media/core/release/grub2-mageia-theme-2.02.0-15.mga7.noarch.rpm
installing grub2-mageia-theme-2.02.0-15.mga7.noarch.rpm from /var/cache/urpmi/rpms                                 
Preparing...                     #################################################################################
      1/1: grub2-mageia-theme    #################################################################################
---------------------------------------

- cauldron ----------------------------
# urpmi --downgrade grub2-mageia-theme
The following package has to be removed for others to be upgraded:
grub2-mageia-theme-2.04.0-9.mga8.noarch
 (in order to install grub2-mageia-theme-2.04.0-9.mga8.noarch) (y/N) y


    ftp://mimir/mageia/distrib/cauldron/x86_64: media/core/release/grub2-mageia-theme-2.04.0-9.mga8.noarch.rpm
installing grub2-mageia-theme-2.04.0-9.mga8.noarch.rpm from /var/cache/urpmi/rpms                                 
Preparing...                     #################################################################################
Installation failed:    package grub2-mageia-theme-2.04.0-9.mga8.noarch.rpm is already installed
# urpmi --replacepkgs grub2-mageia-theme


    ftp://mimir/mageia/distrib/7/x86_64: media/core/release/grub2-mageia-theme-2.04.0-9.mga8.noarch.rpm
installing grub2-mageia-theme-2.04.0-9.mga8.noarch.rpm from /var/cache/urpmi/rpms                                 
Preparing...                     #################################################################################
      1/1: grub2-mageia-theme    #################################################################################
      1/1: removing grub2-mageia-theme-2.04.0-9.mga8.noarch
                                 #################################################################################
---------------------------------------
Comment 8 Thierry Vignaud 2020-03-02 23:34:53 CET
Humm, URPM/urpmi really didn't changed on that front.
I suspect a side effect of the upgrade to rpm-4.15.x instead...

Note You need to log in before you can comment on or make changes to this bug.