1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2025-09-15 18:56:59 +00:00

fix arch pkg

(cherry picked from commit 95c7599db5)
This commit is contained in:
dragon 2024-10-21 10:08:57 +08:00 committed by forgejo-backport-action
parent 240fbc2661
commit fa307f06ac
3 changed files with 41 additions and 4 deletions

View file

@ -173,6 +173,12 @@ func PushPackage(ctx *context.Context) {
apiError(ctx, http.StatusInternalServerError, err)
return
}
if p.FileMetadata.Arch == "any" {
if err = arch_service.BuildCustomRepositoryFiles(ctx, ctx.Package.Owner.ID, group); err != nil {
apiError(ctx, http.StatusInternalServerError, err)
return
}
}
ctx.Status(http.StatusCreated)
}
@ -197,8 +203,7 @@ func GetPackageOrDB(ctx *context.Context) {
}
if archDBOrSig.MatchString(file) {
pkg, u, pf, err := arch_service.GetPackageDBFile(ctx, group, arch, ctx.Package.Owner.ID,
strings.HasSuffix(file, ".sig"))
pkg, u, pf, err := arch_service.GetPackageDBFile(ctx, ctx.Package.Owner.ID, group, arch, strings.HasSuffix(file, ".sig"))
if err != nil {
if errors.Is(err, util.ErrNotExist) {
apiError(ctx, http.StatusNotFound, err)