2019-09-15 17:28:25 +02:00
|
|
|
// Copyright 2019 The Gitea Authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a MIT-style
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
package release
|
|
|
|
|
|
|
|
import (
|
2022-01-20 00:26:57 +01:00
|
|
|
"context"
|
2021-03-22 17:09:51 +01:00
|
|
|
"errors"
|
2019-09-15 17:28:25 +02:00
|
|
|
"fmt"
|
|
|
|
"strings"
|
|
|
|
|
|
|
|
"code.gitea.io/gitea/models"
|
2021-09-19 13:49:59 +02:00
|
|
|
"code.gitea.io/gitea/models/db"
|
2022-06-12 17:51:54 +02:00
|
|
|
git_model "code.gitea.io/gitea/models/git"
|
2021-11-19 14:39:57 +01:00
|
|
|
repo_model "code.gitea.io/gitea/models/repo"
|
2021-11-24 10:49:20 +01:00
|
|
|
user_model "code.gitea.io/gitea/models/user"
|
2019-09-15 17:28:25 +02:00
|
|
|
"code.gitea.io/gitea/modules/git"
|
|
|
|
"code.gitea.io/gitea/modules/log"
|
2019-11-06 09:25:50 +01:00
|
|
|
"code.gitea.io/gitea/modules/notification"
|
2020-01-10 10:34:21 +01:00
|
|
|
"code.gitea.io/gitea/modules/repository"
|
2020-08-18 06:23:45 +02:00
|
|
|
"code.gitea.io/gitea/modules/storage"
|
2019-09-15 17:28:25 +02:00
|
|
|
"code.gitea.io/gitea/modules/timeutil"
|
|
|
|
)
|
|
|
|
|
2022-08-25 04:31:57 +02:00
|
|
|
func createTag(gitRepo *git.Repository, rel *repo_model.Release, msg string) (bool, error) {
|
2021-03-22 17:09:51 +01:00
|
|
|
var created bool
|
2019-09-15 17:28:25 +02:00
|
|
|
// Only actual create when publish.
|
|
|
|
if !rel.IsDraft {
|
|
|
|
if !gitRepo.IsTagExist(rel.TagName) {
|
2021-06-25 16:28:55 +02:00
|
|
|
if err := rel.LoadAttributes(); err != nil {
|
|
|
|
log.Error("LoadAttributes: %v", err)
|
|
|
|
return false, err
|
|
|
|
}
|
|
|
|
|
2022-06-12 17:51:54 +02:00
|
|
|
protectedTags, err := git_model.GetProtectedTags(rel.Repo.ID)
|
2021-06-25 16:28:55 +02:00
|
|
|
if err != nil {
|
|
|
|
return false, fmt.Errorf("GetProtectedTags: %v", err)
|
|
|
|
}
|
2022-09-04 12:47:56 +02:00
|
|
|
|
|
|
|
// Trim '--' prefix to prevent command line argument vulnerability.
|
|
|
|
rel.TagName = strings.TrimPrefix(rel.TagName, "--")
|
2022-06-12 17:51:54 +02:00
|
|
|
isAllowed, err := git_model.IsUserAllowedToControlTag(protectedTags, rel.TagName, rel.PublisherID)
|
2021-06-25 16:28:55 +02:00
|
|
|
if err != nil {
|
|
|
|
return false, err
|
|
|
|
}
|
|
|
|
if !isAllowed {
|
|
|
|
return false, models.ErrProtectedTagName{
|
|
|
|
TagName: rel.TagName,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-09-15 17:28:25 +02:00
|
|
|
commit, err := gitRepo.GetCommit(rel.Target)
|
|
|
|
if err != nil {
|
2021-08-31 03:18:15 +02:00
|
|
|
return false, fmt.Errorf("createTag::GetCommit[%v]: %v", rel.Target, err)
|
2019-09-15 17:28:25 +02:00
|
|
|
}
|
|
|
|
|
2021-02-28 20:57:45 +01:00
|
|
|
if len(msg) > 0 {
|
|
|
|
if err = gitRepo.CreateAnnotatedTag(rel.TagName, msg, commit.ID.String()); err != nil {
|
|
|
|
if strings.Contains(err.Error(), "is not a valid tag name") {
|
2021-03-22 17:09:51 +01:00
|
|
|
return false, models.ErrInvalidTagName{
|
2021-02-28 20:57:45 +01:00
|
|
|
TagName: rel.TagName,
|
|
|
|
}
|
|
|
|
}
|
2021-03-22 17:09:51 +01:00
|
|
|
return false, err
|
2021-02-28 20:57:45 +01:00
|
|
|
}
|
|
|
|
} else if err = gitRepo.CreateTag(rel.TagName, commit.ID.String()); err != nil {
|
2019-09-15 17:28:25 +02:00
|
|
|
if strings.Contains(err.Error(), "is not a valid tag name") {
|
2021-03-22 17:09:51 +01:00
|
|
|
return false, models.ErrInvalidTagName{
|
2019-09-15 17:28:25 +02:00
|
|
|
TagName: rel.TagName,
|
|
|
|
}
|
|
|
|
}
|
2021-03-22 17:09:51 +01:00
|
|
|
return false, err
|
2019-09-15 17:28:25 +02:00
|
|
|
}
|
2021-03-22 17:09:51 +01:00
|
|
|
created = true
|
2019-09-15 17:28:25 +02:00
|
|
|
rel.LowerTagName = strings.ToLower(rel.TagName)
|
2021-06-25 16:28:55 +02:00
|
|
|
|
2021-12-29 12:40:57 +01:00
|
|
|
commits := repository.NewPushCommits()
|
|
|
|
commits.HeadCommit = repository.CommitToPushCommit(commit)
|
|
|
|
commits.CompareURL = rel.Repo.ComposeCompareURL(git.EmptySHA, commit.ID.String())
|
|
|
|
|
2019-11-22 23:13:57 +01:00
|
|
|
notification.NotifyPushCommits(
|
2020-10-30 22:59:02 +01:00
|
|
|
rel.Publisher, rel.Repo,
|
|
|
|
&repository.PushUpdateOptions{
|
|
|
|
RefFullName: git.TagPrefix + rel.TagName,
|
|
|
|
OldCommitID: git.EmptySHA,
|
|
|
|
NewCommitID: commit.ID.String(),
|
2021-12-29 12:40:57 +01:00
|
|
|
}, commits)
|
2022-01-20 00:26:57 +01:00
|
|
|
notification.NotifyCreateRef(rel.Publisher, rel.Repo, "tag", git.TagPrefix+rel.TagName, commit.ID.String())
|
2020-07-28 20:08:45 +02:00
|
|
|
rel.CreatedUnix = timeutil.TimeStampNow()
|
2019-09-15 17:28:25 +02:00
|
|
|
}
|
|
|
|
commit, err := gitRepo.GetTagCommit(rel.TagName)
|
|
|
|
if err != nil {
|
2021-03-22 17:09:51 +01:00
|
|
|
return false, fmt.Errorf("GetTagCommit: %v", err)
|
2019-09-15 17:28:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
rel.Sha1 = commit.ID.String()
|
|
|
|
rel.NumCommits, err = commit.CommitsCount()
|
|
|
|
if err != nil {
|
2021-03-22 17:09:51 +01:00
|
|
|
return false, fmt.Errorf("CommitsCount: %v", err)
|
2019-09-15 17:28:25 +02:00
|
|
|
}
|
2020-10-22 02:55:25 +02:00
|
|
|
|
2021-01-01 22:03:31 +01:00
|
|
|
if rel.PublisherID <= 0 {
|
2021-11-24 10:49:20 +01:00
|
|
|
u, err := user_model.GetUserByEmail(commit.Author.Email)
|
2021-01-01 22:03:31 +01:00
|
|
|
if err == nil {
|
|
|
|
rel.PublisherID = u.ID
|
|
|
|
}
|
2020-10-22 02:55:25 +02:00
|
|
|
}
|
2019-09-15 17:28:25 +02:00
|
|
|
} else {
|
|
|
|
rel.CreatedUnix = timeutil.TimeStampNow()
|
|
|
|
}
|
2021-03-22 17:09:51 +01:00
|
|
|
return created, nil
|
2019-09-15 17:28:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// CreateRelease creates a new release of repository.
|
2022-08-25 04:31:57 +02:00
|
|
|
func CreateRelease(gitRepo *git.Repository, rel *repo_model.Release, attachmentUUIDs []string, msg string) error {
|
|
|
|
has, err := repo_model.IsReleaseExist(gitRepo.Ctx, rel.RepoID, rel.TagName)
|
2019-09-15 17:28:25 +02:00
|
|
|
if err != nil {
|
|
|
|
return err
|
2022-06-03 08:13:58 +02:00
|
|
|
} else if has {
|
2022-08-25 04:31:57 +02:00
|
|
|
return repo_model.ErrReleaseAlreadyExist{
|
2019-09-15 17:28:25 +02:00
|
|
|
TagName: rel.TagName,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-03-22 17:09:51 +01:00
|
|
|
if _, err = createTag(gitRepo, rel, msg); err != nil {
|
2019-09-15 17:28:25 +02:00
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
rel.LowerTagName = strings.ToLower(rel.TagName)
|
2022-06-03 08:13:58 +02:00
|
|
|
if err = db.Insert(gitRepo.Ctx, rel); err != nil {
|
2019-09-15 17:28:25 +02:00
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
2022-08-25 04:31:57 +02:00
|
|
|
if err = repo_model.AddReleaseAttachments(gitRepo.Ctx, rel.ID, attachmentUUIDs); err != nil {
|
2019-09-15 17:28:25 +02:00
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
if !rel.IsDraft {
|
2019-11-06 09:25:50 +01:00
|
|
|
notification.NotifyNewRelease(rel)
|
2019-09-15 17:28:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2021-02-28 20:57:45 +01:00
|
|
|
// CreateNewTag creates a new repository tag
|
2022-01-20 00:26:57 +01:00
|
|
|
func CreateNewTag(ctx context.Context, doer *user_model.User, repo *repo_model.Repository, commit, tagName, msg string) error {
|
2022-08-25 04:31:57 +02:00
|
|
|
has, err := repo_model.IsReleaseExist(ctx, repo.ID, tagName)
|
2021-02-28 20:57:45 +01:00
|
|
|
if err != nil {
|
|
|
|
return err
|
2022-06-03 08:13:58 +02:00
|
|
|
} else if has {
|
2021-02-28 20:57:45 +01:00
|
|
|
return models.ErrTagAlreadyExists{
|
|
|
|
TagName: tagName,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-01-20 00:26:57 +01:00
|
|
|
gitRepo, closer, err := git.RepositoryFromContextOrOpen(ctx, repo.RepoPath())
|
2021-02-28 20:57:45 +01:00
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
2022-01-20 00:26:57 +01:00
|
|
|
defer closer.Close()
|
2021-02-28 20:57:45 +01:00
|
|
|
|
2022-08-25 04:31:57 +02:00
|
|
|
rel := &repo_model.Release{
|
2021-02-28 20:57:45 +01:00
|
|
|
RepoID: repo.ID,
|
2021-06-25 16:28:55 +02:00
|
|
|
Repo: repo,
|
2021-02-28 20:57:45 +01:00
|
|
|
PublisherID: doer.ID,
|
2021-06-25 16:28:55 +02:00
|
|
|
Publisher: doer,
|
2021-02-28 20:57:45 +01:00
|
|
|
TagName: tagName,
|
|
|
|
Target: commit,
|
|
|
|
IsDraft: false,
|
|
|
|
IsPrerelease: false,
|
|
|
|
IsTag: true,
|
|
|
|
}
|
|
|
|
|
2021-03-22 17:09:51 +01:00
|
|
|
if _, err = createTag(gitRepo, rel, msg); err != nil {
|
2021-02-28 20:57:45 +01:00
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
2022-06-03 08:13:58 +02:00
|
|
|
return db.Insert(ctx, rel)
|
2021-02-28 20:57:45 +01:00
|
|
|
}
|
|
|
|
|
2021-03-22 17:09:51 +01:00
|
|
|
// UpdateRelease updates information, attachments of a release and will create tag if it's not a draft and tag not exist.
|
|
|
|
// addAttachmentUUIDs accept a slice of new created attachments' uuids which will be reassigned release_id as the created release
|
|
|
|
// delAttachmentUUIDs accept a slice of attachments' uuids which will be deleted from the release
|
|
|
|
// editAttachments accept a map of attachment uuid to new attachment name which will be updated with attachments.
|
2022-08-25 04:31:57 +02:00
|
|
|
func UpdateRelease(doer *user_model.User, gitRepo *git.Repository, rel *repo_model.Release,
|
2022-02-23 21:16:07 +01:00
|
|
|
addAttachmentUUIDs, delAttachmentUUIDs []string, editAttachments map[string]string,
|
|
|
|
) (err error) {
|
2021-03-22 17:09:51 +01:00
|
|
|
if rel.ID == 0 {
|
|
|
|
return errors.New("UpdateRelease only accepts an exist release")
|
|
|
|
}
|
|
|
|
isCreated, err := createTag(gitRepo, rel, "")
|
|
|
|
if err != nil {
|
2019-09-15 17:28:25 +02:00
|
|
|
return err
|
|
|
|
}
|
|
|
|
rel.LowerTagName = strings.ToLower(rel.TagName)
|
|
|
|
|
2021-09-19 13:49:59 +02:00
|
|
|
ctx, committer, err := db.TxContext()
|
2021-03-22 17:09:51 +01:00
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
2021-09-19 13:49:59 +02:00
|
|
|
defer committer.Close()
|
2021-03-22 17:09:51 +01:00
|
|
|
|
2022-08-25 04:31:57 +02:00
|
|
|
if err = repo_model.UpdateRelease(ctx, rel); err != nil {
|
2019-09-15 17:28:25 +02:00
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
2022-08-25 04:31:57 +02:00
|
|
|
if err = repo_model.AddReleaseAttachments(ctx, rel.ID, addAttachmentUUIDs); err != nil {
|
2021-03-22 17:09:51 +01:00
|
|
|
return fmt.Errorf("AddReleaseAttachments: %v", err)
|
|
|
|
}
|
|
|
|
|
2022-01-20 18:46:10 +01:00
|
|
|
deletedUUIDsMap := make(map[string]bool)
|
2021-03-22 17:09:51 +01:00
|
|
|
if len(delAttachmentUUIDs) > 0 {
|
|
|
|
// Check attachments
|
2021-11-19 14:39:57 +01:00
|
|
|
attachments, err := repo_model.GetAttachmentsByUUIDs(ctx, delAttachmentUUIDs)
|
2021-03-22 17:09:51 +01:00
|
|
|
if err != nil {
|
|
|
|
return fmt.Errorf("GetAttachmentsByUUIDs [uuids: %v]: %v", delAttachmentUUIDs, err)
|
|
|
|
}
|
|
|
|
for _, attach := range attachments {
|
|
|
|
if attach.ReleaseID != rel.ID {
|
|
|
|
return errors.New("delete attachement of release permission denied")
|
|
|
|
}
|
|
|
|
deletedUUIDsMap[attach.UUID] = true
|
|
|
|
}
|
|
|
|
|
2021-11-19 14:39:57 +01:00
|
|
|
if _, err := repo_model.DeleteAttachments(ctx, attachments, false); err != nil {
|
2021-03-22 17:09:51 +01:00
|
|
|
return fmt.Errorf("DeleteAttachments [uuids: %v]: %v", delAttachmentUUIDs, err)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(editAttachments) > 0 {
|
2022-01-20 18:46:10 +01:00
|
|
|
updateAttachmentsList := make([]string, 0, len(editAttachments))
|
2021-03-22 17:09:51 +01:00
|
|
|
for k := range editAttachments {
|
|
|
|
updateAttachmentsList = append(updateAttachmentsList, k)
|
|
|
|
}
|
|
|
|
// Check attachments
|
2021-11-19 14:39:57 +01:00
|
|
|
attachments, err := repo_model.GetAttachmentsByUUIDs(ctx, updateAttachmentsList)
|
2021-03-22 17:09:51 +01:00
|
|
|
if err != nil {
|
|
|
|
return fmt.Errorf("GetAttachmentsByUUIDs [uuids: %v]: %v", updateAttachmentsList, err)
|
|
|
|
}
|
|
|
|
for _, attach := range attachments {
|
|
|
|
if attach.ReleaseID != rel.ID {
|
|
|
|
return errors.New("update attachement of release permission denied")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
for uuid, newName := range editAttachments {
|
|
|
|
if !deletedUUIDsMap[uuid] {
|
2021-11-19 14:39:57 +01:00
|
|
|
if err = repo_model.UpdateAttachmentByUUID(ctx, &repo_model.Attachment{
|
2021-03-22 17:09:51 +01:00
|
|
|
UUID: uuid,
|
|
|
|
Name: newName,
|
|
|
|
}, "name"); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-09-19 13:49:59 +02:00
|
|
|
if err = committer.Commit(); err != nil {
|
2021-03-22 17:09:51 +01:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
for _, uuid := range delAttachmentUUIDs {
|
2021-11-19 14:39:57 +01:00
|
|
|
if err := storage.Attachments.Delete(repo_model.AttachmentRelativePath(uuid)); err != nil {
|
2021-03-22 17:09:51 +01:00
|
|
|
// Even delete files failed, but the attachments has been removed from database, so we
|
|
|
|
// should not return error but only record the error on logs.
|
|
|
|
// users have to delete this attachments manually or we should have a
|
|
|
|
// synchronize between database attachment table and attachment storage
|
|
|
|
log.Error("delete attachment[uuid: %s] failed: %v", uuid, err)
|
|
|
|
}
|
2019-09-24 08:55:07 +02:00
|
|
|
}
|
|
|
|
|
2021-03-22 17:09:51 +01:00
|
|
|
if !isCreated {
|
2020-07-29 21:20:54 +02:00
|
|
|
notification.NotifyUpdateRelease(doer, rel)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
if !rel.IsDraft {
|
|
|
|
notification.NotifyNewRelease(rel)
|
|
|
|
}
|
2019-09-15 17:28:25 +02:00
|
|
|
|
|
|
|
return err
|
|
|
|
}
|
2019-09-30 18:10:00 +02:00
|
|
|
|
|
|
|
// DeleteReleaseByID deletes a release and corresponding Git tag by given ID.
|
2022-01-20 00:26:57 +01:00
|
|
|
func DeleteReleaseByID(ctx context.Context, id int64, doer *user_model.User, delTag bool) error {
|
2022-08-25 04:31:57 +02:00
|
|
|
rel, err := repo_model.GetReleaseByID(ctx, id)
|
2019-09-30 18:10:00 +02:00
|
|
|
if err != nil {
|
|
|
|
return fmt.Errorf("GetReleaseByID: %v", err)
|
|
|
|
}
|
|
|
|
|
2022-06-03 08:13:58 +02:00
|
|
|
repo, err := repo_model.GetRepositoryByIDCtx(ctx, rel.RepoID)
|
2019-09-30 18:10:00 +02:00
|
|
|
if err != nil {
|
|
|
|
return fmt.Errorf("GetRepositoryByID: %v", err)
|
|
|
|
}
|
|
|
|
|
|
|
|
if delTag {
|
2022-06-16 22:03:03 +02:00
|
|
|
protectedTags, err := git_model.GetProtectedTags(rel.RepoID)
|
|
|
|
if err != nil {
|
|
|
|
return fmt.Errorf("GetProtectedTags: %v", err)
|
|
|
|
}
|
|
|
|
isAllowed, err := git_model.IsUserAllowedToControlTag(protectedTags, rel.TagName, rel.PublisherID)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
if !isAllowed {
|
|
|
|
return models.ErrProtectedTagName{
|
|
|
|
TagName: rel.TagName,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-09-04 12:47:56 +02:00
|
|
|
if stdout, _, err := git.NewCommand(ctx, "tag", "-d", "--", rel.TagName).
|
2019-11-30 15:40:22 +01:00
|
|
|
SetDescription(fmt.Sprintf("DeleteReleaseByID (git tag -d): %d", rel.ID)).
|
2022-04-01 04:55:30 +02:00
|
|
|
RunStdString(&git.RunOpts{Dir: repo.RepoPath()}); err != nil && !strings.Contains(err.Error(), "not found") {
|
2019-11-30 15:40:22 +01:00
|
|
|
log.Error("DeleteReleaseByID (git tag -d): %d in %v Failed:\nStdout: %s\nError: %v", rel.ID, repo, stdout, err)
|
|
|
|
return fmt.Errorf("git tag -d: %v", err)
|
2019-09-30 18:10:00 +02:00
|
|
|
}
|
|
|
|
|
2020-12-16 17:00:46 +01:00
|
|
|
notification.NotifyPushCommits(
|
|
|
|
doer, repo,
|
|
|
|
&repository.PushUpdateOptions{
|
|
|
|
RefFullName: git.TagPrefix + rel.TagName,
|
|
|
|
OldCommitID: rel.Sha1,
|
|
|
|
NewCommitID: git.EmptySHA,
|
|
|
|
}, repository.NewPushCommits())
|
|
|
|
notification.NotifyDeleteRef(doer, repo, "tag", git.TagPrefix+rel.TagName)
|
|
|
|
|
2022-08-25 04:31:57 +02:00
|
|
|
if err := repo_model.DeleteReleaseByID(id); err != nil {
|
2019-09-30 18:10:00 +02:00
|
|
|
return fmt.Errorf("DeleteReleaseByID: %v", err)
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
rel.IsTag = true
|
|
|
|
|
2022-08-25 04:31:57 +02:00
|
|
|
if err = repo_model.UpdateRelease(ctx, rel); err != nil {
|
2019-09-30 18:10:00 +02:00
|
|
|
return fmt.Errorf("Update: %v", err)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
rel.Repo = repo
|
|
|
|
if err = rel.LoadAttributes(); err != nil {
|
|
|
|
return fmt.Errorf("LoadAttributes: %v", err)
|
|
|
|
}
|
|
|
|
|
2021-11-19 14:39:57 +01:00
|
|
|
if err := repo_model.DeleteAttachmentsByRelease(rel.ID); err != nil {
|
2019-09-30 18:10:00 +02:00
|
|
|
return fmt.Errorf("DeleteAttachments: %v", err)
|
|
|
|
}
|
|
|
|
|
|
|
|
for i := range rel.Attachments {
|
|
|
|
attachment := rel.Attachments[i]
|
2020-08-18 06:23:45 +02:00
|
|
|
if err := storage.Attachments.Delete(attachment.RelativePath()); err != nil {
|
2019-09-30 18:10:00 +02:00
|
|
|
log.Error("Delete attachment %s of release %s failed: %v", attachment.UUID, rel.ID, err)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-11-06 09:25:50 +01:00
|
|
|
notification.NotifyDeleteRelease(doer, rel)
|
2019-09-30 18:10:00 +02:00
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|