diff options
author | Exploding Dragon <explodingfkl@gmail.com> | 2024-01-12 11:16:05 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-12 03:16:05 +0000 |
commit | ba4d0b8ffbd78473273800f586ae8bde55cda6c5 (patch) | |
tree | d828fd0f24bf6ddb38b2b4993b152f225c778c0a /modules | |
parent | 7c2f093e856395cc118dcaa390b7a2234b8363f3 (diff) | |
download | gitea-ba4d0b8ffbd78473273800f586ae8bde55cda6c5.tar.gz gitea-ba4d0b8ffbd78473273800f586ae8bde55cda6c5.zip |
Support for grouping RPMs using paths (#26984)
The current rpm repository places all packages in the same repository,
and different systems (el7,f34) may hit packages that do not belong to
this distribution ( #25304 ) , which now supports grouping of rpm.
![图片](https://github.com/go-gitea/gitea/assets/33776693/d1e1d99f-7799-4b2b-a19b-cb2a5c692914)
Fixes #25304 .
Fixes #27056 .
Refactor: [#25866](https://github.com/go-gitea/gitea/pull/25866)
Diffstat (limited to 'modules')
-rw-r--r-- | modules/packages/rpm/metadata.go | 3 | ||||
-rw-r--r-- | modules/templates/util_string.go | 5 |
2 files changed, 6 insertions, 2 deletions
diff --git a/modules/packages/rpm/metadata.go b/modules/packages/rpm/metadata.go index f019a8dde1..1ba4c73e8d 100644 --- a/modules/packages/rpm/metadata.go +++ b/modules/packages/rpm/metadata.go @@ -15,8 +15,7 @@ import ( ) const ( - PropertyMetadata = "rpm.metadata" - + PropertyMetadata = "rpm.metadata" SettingKeyPrivate = "rpm.key.private" SettingKeyPublic = "rpm.key.public" diff --git a/modules/templates/util_string.go b/modules/templates/util_string.go index 18a0d5cacc..613940ccdc 100644 --- a/modules/templates/util_string.go +++ b/modules/templates/util_string.go @@ -4,6 +4,7 @@ package templates import ( + "regexp" "strings" "code.gitea.io/gitea/modules/base" @@ -25,6 +26,10 @@ func (su *StringUtils) Contains(s, substr string) bool { return strings.Contains(s, substr) } +func (su *StringUtils) ReplaceAllStringRegex(s, regex, new string) string { + return regexp.MustCompile(regex).ReplaceAllString(s, new) +} + func (su *StringUtils) Split(s, sep string) []string { return strings.Split(s, sep) } |