Merge pull request #113 from mstg/fix-nvr-for-upload

Allow ^ in version (NVR)
This commit is contained in:
resf-prow[bot] 2023-04-23 18:36:37 +00:00 committed by GitHub
commit 320a10d11c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -48,7 +48,7 @@ var (
func NVR() *regexp.Regexp { func NVR() *regexp.Regexp {
if nvr == nil { if nvr == nil {
nvr = regexp.MustCompile("^(\\S+)-([\\w~%.+]+)-(\\w+(?:\\.[\\w~%+]+)+?)(?:\\.(\\w+))?(?:\\.rpm)?$") nvr = regexp.MustCompile("^(\\S+)-([\\w~%.+^]+)-(\\w+(?:\\.[\\w~%+]+)+?)(?:\\.(\\w+))?(?:\\.rpm)?$")
} }
return nvr return nvr
} }
@ -62,7 +62,7 @@ func NVRNoArch() *regexp.Regexp {
func NVRUnusualRelease() *regexp.Regexp { func NVRUnusualRelease() *regexp.Regexp {
if nvrUnusualRelease == nil { if nvrUnusualRelease == nil {
nvrUnusualRelease = regexp.MustCompile("^(\\S+)-([\\w~%.+]+)-(\\w+?)(?:\\.(\\w+))?(?:\\.rpm)?$") nvrUnusualRelease = regexp.MustCompile("^(\\S+)-([\\w~%.+^]+)-(\\w+?)(?:\\.(\\w+))?(?:\\.rpm)?$")
} }
return nvrUnusualRelease return nvrUnusualRelease
} }