mirror of
https://github.com/aquasecurity/trivy.git
synced 2026-02-18 22:53:20 +08:00
fix: Trim the end-of-range suffix (#9618)
Co-authored-by: DmitriyLewen <91113035+DmitriyLewen@users.noreply.github.com>
This commit is contained in:
@@ -43,6 +43,10 @@ func (p *Parser) splitLine(line string) []string {
|
||||
}
|
||||
for _, sep := range separators {
|
||||
if result := strings.Split(line, sep); len(result) == 2 {
|
||||
// Trim the end-of-range suffix. For example, ">=2.31.0,<3" becomes ">=2.31.0".
|
||||
// In version ranges, only `,` can be used as a separator:
|
||||
// "The comma (“,”) is equivalent to a logical AND operator" (see PEP 440).
|
||||
result[1], _, _ = strings.Cut(result[1], ",")
|
||||
return result
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,4 +4,5 @@ Mopidy-Dirble ~= 1.1 # Compatible release. Same as >= 1.1, == 1.*
|
||||
Django == 2.3.4
|
||||
SomeProject ==5.4 ; python_version < '3.8'
|
||||
numpyNew; sys_platform == 'win32'
|
||||
numpy >= 3.4.1; sys_platform == 'win32'
|
||||
numpy >= 3.4.1; sys_platform == 'win32'
|
||||
requests>=2.31.0,<3 # Minimum version 2.31.0. Trim the end-of-range suffix.
|
||||
|
||||
Reference in New Issue
Block a user