removed functionality related to automatic source code repository connection

This commit is contained in:
Danila Fominykh 2023-09-28 17:13:40 -03:00
parent 0dd3db2280
commit c09da2a9e1
No known key found for this signature in database
GPG Key ID: 1134F8EBF98AA06F
2 changed files with 1 additions and 22 deletions

View File

@ -21,7 +21,6 @@ import (
// Push new package to arch package registry.
func Push(ctx *context.Context) {
var (
owner = ctx.Params("username")
filename = ctx.Params("filename")
distro = ctx.Params("distro")
sign = ctx.Params("sign")
@ -70,7 +69,7 @@ func Push(ctx *context.Context) {
props[distro+"-"+filename+".sig"] = sign
}
ver, _, err := pkg_service.CreatePackageOrAddFileToExisting(
_, _, err = pkg_service.CreatePackageOrAddFileToExisting(
&pkg_service.PackageCreationInfo{
PackageInfo: pkg_service.PackageInfo{
Owner: ctx.Package.Owner,
@ -108,12 +107,6 @@ func Push(ctx *context.Context) {
return
}
err = arch_service.RepoConnect(ctx, owner, desc.Name, ver.ID)
if err != nil {
apiError(ctx, http.StatusInternalServerError, err)
return
}
ctx.Status(http.StatusOK)
}

View File

@ -13,7 +13,6 @@ import (
"strings"
pkg_model "code.gitea.io/gitea/models/packages"
repository "code.gitea.io/gitea/models/repo"
"code.gitea.io/gitea/modules/context"
arch_module "code.gitea.io/gitea/modules/packages/arch"
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")
}
// 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
// starting from latest in descending order is checked to be compatible with
// requested combination of architecture and distribution. When/If the first