Bug 30419 - urpme fails to uninstall packages with caret version
Summary: urpme fails to uninstall packages with caret version
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: Cauldron
Hardware: All Linux
Priority: Low normal
Target Milestone: ---
Assignee: Thierry Vignaud
QA Contact:
URL: https://github.com/rpm-software-manag...
Whiteboard:
Keywords: UPSTREAM
Depends on:
Blocks:
 
Reported: 2022-05-13 17:37 CEST by Jani Välimaa
Modified: 2022-08-05 13:36 CEST (History)
0 users

See Also:
Source RPM: rpm, urpmi-8.127-2.mga9.src.rpm, perl-URPM-5.222-2.mga9.src.rpm
CVE:
Status comment:


Attachments
Reproducer .src.rpm (6.20 KB, application/x-rpm)
2022-05-13 17:37 CEST, Jani Välimaa
Details

Description Jani Välimaa 2022-05-13 17:37:35 CEST
Created attachment 13248 [details]
Reproducer .src.rpm

Urpme fails to uninstall packages with caret version whereas rpm and dnf succeeds. A simple test pkg can be built from attached .src.rpm.

# urpmi --no-verify-rpm test-1^snap1-1.mga9.noarch.rpm
installing test-1^snap1-1.mga9.noarch.rpm
Preparing...                     #################################################################
      1/1: test                  #################################################################

# urpme test
removing test-1^snap1-1.mga9.noarch
unable to remove package test-1^snap1-1.mga9.noarch

# dnf remove test
Dependencies resolved.
====================================================================================================
 Package            Architecture         Version                        Repository             Size
====================================================================================================
Removing:
 test               noarch               1^snap1-1.mga9                 @System                 7  

Transaction Summary
====================================================================================================
Remove  1 Package

Freed space: 7  
Is this ok [y/N]: y
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                            1/1 
  Erasing          : test-1^snap1-1.mga9.noarch                                                 1/1 
  Verifying        : test-1^snap1-1.mga9.noarch                                                 1/1 

Removed:
  test-1^snap1-1.mga9.noarch                                                                        

Complete!
Comment 1 David Walser 2022-05-13 23:12:46 CEST
This should be fixed, but we really just shouldn't have goofy symbols in version/release tags in Mageia (like caret or tilde).  Just because other distros do it doesn't mean we should.
Comment 2 Thierry Vignaud 2022-07-28 08:20:22 CEST
It's Trans_remove() which fails to find the pkg to add to the transaction.
http://gitweb.mageia.org/software/rpm/perl-URPM/tree/URPM.xs#n2655

It's actually a rpmlib bug:

$ for i in test test-1^snap1-1.mga9 kernel-desktop-devel-5.18.9-1.mga9;do rpm -e --test $i; done; 
error: package test-1^snap1-1.mga9 is not installed
$ rpm -q test-1^snap1-1.mga9 
package test-1^snap1-1.mga9 is not installed
$ rpm -q test 
test-1^snap1-1.mga9
$ pm -q kernel-desktop-devel-5.18.9-1.mga9
kernel-desktop-devel-5.18.9-1.mga9
$ rpm -q kernel-desktop-devel      
(…)
kernel-desktop-devel-5.18.11-1.mga9
kernel-desktop-devel-5.18.12-1.mga9
kernel-desktop-devel-5.18.13-1.mga9
kernel-desktop-devel-5.18.14-1.mga9
kernel-desktop-devel-5.18.14-2.mga9

Priority: Normal => Low

Thierry Vignaud 2022-07-28 08:21:13 CEST

Source RPM: urpmi-8.127-2.mga9.src.rpm, perl-URPM-5.222-2.mga9.src.rpm => rpm, urpmi-8.127-2.mga9.src.rpm, perl-URPM-5.222-2.mga9.src.rpm

Comment 3 Thierry Vignaud 2022-07-28 08:26:31 CEST
Reported upstream as https://github.com/rpm-software-management/rpm/issues/2132

URL: (none) => https://github.com/rpm-software-management/rpm/issues/2132
Keywords: (none) => UPSTREAM

Comment 4 Jani Välimaa 2022-07-29 20:44:32 CEST
Upstream commit https://github.com/rpm-software-management/rpm/commit/4420c78beb86cc67392274bf351478a3375626a2 applies as is to rpm 4.18 and 4.17. Applied it to local rpm 4.17.1 build and things seems to be working as expected.
Comment 5 Jani Välimaa 2022-08-05 13:36:05 CEST
This should be fixed with rpm-4.18.0-0.beta1.5.mga9 having the upstream patch included.

Status: NEW => RESOLVED
Resolution: (none) => FIXED


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