On Jan 3, 2011, at 8:33 PM, Tim Foster wrote: > On Mon, 2011-01-03 at 17:24 -0800, Shawn Walker wrote: >> On 01/ 3/11 05:15 PM, Tim Foster wrote: >>> The packaging system validates versions at package creation time > >> I'm fairly certain the point here is to prevent the fairly long running >> build process from even starting if the user's provided bad input for >> the resulting package. >> >> In that case, it makes sense to validate things such as the package name >> and version before the build starts. > > Fair point. Creating a dummy package with the user-supplied name and > version should be enough, eg. > Shawn -- thanks for stating it so clearly and Tim thanks for the solution below that is what I am looking for. A way to use the actual IPS code to validate a version. Thanks for your post early this morning on my previous post about how to perform pkglint. I finally have a repository with no pkglint warnings.
> $ cat > dummy.mf > set pkg.fmri=pkg://foo/[email protected],1.0 > set pkg.arch=i386 > set pkg.summary='A dummy package' > $ pkglint dummy.mf > Lint engine setup... > Starting lint run... > WARNING opensolaris.manifest001.1 Missing key pkg.description from > pkg://foo/[email protected],1.0 > WARNING opensolaris.manifest001.1 Missing key org.opensolaris.consolidation > from pkg://foo/[email protected],1.0 > WARNING opensolaris.manifest001.1 Missing key info.classification from > pkg://foo/[email protected],1.0 > $ >From previous post ...... > 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? I thought there was a limit that matched an IP address -- only 4 digits -- I see I was very wrong. >>>> 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. Rinaldo _______________________________________________ pkg-discuss mailing list [email protected] http://mail.opensolaris.org/mailman/listinfo/pkg-discuss
