Bug 26801 - %rename macro mismatch
Summary: %rename macro mismatch
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: Cauldron
Hardware: All Linux
Priority: Normal normal
Target Milestone: ---
Assignee: Thierry Vignaud
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-06-15 15:32 CEST by Giuseppe Ghibò
Modified: 2020-06-22 15:33 CEST (History)
2 users (show)

See Also:
Source RPM: rpm-mageia-setup-2.56-2.mga8.src.rpm
CVE:
Status comment:


Attachments
patch to fix the %rename macro in rpm-mageia-setup (608 bytes, patch)
2020-06-15 19:58 CEST, Giuseppe Ghibò
Details | Diff
makes it take an optional 2nd argument in order to set the obsolete VR in stone (1.38 KB, patch)
2020-06-22 15:33 CEST, Thierry Vignaud
Details | Diff

Description Giuseppe Ghibò 2020-06-15 15:32:55 CEST
It seems that the %rename macro in current rpm is broken.

Actually (you can check with rpm --eval %rename), it's shown as:

Obsoletes: %{1} <= 0:%{version}-%{release} 
Provides: %{1} = 0:%{version}-%{release}

which should instead be:

Obsoletes: %{1} < 0:%{version}-%{release} 
Provides: %{1} = 0:%{version}-%{release}

because in the first case the "<=" would tell that the new package will obsoletes itself.

Also the rpm from mga7 (rpm-4.14.3-1.mga7) seems affected by the same problem.
Comment 1 Giuseppe Ghibò 2020-06-15 19:55:15 CEST
Looking deeper, this macro is not part of rpm package but rather of the package rpm-mageia-setup.

Source RPM: rpm-4.16.0-0.beta1.4.mga8.src.rpm => rpm-mageia-setup-2.56-2.mga8.src.rpm

Comment 2 Giuseppe Ghibò 2020-06-15 19:57:27 CEST
I attach a patch for the fix.
Comment 3 Giuseppe Ghibò 2020-06-15 19:58:22 CEST
Created attachment 11703 [details]
patch to fix the %rename macro in rpm-mageia-setup
Comment 5 Jani Välimaa 2020-06-15 21:11:11 CEST
I've never liked the whole %rename macro and I would drop it. I don't think anyone else than we and omdv are using it.

I don't like the idea that version and release it's using are variables. It's better to use fixed version and release in obsoletes so it gives an idea when the obsoletes was added.

But if we are going to fix something in it, we should also stop to add epoch 0 if epoch isn't defined.

CC: (none) => jani.valimaa

Comment 6 Giuseppe Ghibò 2020-06-15 22:47:45 CEST
The omv version of %rename, is the one of 2006, without the %epoch change. RH/FC and Suse have not defined it.

Actually the %rename macro is used in the following 73 packages:

avidemux
baloo
broadcom-wl
caja-beesu
caja-extensions
celt
cross-mipsel-binutils
cudf
db52
db53
digikam
dolphin
engrampa
exfatprogs
fglrx
file
ghostscript
gnu-free-fonts
gtk4.0
hunspell-et
igal2
isl
kactivities
kernel
kernel-540-joeghi
kernel-firmware
kernel-firmware-nonfree
kernel-joeghi
kfilemetadata
krunner
ktexteditor
libglvnd
libkdcraw
libkexiv2
libkgeomap
libkolab
libkscreen
libutempter
maelstrom
mate-applets
mesa
motif
npth
nvidia304
nvidia340
nvidia-current
ocaml-migrate-parsetree
ocaml-sexplib
ocaml-sqlite3
ocs-url
paraview
perl
perl-DelimMatch
perl-Dist-Zilla-Role-File-ChangeNotification
perl-Reaper
plasma-nm
pluma
python
qt4
qt5-fsarchiver
rpm-mageia-setup
spyder
sysvinit-legacy
telepathy-kde-accounts-kcm
texlive
texmacs
texstudio
usbredir
x11-server
xcb-util-image
xcb-util-keysyms
xz
zziplib
Comment 7 Lewis Smith 2020-06-16 21:40:01 CEST
Thank you Giuseppe for the report, and wealth of very expert comment.
Why not join us? https://wiki.mageia.org/en/Becoming_a_Mageia_Packager

Assigning to tv for rpm-mageia-setup.

Assignee: bugsquad => thierry.vignaud

Comment 8 Thierry Vignaud 2020-06-19 10:11:23 CEST
That's not broken as rpmlib ignores self obsoletes (unless you can show a real world issue…)

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

Comment 9 Giuseppe Ghibò 2020-06-19 20:03:20 CEST
pterjan found this problem in the BS, for libglvd-1.3.1-6.mga8 (it creates the obsoletes causing the package to be immediately removed).
Giuseppe Ghibò 2020-06-19 20:03:57 CEST

CC: (none) => pterjan

Comment 10 Pascal Terjan 2020-06-19 20:10:41 CEST
Yes youri removes obsoleted packages after upload, even if they just got added.

And I also agree with Jani in disliking that macro, mostly for the same reason that it causes a moving obsoletes rather than using a fixed evr at which the rename happened.
Comment 11 Thierry Vignaud 2020-06-22 15:22:36 CEST
Wouldn''t that be a bug in youri then?
But ok we can fix the macro anyway. Done in git.
About the second issue, it could maybe take a second argument to use and if not provided, fallback to EVR

Resolution: INVALID => FIXED

Comment 12 Thierry Vignaud 2020-06-22 15:33:47 CEST
Created attachment 11711 [details]
makes it take an optional 2nd argument in order to set the obsolete VR in stone

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