Add '_' to the list of valid characters acceptable in package name

When trying to add python-ndg_httpsclient[1] to other requirements.txt we
recieved the following stack strace:

Traceback (most recent call last):
  File "/usr/local/bin/bindep", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/dist-packages/bindep/main.py", line 53, in main
    depends = bindep.depends.Depends(fd.read())
  File "/usr/local/lib/python2.7/dist-packages/bindep/depends.py", line 89, in __init__
    self._rules = parser.rules()
  File "/usr/local/lib/python2.7/dist-packages/parsley.py", line 98, in invokeRule
    raise err
ometa.runtime.ParseError:
python-ndg_httpsclient      [platform:rpm]

Munging the name isn't an option as the OS package manager wont "do the right thing".

Accept '_' as valid in package names.

[1] https://pkgs.org/centos-7/epel-x86_64/python-ndg_httpsclient-0.3.2-1.el7.noarch.rpm.html

Change-Id: I8f719b9bc3ad049def19b83a4f3901a42c669e70
This commit is contained in:
Tony Breeds 2016-07-29 09:20:31 -05:00
parent 871ac85019
commit 36b6b378a1
1 changed files with 1 additions and 1 deletions

View File

@ -45,7 +45,7 @@ rule = <name>:name selector?:selector version?:version ('\n'|comment) -> (
name, selector or [], version or [])
lowercase = ('a'|'b'|'c'|'d'|'e'|'f'|'g'|'h'|'i'|'j'|'k'|'l'|'m'|'n'|'o'|'p'
|'q'|'r'|'s'|'t'|'u'|'v'|'w'|'x'|'y'|'z')
name = letterOrDigit:start (letterOrDigit|'.'|'+'|'-'|'/')+:rest
name = letterOrDigit:start (letterOrDigit|'.'|'+'|'-'|'_'|'/')+:rest
ws = ' '+
profile = ('!'?:neg <(lowercase|digit|':'|'-')+>:name) -> (neg!='!', name)
selector = ws '[' profile:p1 (ws profile)*:p2 ']' -> [p1] + p2