Need a better validator for uploaded_version
Bug #922737 reported by
Danny Tamez
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Software Center Agent |
Confirmed
|
Low
|
Unassigned |
Bug Description
For now the current validator being used for version is too restrictive for uploaded_version. We don't ever want to prevent the reviewer from entering the actual uploaded version number because of our validator. At the same time we want to have the validator in place so as to catch potential typos/mistakes in the version number.
The validator should support numbers, tildes, letters etc. Some discussion needs to be had as to what other rules need to be in place.
Changed in software-center-agent: | |
status: | New → Confirmed |
importance: | Undecided → Low |
To post a comment you must log in.
On Fri, 27 Jan 2012 17:54:45 -0000, Danny Tamez <email address hidden> wrote:
> Public bug reported:
>
> For now the current validator being used for version is too restrictive
> for uploaded_version. We don't ever want to prevent the reviewer from
> entering the actual uploaded version number because of our validator. At
> the same time we want to have the validator in place so as to catch
> potential typos/mistakes in the version number.
>
> The validator should support numbers, tildes, letters etc. Some
> discussion needs to be had as to what other rules need to be in place.
The rules for what is valid are set out at
http:// www.debian. org/doc/ debian- policy/ ch-controlfield s.html# s-f-Version
python-debian has debian. debian_ support. BaseVersion that could be of
use. That defines
re_ valid_version = re.compile(
r" ^((?P<epoch> \d+):)? "
" (?P<upstream_ version> [A-Za-z0- 9.+:~-] +?)"
" (-(?P<debian_ revision> [A-Za-z0- 9+.~]+) )?$")
Rules for how version numbers are allowed to evolved are a different
matter.
Thanks,
James