mirror of
https://github.com/go-gitea/gitea.git
synced 2024-09-01 14:56:30 +00:00
db desc file for pacman database is saved in the same space with package
This commit is contained in:
parent
3ffb4b21d7
commit
6d1037d506
@ -103,7 +103,7 @@ func Push(ctx *context.Context) {
|
||||
Distro: distro,
|
||||
})
|
||||
if err != nil {
|
||||
apiError(ctx, http.StatusBadRequest, err)
|
||||
apiError(ctx, http.StatusInternalServerError, err)
|
||||
return
|
||||
}
|
||||
|
||||
@ -117,19 +117,26 @@ func Push(ctx *context.Context) {
|
||||
Distro: distro,
|
||||
})
|
||||
if err != nil {
|
||||
apiError(ctx, http.StatusBadRequest, err)
|
||||
apiError(ctx, http.StatusInternalServerError, err)
|
||||
return
|
||||
}
|
||||
|
||||
// Automatically connect repository for provided package if name matched.
|
||||
err = arch_service.RepositoryAutoconnect(ctx, owner, md.Name, pkgid)
|
||||
// Save file related to arch package description.
|
||||
_, err = arch_service.SaveFile(ctx, &arch_service.SaveFileParams{
|
||||
Organization: org,
|
||||
User: user,
|
||||
Metadata: md,
|
||||
Data: []byte(md.GetDbDesc()),
|
||||
Filename: filename + ".desc",
|
||||
Distro: distro,
|
||||
})
|
||||
if err != nil {
|
||||
apiError(ctx, http.StatusInternalServerError, err)
|
||||
return
|
||||
}
|
||||
|
||||
// Update pacman databases with new package.
|
||||
err = arch_service.UpdatePacmanDatabases(ctx, md, distro, owner)
|
||||
// Automatically connect repository for provided package if name matched.
|
||||
err = arch_service.RepositoryAutoconnect(ctx, owner, md.Name, pkgid)
|
||||
if err != nil {
|
||||
apiError(ctx, http.StatusInternalServerError, err)
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user