Richard W.M. Jones
2015-Aug-12 16:08 UTC
Re: [Libguestfs] [PATCH 1/2] builder: add non-int revisions
On Wed, Aug 12, 2015 at 03:12:21PM +0200, Pino Toscano wrote:> Add support for non-integer revisions of entries, comparing them as > integer when possible.Have you got an example of revisions? It may be possible to use Common_utils.compare_version which does RPM revision-style comparison. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-df lists disk usage of guests without needing to install any software inside the virtual machine. Supports Linux and Windows. http://people.redhat.com/~rjones/virt-df/
Pino Toscano
2015-Aug-12 16:58 UTC
Re: [Libguestfs] [PATCH 1/2] builder: add non-int revisions
On Wednesday 12 August 2015 17:08:42 Richard W.M. Jones wrote:> On Wed, Aug 12, 2015 at 03:12:21PM +0200, Pino Toscano wrote: > > Add support for non-integer revisions of entries, comparing them as > > integer when possible. > > Have you got an example of revisions?The Simple Streams README says about that: * version_name: A 'version' of a product represents a release, build or collection of that product. A key in the 'versions' dictionary should be sortable by rules of a 'LANG=C sort()'. That allows the client to trivially order versions to find the most recent. Ubuntu uses "serial" numbers for these keys, in the format YYYYMMDD[.0-9]. json files for Ubuntu and CirrOS images uses this format, although it seems to not be a strict rule.> It may be possible to use > Common_utils.compare_version which does RPM revision-style comparison.Hm so you are suggesting to just make the revision internally as string (but still forcing an integer in native indexes)? That would work too, I guess. Thanks, -- Pino Toscano
Richard W.M. Jones
2015-Aug-12 19:58 UTC
Re: [Libguestfs] [PATCH 1/2] builder: add non-int revisions
On Wed, Aug 12, 2015 at 06:58:12PM +0200, Pino Toscano wrote:> On Wednesday 12 August 2015 17:08:42 Richard W.M. Jones wrote: > > On Wed, Aug 12, 2015 at 03:12:21PM +0200, Pino Toscano wrote: > > > Add support for non-integer revisions of entries, comparing them as > > > integer when possible. > > > > Have you got an example of revisions? > > The Simple Streams README says about that: > > * version_name: > A 'version' of a product represents a release, build or collection of > that product. A key in the 'versions' dictionary should be sortable > by rules of a 'LANG=C sort()'. That allows the client to trivially > order versions to find the most recent. Ubuntu uses "serial" numbers > for these keys, in the format YYYYMMDD[.0-9].Yikes, that's a very poor choice because at some point someone will create a revision "10.0" and wonder why "10.0" < "2.0". If they were using RPM-style revisions it would work. But that's not something we can solve.> json files for Ubuntu and CirrOS images uses this format, although > it seems to not be a strict rule. > > > It may be possible to use > > Common_utils.compare_version which does RPM revision-style comparison. > > Hm so you are suggesting to just make the revision internally as string > (but still forcing an integer in native indexes)? That would work too, > I guess.No, what I said doesn't work in the light of the quote from the SimpleStreams README above. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://people.redhat.com/~rjones/virt-top
Seemingly Similar Threads
- Re: [PATCH 1/2] builder: add non-int revisions
- [PATCH 4/4] builder: support Simple Streams v1.0 as index metadata
- [PATCH 4/5] mllib: move stringify_args from dib
- [PATCH 1/2] mllib: allow external_command to return on nonzero return value
- [PATCH 2/3] mllib: expose disk decrypt functionalities