Backport #32908 by ExplodingDragon It is mentioned in https://man.archlinux.org/man/PKGBUILD.5: 'The variable is not allowed to contain colons, forward slashes, hyphens, or whitespace.' `_` is also an allowed character, and some software in the Arch Linux AUR uses this naming convention. Co-authored-by: Exploding Dragon <explodingfkl@gmail.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
parent
a4291fd553
commit
c20642fa99
2 changed files with 11 additions and 2 deletions
|
@ -43,8 +43,9 @@ var (
|
|||
ErrInvalidArchitecture = util.NewInvalidArgumentErrorf("package architecture is invalid")
|
||||
|
||||
// https://man.archlinux.org/man/PKGBUILD.5
|
||||
namePattern = regexp.MustCompile(`\A[a-zA-Z0-9@._+-]+\z`)
|
||||
versionPattern = regexp.MustCompile(`\A(?:[0-9]:)?[a-zA-Z0-9.+~]+(?:-[a-zA-Z0-9.+-~]+)?\z`)
|
||||
namePattern = regexp.MustCompile(`\A[a-zA-Z0-9@._+-]+\z`)
|
||||
// (epoch:pkgver-pkgrel)
|
||||
versionPattern = regexp.MustCompile(`\A(?:\d:)?[\w.+~]+(?:-[-\w.+~]+)?\z`)
|
||||
)
|
||||
|
||||
type Package struct {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue