[Mageia-dev] About panotools patent problem (and other problematic rpms)

Per Øyvind Karlsen peroyvind at mandriva.org
Sat Feb 19 20:27:29 CET 2011


2011/2/18 Michael Scherer <misc at zarb.org>:
> Le vendredi 18 février 2011 à 12:47 +0000, James Kerr a écrit :
>
>> If there are two packages, one in core and another in tainted, then
>> doesn't urpmi need a way to recognise that the tainted package is newer
>> than (an update to) the corresponding core package? I believe that this
>> is achieved in Mandriva, because plf is greater than mdv.
>
> That's abusing release tag and it work by pure chance ( ie, had the plf
> decided to  be called the guillomovitch liberation front, it would not
> have worked ). And this is quite inflexible, since people will always
> have plf packages, leading to users adding some rpm in skip.list with a
> regexp.
Exactly! :)

I've just started to look into implementing support for favoring packages
based on %disttag, I'm thinking about implementing it in a way similar to this:

Say we have global variables such as these in urpmi.cfg:

disttag-priority: plf,mdv,mga
disttag-pin: 1
disttag-pin-force: 0

in urpmi:

* if disttag-priority is defined, it will compared the disttag of all
packages that
has the same or newer version, and favor the one of those with the disttag
that's highest on the disttag-priority list.

* if disttag-pin is set, it will refuse to upgrade to a newer version
of a package
that has a different disttag than the one installed.

* if disttag-pin-force is set, it will *always* upgrade/downgrade to the newest
version of a package which has the highest priority match, ie. if foo-2-1mdv
is installed, and the newest version with 'mga' disttag available in repos is
foo-1-1mga, then it will downgrade to it.

Notice that %disttag is a tag that's been implemented in rpm since long time
ago, but was never really adopted for anything, so in rpm5 it was dusted off
and was adjusted a tiny bit for it to be made possible to be defined globally
through macro files read, similar to ie. %vendor etc.

I've already in the past patched rpm 4.6 in cooker with support for at least
recognizing %distepoch (but not for using it in version comparision, doing
it should be fairly trivial though), I might've already made the change
mentioned for %disttag as well in the same patch, I don't really remember,
should anyhow be very trivial to do..

So if you'd like to eliminate 'mga' from release and version comparision,
you can already do so by making the minor change for %disttag, then
make adjustments accordingly to %_build_name_fmt and %mkrel.

Adopting distepoch as well will require slightly more, but won't really been
hard (the hard part has already been tendered well after slamming cooker
a bit more than expected..;) and would be a sane thing to adopt anyways..

FWIW in .spec files, the preferred conditional would be:

%if "%disttag" == "mga"
blabla
%else if "%disttag" == "plf"
hubbabubba
%else if "%disttag" == "mdv"
boink!
%endif

WDYT?

--
Regards,
Per Øyvind


More information about the Mageia-dev mailing list