aboutsummaryrefslogtreecommitdiffstats
path: root/services/packages/cleanup/cleanup.go
diff options
context:
space:
mode:
authorKN4CK3R <admin@oldschoolhack.me>2024-01-19 12:37:10 +0100
committerGitHub <noreply@github.com>2024-01-19 11:37:10 +0000
commit461d8b53c2e51a8a6a1715ba40ac61d7e9f93971 (patch)
tree2bad0b2908f9f3e76d9a195c4fe1c66016b8bcbf /services/packages/cleanup/cleanup.go
parent075c4c89ee28590bd4ab8f6cf7338d723c4696eb (diff)
downloadgitea-461d8b53c2e51a8a6a1715ba40ac61d7e9f93971.tar.gz
gitea-461d8b53c2e51a8a6a1715ba40ac61d7e9f93971.zip
Fix some RPM registry flaws (#28782)
Related #26984 (https://github.com/go-gitea/gitea/pull/26984#issuecomment-1889588912) Fix admin cleanup message. Fix models `Get` not respecting default values. Rebuild RPM repository files after cleanup. Do not add RPM group to package version name. Force stable sorting of Alpine/Debian/RPM repository data. Fix missing deferred `Close`. Add tests for multiple RPM groups. Removed non-cached `ReplaceAllStringRegex`. If there are multiple groups available, it's stated in the package installation screen: ![grafik](https://github.com/go-gitea/gitea/assets/1666336/8f132760-882c-4ab8-9678-77e47dfc4415)
Diffstat (limited to 'services/packages/cleanup/cleanup.go')
-rw-r--r--services/packages/cleanup/cleanup.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/services/packages/cleanup/cleanup.go b/services/packages/cleanup/cleanup.go
index 04ee6c4419..0ff8077bc9 100644
--- a/services/packages/cleanup/cleanup.go
+++ b/services/packages/cleanup/cleanup.go
@@ -19,6 +19,7 @@ import (
cargo_service "code.gitea.io/gitea/services/packages/cargo"
container_service "code.gitea.io/gitea/services/packages/container"
debian_service "code.gitea.io/gitea/services/packages/debian"
+ rpm_service "code.gitea.io/gitea/services/packages/rpm"
)
// Task method to execute cleanup rules and cleanup expired package data
@@ -127,6 +128,10 @@ func ExecuteCleanupRules(outerCtx context.Context) error {
if err := alpine_service.BuildAllRepositoryFiles(ctx, pcr.OwnerID); err != nil {
return fmt.Errorf("CleanupRule [%d]: alpine.BuildAllRepositoryFiles failed: %w", pcr.ID, err)
}
+ } else if pcr.Type == packages_model.TypeRpm {
+ if err := rpm_service.BuildAllRepositoryFiles(ctx, pcr.OwnerID); err != nil {
+ return fmt.Errorf("CleanupRule [%d]: rpm.BuildAllRepositoryFiles failed: %w", pcr.ID, err)
+ }
}
}
return nil