mirror of
https://github.com/go-gitea/gitea.git
synced 2024-09-01 14:56:30 +00:00
removed functionality related to automatic source code repository connection
This commit is contained in:
parent
0dd3db2280
commit
c09da2a9e1
@ -21,7 +21,6 @@ import (
|
|||||||
// Push new package to arch package registry.
|
// Push new package to arch package registry.
|
||||||
func Push(ctx *context.Context) {
|
func Push(ctx *context.Context) {
|
||||||
var (
|
var (
|
||||||
owner = ctx.Params("username")
|
|
||||||
filename = ctx.Params("filename")
|
filename = ctx.Params("filename")
|
||||||
distro = ctx.Params("distro")
|
distro = ctx.Params("distro")
|
||||||
sign = ctx.Params("sign")
|
sign = ctx.Params("sign")
|
||||||
@ -70,7 +69,7 @@ func Push(ctx *context.Context) {
|
|||||||
props[distro+"-"+filename+".sig"] = sign
|
props[distro+"-"+filename+".sig"] = sign
|
||||||
}
|
}
|
||||||
|
|
||||||
ver, _, err := pkg_service.CreatePackageOrAddFileToExisting(
|
_, _, err = pkg_service.CreatePackageOrAddFileToExisting(
|
||||||
&pkg_service.PackageCreationInfo{
|
&pkg_service.PackageCreationInfo{
|
||||||
PackageInfo: pkg_service.PackageInfo{
|
PackageInfo: pkg_service.PackageInfo{
|
||||||
Owner: ctx.Package.Owner,
|
Owner: ctx.Package.Owner,
|
||||||
@ -108,12 +107,6 @@ func Push(ctx *context.Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
err = arch_service.RepoConnect(ctx, owner, desc.Name, ver.ID)
|
|
||||||
if err != nil {
|
|
||||||
apiError(ctx, http.StatusInternalServerError, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
ctx.Status(http.StatusOK)
|
ctx.Status(http.StatusOK)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,7 +13,6 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
pkg_model "code.gitea.io/gitea/models/packages"
|
pkg_model "code.gitea.io/gitea/models/packages"
|
||||||
repository "code.gitea.io/gitea/models/repo"
|
|
||||||
"code.gitea.io/gitea/modules/context"
|
"code.gitea.io/gitea/modules/context"
|
||||||
arch_module "code.gitea.io/gitea/modules/packages/arch"
|
arch_module "code.gitea.io/gitea/modules/packages/arch"
|
||||||
pkg_service "code.gitea.io/gitea/services/packages"
|
pkg_service "code.gitea.io/gitea/services/packages"
|
||||||
@ -59,19 +58,6 @@ func GetPackageSignature(ctx *context.Context, distro, file string) (*bytes.Read
|
|||||||
return nil, errors.New("signature for requested package not found")
|
return nil, errors.New("signature for requested package not found")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Automatically connect repository with source code to published package, if
|
|
||||||
// repository with the same name exists in user/organization scope.
|
|
||||||
func RepoConnect(ctx *context.Context, owner, repo string, pkgid int64) error {
|
|
||||||
r, err := repository.GetRepositoryByOwnerAndName(ctx, owner, repo)
|
|
||||||
if err == nil {
|
|
||||||
err = pkg_model.SetRepositoryLink(ctx, pkgid, r.ID)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// Finds all arch packages in user/organization scope, each package version
|
// Finds all arch packages in user/organization scope, each package version
|
||||||
// starting from latest in descending order is checked to be compatible with
|
// starting from latest in descending order is checked to be compatible with
|
||||||
// requested combination of architecture and distribution. When/If the first
|
// requested combination of architecture and distribution. When/If the first
|
||||||
|
Loading…
Reference in New Issue
Block a user