On 25 February 2016 at 09:38, Markus Lehtonen <
[email protected]> wrote:

> Not sure I'd trust that either, version comparison logic is painful.
> Something like this might be more resilient to interesting versioning:
>
> dots = versionstring.split('.')
> assert len(dots) >2
> if int(dots[0]) >= 2 and int(dots[1])>= 1:
>
>
> Even this doesn't work as e.g. I have gpg version 2.0.24. But, I agree
> that version comparison is tricky, e.g. "2.10" > "2.2" would return False.
> 2.1 is a nice version number in that sense ;) I don't know if gpg has had
> of will ever have any alphabets in its version number.
>

My assert should have been >=2, but surely it will work as your version
would fail the test, as intended?


> try:
>     return subprocess.check_output((self.gpg_bin, "version")).split()[2]
> except CalledProcessExceptionOrWhateverThisExceptionIsCalled:
>     raise bb.build.FuncFailed("Could not get gpg version (%s). Called %s,
> output %s" % (e, e.cmd, e.output))
>
>
> I guess you mean (with double dash before 'version'):
> return subprocess.check_output((self.gpg_bin, "--version")).split()[2]
>

Yeah, that. :)

Ross
-- 
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel

Reply via email to