[Yum] [PATCH] Make unversioned satisfy everything in rangeCompare() also with flag=0

Ville Skyttä ville.skytta at iki.fi
Thu Jun 25 18:55:54 UTC 2009


On Thursday 25 June 2009, James Antill wrote:
> Ville Skyttä <ville.skytta at iki.fi> writes:
> > Hmm, I don't understand, could you elaborate/rephrase?
> >
> > "foo >=" without a version doesn't make sense to me, for example rpmbuild
> > doesn't let "Requires: foo >=" pass.  Is it actually possible to have
> > such relations that have name, the = >= and friends bits, but no version
> > in packages?
>
>  If it's not possible to do, then surely having bad output for those
> impossible cases isn't a problem?:)

Well, the current implementation already tries to (and does) avoid producing 
bad output (e.g. "foo 1.0") if someone passes a version but no flags to it.  I 
just found it inconsistent that it makes such a special case for flags but not 
version.

> > In the commit message where the patch was reverted, it says "This isn't
> > right ... Eg. =>, (None, None, None) VS. < (1, 2, 3) is false.".  Isn't
> > formatRequire() just for formatting stuff for humans to read, what does
> > it have to do with actual version comparisons?
>
>  Yes, it's just for output ... but if a package refuses to install and
> the output says "dependency not found 'foo'", and we look and
> something is providing 'foo < 1' and we are requiring 'foo' that will
> be very confusing ... whereas if the output says "dependency not found
> 'foo >='" we'll know that something is weird (and why the dep. failed).

Fair enough.  But as noted, it doesn't output such weirdness if a version is 
but no flags are passed.  So perhaps turn my suggestion around, remove the 
special case for flags and output let's say "foo ??? 1.0" if passed ("foo", 
"1.0", None) or ("foo", "1.0", 0)?  Or if you don't like that, leave things as 
is but maybe document the expected behaviour of the function? ;)

Anyway, thanks for your patience.


More information about the Yum mailing list