On Mon, 2011-01-03 at 19:36 -0500, Rinaldo DiGiorgio wrote:
> I am providing a hudson base service allowing users to request IPS
> package builds of the ten or so packages I am working with. My
> application has two sources for version specification. I would like to
> validate the user input early.
The packaging system validates versions at package creation time - I'm
not sure providing separate validation code is worthwhile (or
recommended) you're reinventing the wheel here.
> 1) The file system -- the versions are embedded in the path name and I
> convert them to IPS format
> 2) Users may specify a version of their own choice and override the
> file system
> I downloaded the code and I think that the version.py module performs
> the version check. I used the test file to do a few tests. I was
> expecting exceptions to be raised.
Why?
> >>> import version;
> >>> version.DotSequence("1.1.3");
> [1, 1, 3]
> >>> version.DotSequence("1.1.3.5");
> [1, 1, 3, 5]
> >>> version.DotSequence("1.1.3.5.6");
> [1, 1, 3, 5, 6]
> >>> version.DotSequence("1.1.3.5.6.7");
> [1, 1, 3, 5, 6, 7]
> >>> version.DotSequence("1");
> [1]
> >>> version.DotSequence("1.1");
> [1, 1]
Those are all valid versions (as the code suggests) Any of the pkg tools
which uses version.py will report errors on broken version strings, eg.
t...@linn[6375] pkglint omf.manifest
Lint engine setup...
CRITICAL lint.manifest002 Error in file omf: Illegal FMRI
'pkg://opensolaris.org/system/[email protected],5.11-0.141:20100603T215050Z': Bad
Version: 0.5a.11
Error: Either a cache directory, or some local manifest files must be
provided.
t...@linn[6376]
t...@linn[6377] pkgsend publish --fmri-in-manifest -d /tmp omf
pkgsend: Illegal FMRI
'pkg://opensolaris.org/system/[email protected],5.11-0.141:20100603T215050Z': Bad
Version: 0.5a.11
t...@linn[6378]
etc.
cheers,
tim
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss