[oe] [OE-core][PATCH v6 2/4] gpg_sign: detach_sign: fix gpg > 2.1 STDIN file descriptor

Burton, Ross ross.burton at intel.com
Thu Feb 25 09:42:24 UTC 2016


On 25 February 2016 at 09:38, Markus Lehtonen <
markus.lehtonen at linux.intel.com> 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



More information about the Openembedded-devel mailing list