Bug 7922

Summary: mgaversion macro inconsistency
Product: Mageia Reporter: Mageia Hater <mageia.hater>
Component: RPM PackagesAssignee: RPM stack maintainers <rpmstack>
Status: NEW --- QA Contact:
Severity: normal    
Priority: Normal CC: dmorganec, doktor5000, mageia, mageia, mageia, ngompa13, sysadmin-bugs, thierry.vignaud
Version: CauldronKeywords: PATCH
Target Milestone: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Source RPM: rpm-mageia-setup CVE:
Status comment:
Attachments: Suggested patch to remove the mgaversion macro from rpm-setup
Suggested patch to remove the mgaversion macro from mgarepo.conf

Description Mageia Hater 2012-10-28 23:55:02 CET
The %mgaversion rpm macros is defined by rpm-mageia-setup as the same as %distro_release. But it is defined as "100 * major + minor" in svn://svn.mageia.org/svn/adm/puppet/modules/buildsystem/templates/mgarepo.conf.

mgarepo.conf or rpm-mageia-setup should be modified to use the same value. But maybe it is easier to simply remove this macros as it seems to be rarely used, and can be replaced by %distro_release.
Mageia Hater 2012-10-28 23:55:45 CET

CC: (none) => sysadmin-bugs

Comment 1 Mageia Hater 2012-10-28 23:57:19 CET
Created attachment 3006 [details]
Suggested patch to remove the mgaversion macro from rpm-setup
Comment 2 Mageia Hater 2012-10-28 23:59:15 CET
Created attachment 3007 [details]
Suggested patch to remove the mgaversion macro from mgarepo.conf
Manuel Hiebel 2012-10-29 18:31:07 CET

Keywords: (none) => PATCH
CC: (none) => dmorganec, mageia, thierry.vignaud

Thierry Vignaud 2012-12-06 09:20:25 CET

Assignee: bugsquad => boklm

Nicolas Vigier 2014-03-24 10:54:18 CET

Assignee: boklm => bugsquad

Comment 3 Thierry Vignaud 2015-02-11 08:38:36 CET
Colin, is there any %mgaversion users in your specs checkout?

CC: (none) => mageia

Comment 4 Colin Guthrie 2015-02-11 09:01:01 CET
I've not updated it in over a year, but:

asterisk/current/SPECS/asterisk.spec:%if %{mgaversion} < 3
dahdi/current/SPECS/dahdi.spec:%if %{mgaversion} < 3
dahdi/current/SPECS/dahdi.spec:%if %{mgaversion} < 3
fglrx-legacy/current/SPECS/fglrx-legacy.spec:%if %{mgaversion} <= 1
fglrx/current/SPECS/fglrx.spec:%if %{mgaversion} <= 2
fglrx/current/SPECS/fglrx.spec:%if %{mgaversion} <= 1
firefox/current/SPECS/firefox.spec:%if %{mgaversion} >= 4
firefox/current/SPECS/firefox.spec:%if %{mgaversion} >= 4
firefox/current/SPECS/firefox.spec:%if %{mgaversion} >= 3
fusionpbx/current/SPECS/fusionpbx.spec:%if %{mgaversion} < 3
fusionpbx/current/SPECS/fusionpbx.spec:%if %{mgaversion} >= 3
garmintools/current/SPECS/garmintools.spec:%if %{mgaversion} < 3
mythtv-mythweb/current/SPECS/mythtv-mythweb.spec:%if %{mgaversion} < 3
mythtv-mythweb/current/SPECS/mythtv-mythweb.spec:%if %{mgaversion} >= 3
nvidia-current/current/SPECS/nvidia-current.spec:%if %simple || %mgaversion <= 2
nvidia-current/current/SPECS/nvidia-current.spec:%if !%simple && %mgaversion >= 2
nvidia304/current/SPECS/nvidia304.spec:%if %mgaversion < 3
nvidia304/current/SPECS/nvidia304.spec:%if !%simple && %mgaversion >= 2
openldap/current/SPECS/openldap.spec:%{?mgaversion:%global mdkversion 201100}
openldap/current/SPECS/openldap.spec:%if %{?mgaversion:1}%{?!mgaversion:0}
openldap/current/SPECS/openldap.spec:%if %mgaversion >= 3
openldap/current/SPECS/openldap.spec:%if %mgaversion <= 2
openldap/current/SPECS/openldap.spec:%if %mgaversion <= 1
openldap/current/SPECS/openldap.spec:%endif # mgaversion
openldap/current/SPECS/openldap.spec:%if %{?mgaversion}%{?!mgaversion:0} >= 3
openldap/current/SPECS/openldap.spec:%if %{?mgaversion}%{?!mgaversion:0} >= 3
openldap/current/SPECS/openldap.spec:%if %{?mgaversion}%{?!mgaversion:0} >= 3
openldap/current/SPECS/openldap.spec:%if %{?mgaversion}%{?!mgaversion:0} >= 3
php-apc/current/SPECS/php-apc.spec:%if %{mgaversion} < 3
php-apc/current/SPECS/php-apc.spec:%if %{mgaversion} >= 3
php-manual-en/current/SPECS/php-manual-en.spec:%if %{mgaversion} < 3
php-manual-en/current/SPECS/php-manual-en.spec:%if %{mgaversion} >= 3
php-xcache/current/SPECS/php-xcache.spec:%if %{mgaversion} < 3
php-xcache/current/SPECS/php-xcache.spec:%if %{mgaversion} >= 3
php/current/SPECS/php.spec:%if %{mgaversion} < 3
php/current/SPECS/php.spec:%if %{mgaversion} < 3
php/current/SPECS/php.spec:%if %{mgaversion} >= 3
phpipam/current/SPECS/phpipam.spec:%if %{mgaversion} < 3
phpipam/current/SPECS/phpipam.spec:%if %{mgaversion} >= 3
phpldapadmin/current/SPECS/phpldapadmin.spec:%if %{mgaversion} < 3
phpldapadmin/current/SPECS/phpldapadmin.spec:%if %{mgaversion} >= 3
qbittorrent/current/SPECS/qbittorrent.spec:%if %{mgaversion} >= 2
qbittorrent/current/SPECS/qbittorrent.spec:%if %{mgaversion} >= 2
qbittorrent/current/SPECS/qbittorrent.spec:%if %{mgaversion} >= 2
qbittorrent/current/SPECS/qbittorrent.spec:%if %{mgaversion} >= 2
rpmlint/current/SPECS/rpmlint.spec:%if %{mgaversion} < 2
rutorrent/current/SPECS/rutorrent.spec:%if %{mgaversion} < 3
rutorrent/current/SPECS/rutorrent.spec:%if %{mgaversion} >= 3
squid/current/SPECS/squid.spec:%if %{mgaversion} < 3
squid/current/SPECS/squid.spec:%if %{mgaversion} >= 3
squirrelmail/current/SPECS/squirrelmail.spec:%if %{mgaversion} < 3
squirrelmail/current/SPECS/squirrelmail.spec:%if %{mgaversion} >= 3
tevent/current/SPECS/tevent.spec:%{?mgaversion: %global mdkversion %(echo $[(2010+%mgaversion)*100])}
thunderbird/current/SPECS/thunderbird.spec:%if %{mgaversion} >= 3
thunderbird/current/SPECS/thunderbird.spec:%if %{mgaversion} >= 4
thunderbird/current/SPECS/thunderbird.spec:%if %{mgaversion} >= 3
tokyocabinet/current/SPECS/tokyocabinet.spec:%if %{mgaversion} < 3
tokyocabinet/current/SPECS/tokyocabinet.spec:%if %{mgaversion} >= 3
ulogd/current/SPECS/ulogd.spec:%if %{mgaversion} < 3
viewvc/current/SPECS/viewvc.spec:%if %mgaversion < 3
wine/current/SPECS/wine.spec:%if %mgaversion >= 3
wine/current/SPECS/wine.spec:%if %mgaversion >= 3
xymon/current/SPECS/xymon.spec:%{?mgaversion: %define mdkversion %mgaversion}


(FWIW, when I (eventually manage to) switch pkgs to git, I'll setup three auto-updating, read-only rsyncable repos - 1) *.specs from srpms. 2) systemd units from pkgs, 3). ....erm... I forget what the third is. Feel free to ping me about it if you have suggestions :))
Comment 5 Florian Hubold 2015-12-19 14:25:53 CET
(In reply to Colin Guthrie from comment #4)
> I've not updated it in over a year, but:

> (FWIW, when I (eventually manage to) switch pkgs to git, I'll setup three
> auto-updating, read-only rsyncable repos - 1) *.specs from srpms. 2) systemd
> units from pkgs, 3). ....erm... I forget what the third is. Feel free to
> ping me about it if you have suggestions :))

That would be pretty awesome, especially 1) - I still sometimes use your cauldron spec tarball :p

CC: (none) => doktor5000

Samuel Verschelde 2016-10-15 21:22:49 CEST

Assignee: bugsquad => rpmstack

Comment 6 Neal Gompa 2016-10-15 22:02:14 CEST
I'd suggest replacing usage of %mgaversion with %mageia, which is the new one provided in mga5 and newer as part of mageia-release. If there are packages with version checks below mga5, those should be purged, as we no longer support any of those.

CC: (none) => ngompa13

Comment 7 Rémi Verschelde 2016-10-17 15:10:55 CEST
(In reply to Neal Gompa from comment #6)
> I'd suggest replacing usage of %mgaversion with %mageia, which is the new
> one provided in mga5 and newer as part of mageia-release. If there are
> packages with version checks below mga5, those should be purged, as we no
> longer support any of those.

Agreed.
Comment 8 Thierry Vignaud 2016-10-17 15:13:34 CEST
This be more like other distros (at least, FC, RHEL)
Though SuSe's using %suse_version
Comment 9 Nicolas Lécureuil 2016-10-17 15:23:34 CEST
%mageia isn't really easy to understand.
%mgaversonor %mageia_version is easier to find what it is for.

CC: (none) => mageia

Comment 10 Rémi Verschelde 2016-10-17 15:29:59 CEST
(In reply to Nicolas Lécureuil from comment #9)
> %mageia isn't really easy to understand.
> %mgaversonor %mageia_version is easier to find what it is for.

That's true, though:

%if 0%{?mageia}

is more elegant than:

%if 0%{?mgaversion}

Though I agree it's kind of a Fedora-ism :P