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,
|
Distro: distro,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
apiError(ctx, http.StatusBadRequest, err)
|
apiError(ctx, http.StatusInternalServerError, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -117,19 +117,26 @@ func Push(ctx *context.Context) {
|
|||||||
Distro: distro,
|
Distro: distro,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
apiError(ctx, http.StatusBadRequest, err)
|
apiError(ctx, http.StatusInternalServerError, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// Automatically connect repository for provided package if name matched.
|
// Save file related to arch package description.
|
||||||
err = arch_service.RepositoryAutoconnect(ctx, owner, md.Name, pkgid)
|
_, 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 {
|
if err != nil {
|
||||||
apiError(ctx, http.StatusInternalServerError, err)
|
apiError(ctx, http.StatusInternalServerError, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update pacman databases with new package.
|
// Automatically connect repository for provided package if name matched.
|
||||||
err = arch_service.UpdatePacmanDatabases(ctx, md, distro, owner)
|
err = arch_service.RepositoryAutoconnect(ctx, owner, md.Name, pkgid)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
apiError(ctx, http.StatusInternalServerError, err)
|
apiError(ctx, http.StatusInternalServerError, err)
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user