On Mar 6, 2011, at 12:44 AM, Per Øyvind Karlsen wrote:

> Working out some remaining issues in perl-URPM for dealing with upgrades
> from stable releases I became aware of some different behaviour for
> suggests giving headaches..
> 

To _START_ getting Suggests: implemented in RPM, the simplest possible
mechanism was implemented with syntax attached:

        A single flag bit was reserved, and "Suggests:" syntax in *.spec
        was added to set the bit.

Dince rpmlib is about mechanism, not "preference" or "policy", the use
proposed for the bits was:

        The flag bit is passed to depsolvers and RPM does nothing
        whatsoever with the bit, i.e. no rpmlib behavior change.

> First of all, ie. 'rpm -q --requires foo' will return both "regular"
> requires and
> suggests, is this really correct behaviour?
> 

This is the intended implementation yes. There is no way to determine
"correct" or even "useful" from an RPM POV. Note that --requires is
a popt alia for a --queryformat and isn't an option at all. You
could write a different --queryformat and test the Suggests: bit if you chose
to do so.

> For rpm 4.6 it will also treat the suggests as "regular" requires as well,  
> ie.
> trying to install packages built with rpm 5.3 without satisfying suggests
> will return in dependency error.
> 

Yes, that behavior is what was intended and hasn't changed since
implemented, and so rpm-5.3 SHOULD be bhaving exactly like patched
rpm-4.6 (the patch came from rpm-4.4.6 iirc).

> I'm not sure about what's considered as "correct" behaviour or not,
> working around it in perl-URPM can be done..
> IMHO 'rpm -q --requires' shouldn't return soft dependencies, and older
> rpm versions shouldn't treat these as such either, ignorance of not
> knowing better being fairly obvious.. ;)
> 

So propose something.

Then add (or qugment) some query format extension to map the bit
into some string like "hint", and then add a --pipe to (essentially)
        | grep -v '(hint)'
so that the bit test can be mapped into a pattern and you won't
see "Suggests:" mixed in with "Requires:".

Note that there are no "soft dependencies" in dependency assertion checks
in RPM, never have been, anywhere. The truth table is
        TRUE
        FALSE
not
        Sorta kina maybe do what I mean but don't break anything.

I'm not sure there's anything that will be accomplished by the above
other than writing a --queryformat for lusers who care more about
what URPMI does with Suggests: than what "rpm -q --requires" displays.

hth

73 de Jeff

______________________________________________________________________
RPM Package Manager                                    http://rpm5.org
Developer Communication List                        rpm-devel@rpm5.org

Reply via email to