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.

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 would like to validate user input before I start the actual build.  I thought 
I would try a regex or use the existing python code. I tried to  use the 
existing python code and version test examples.

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.  


>>> 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]


I would be happier with a regex for validating the Version. Is anyone aware of 
a regex that validates the version number. 

Rinaldo

_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss

Reply via email to