diff options
-rw-r--r-- | www-apps/gitea/Manifest | 2 | ||||
-rw-r--r-- | www-apps/gitea/files/gitea-1.22.0-fix-missing-memcache-import.diff | 18 | ||||
-rw-r--r-- | www-apps/gitea/files/gitea-1.22.0-go-chi-memcache-package.diff | 121 | ||||
-rw-r--r-- | www-apps/gitea/files/gitea-1.22.0-ignore-findrecentlypushednewbranches-err.diff | 20 | ||||
-rw-r--r-- | www-apps/gitea/gitea-1.22.1.ebuild (renamed from www-apps/gitea/gitea-1.22.0.ebuild) | 8 |
5 files changed, 1 insertions, 168 deletions
diff --git a/www-apps/gitea/Manifest b/www-apps/gitea/Manifest index 81b1ecd7eb69..44cac977145e 100644 --- a/www-apps/gitea/Manifest +++ b/www-apps/gitea/Manifest @@ -1,2 +1,2 @@ DIST gitea-1.21.11.tar.gz 54029294 BLAKE2B 93fb0ea4118baefeb36283b7168759d318fede528b56a9167961763267181bb283bf9849ce5f57a9950b16047f3b98998b4cd0e92443a23aef4cf15589cc8628 SHA512 ba35d1710bc03ff05bf2490e233bf3b4bd9e002113885b4d2a3193288773c16ad0f2426d4ed64d26b7c49112a02838e67da32167f51c4c08fa4f23738bd78285 -DIST gitea-1.22.0.tar.gz 54603268 BLAKE2B f021fedf77ec6ab41221a8e73d6b48fc215c15053bb62ff288a5dc6a7d11a5acd4d7ee0cbfb40aee2b60011d83fc57f1011013b7d78556c3a84a2743ba90389b SHA512 8e9585d6224f49c2f21b855911c2ac4ded64b8b31c4eb28fbe39801908693a87aad2e9096bf812c30163faa8a8102fd01ec3240bd64debf5633c70568aec4b49 +DIST gitea-1.22.1.tar.gz 54686177 BLAKE2B 78f25cb6cc024b05f9a51eb9692b2eab97b20d28aad7ed56894b31a5e9ea3ed1be00e1ba75abb75b36cbdfc740507321ff036927bb842ade7cc43c90befe027b SHA512 318513a2aaae8d99358a26d44ab51c7a002b74fb11dbd7f9dfdccdd25f707572b075099e59bc3764564e1219069a1f9e6b56c71474ef494531c73e358d76ac6e diff --git a/www-apps/gitea/files/gitea-1.22.0-fix-missing-memcache-import.diff b/www-apps/gitea/files/gitea-1.22.0-fix-missing-memcache-import.diff deleted file mode 100644 index 1ad5d50bf047..000000000000 --- a/www-apps/gitea/files/gitea-1.22.0-fix-missing-memcache-import.diff +++ /dev/null @@ -1,18 +0,0 @@ -https://github.com/go-gitea/gitea/issues/31102 -https://github.com/go-gitea/gitea/pull/31105 - -Fix missing memcache import - -diff --git a/modules/cache/cache.go b/modules/cache/cache.go -index 2ca77bdb29f3..075367115803 100644 ---- a/modules/cache/cache.go -+++ b/modules/cache/cache.go -@@ -8,6 +8,8 @@ import ( - "time" - - "code.gitea.io/gitea/modules/setting" -+ -+ _ "gitea.com/go-chi/cache/memcache" //nolint:depguard // memcache plugin for cache, it is required for config "ADAPTER=memcache" - ) - - var defaultCache StringCache diff --git a/www-apps/gitea/files/gitea-1.22.0-go-chi-memcache-package.diff b/www-apps/gitea/files/gitea-1.22.0-go-chi-memcache-package.diff deleted file mode 100644 index f3ebbe6fc73f..000000000000 --- a/www-apps/gitea/files/gitea-1.22.0-go-chi-memcache-package.diff +++ /dev/null @@ -1,121 +0,0 @@ -https://github.com/go-gitea/gitea/issues/31102 -https://github.com/go-gitea/gitea/pull/31105 - -add the missing memcache package in the vendor dir, -binding to patch ./gitea-1.22.0-fix-missing-memcache-import.diff - -diff --git a/vendor/gitea.com/go-chi/cache/memcache/memcache.go b/vendor/gitea.com/go-chi/cache/memcache/memcache.go -new file mode 100644 -index 00000000..7c7cd225 ---- /dev/null -+++ b/vendor/gitea.com/go-chi/cache/memcache/memcache.go -@@ -0,0 +1,97 @@ -+// Copyright 2013 Beego Authors -+// Copyright 2014 The Macaron Authors -+// -+// Licensed under the Apache License, Version 2.0 (the "License"): you may -+// not use this file except in compliance with the License. You may obtain -+// a copy of the License at -+// -+// http://www.apache.org/licenses/LICENSE-2.0 -+// -+// Unless required by applicable law or agreed to in writing, software -+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -+// License for the specific language governing permissions and limitations -+// under the License. -+ -+package cache -+ -+import ( -+ "strings" -+ -+ "github.com/bradfitz/gomemcache/memcache" -+ "github.com/unknwon/com" -+ -+ "gitea.com/go-chi/cache" -+) -+ -+// MemcacheCacher represents a memcache cache adapter implementation. -+type MemcacheCacher struct { -+ c *memcache.Client -+} -+ -+func NewItem(key string, data []byte, expire int32) *memcache.Item { -+ return &memcache.Item{ -+ Key: key, -+ Value: data, -+ Expiration: expire, -+ } -+} -+ -+// Put puts value into cache with key and expire time. -+// If expired is 0, it lives forever. -+func (c *MemcacheCacher) Put(key string, val interface{}, expire int64) error { -+ return c.c.Set(NewItem(key, []byte(com.ToStr(val)), int32(expire))) -+} -+ -+// Get gets cached value by given key. -+func (c *MemcacheCacher) Get(key string) interface{} { -+ item, err := c.c.Get(key) -+ if err != nil { -+ return nil -+ } -+ return string(item.Value) -+} -+ -+// Delete deletes cached value by given key. -+func (c *MemcacheCacher) Delete(key string) error { -+ return c.c.Delete(key) -+} -+ -+// Incr increases cached int-type value by given key as a counter. -+func (c *MemcacheCacher) Incr(key string) error { -+ _, err := c.c.Increment(key, 1) -+ return err -+} -+ -+// Decr decreases cached int-type value by given key as a counter. -+func (c *MemcacheCacher) Decr(key string) error { -+ _, err := c.c.Decrement(key, 1) -+ return err -+} -+ -+// IsExist returns true if cached value exists. -+func (c *MemcacheCacher) IsExist(key string) bool { -+ _, err := c.c.Get(key) -+ return err == nil -+} -+ -+// Flush deletes all cached data. -+func (c *MemcacheCacher) Flush() error { -+ return c.c.FlushAll() -+} -+ -+// StartAndGC starts GC routine based on config string settings. -+// AdapterConfig: 127.0.0.1:9090;127.0.0.1:9091 -+func (c *MemcacheCacher) StartAndGC(opt cache.Options) error { -+ c.c = memcache.New(strings.Split(opt.AdapterConfig, ";")...) -+ return nil -+} -+ -+// Ping tests if the cache is alive. -+func (c *MemcacheCacher) Ping() error { -+ return cache.GenericPing(c) -+} -+ -+func init() { -+ cache.Register("memcache", &MemcacheCacher{}) -+} -diff --git a/vendor/modules.txt b/vendor/modules.txt -index 144a505d..6cb3f48b 100644 ---- a/vendor/modules.txt -+++ b/vendor/modules.txt -@@ -40,6 +40,7 @@ gitea.com/go-chi/binding - # gitea.com/go-chi/cache v0.2.0 - ## explicit; go 1.11 - gitea.com/go-chi/cache -+gitea.com/go-chi/cache/memcache - # gitea.com/go-chi/captcha v0.0.0-20240315150714-fb487f629098 - ## explicit; go 1.21 - gitea.com/go-chi/captcha diff --git a/www-apps/gitea/files/gitea-1.22.0-ignore-findrecentlypushednewbranches-err.diff b/www-apps/gitea/files/gitea-1.22.0-ignore-findrecentlypushednewbranches-err.diff deleted file mode 100644 index 78459f6e3359..000000000000 --- a/www-apps/gitea/files/gitea-1.22.0-ignore-findrecentlypushednewbranches-err.diff +++ /dev/null @@ -1,20 +0,0 @@ -https://github.com/go-gitea/gitea/issues/31163 -https://github.com/go-gitea/gitea/pull/31164 - -A quick fix to workaround 500 error: -FindRecentlyPushedNewBranches, branch does not exist [repo_id: 64 name: main] - -diff --git a/routers/web/repo/view.go b/routers/web/repo/view.go -index e1498c0d581e..386ef7be5ce8 100644 ---- a/routers/web/repo/view.go -+++ b/routers/web/repo/view.go -@@ -1047,8 +1047,7 @@ func renderHomeCode(ctx *context.Context) { - baseRepoPerm.CanRead(unit_model.TypePullRequests) { - ctx.Data["RecentlyPushedNewBranches"], err = git_model.FindRecentlyPushedNewBranches(ctx, ctx.Doer, opts) - if err != nil { -- ctx.ServerError("FindRecentlyPushedNewBranches", err) -- return -+ log.Error("FindRecentlyPushedNewBranches failed: %v", err) - } - } - } diff --git a/www-apps/gitea/gitea-1.22.0.ebuild b/www-apps/gitea/gitea-1.22.1.ebuild index dec2601480a6..dd49814314cb 100644 --- a/www-apps/gitea/gitea-1.22.0.ebuild +++ b/www-apps/gitea/gitea-1.22.1.ebuild @@ -33,14 +33,6 @@ FILECAPS=( RESTRICT="test" -# The problems that can be fixed by the following patches has been fixed -# upstream, so these ALL patches should be removed in the next release. -PATCHES=( - "${FILESDIR}/${P}-go-chi-memcache-package.diff" - "${FILESDIR}/${P}-fix-missing-memcache-import.diff" - "${FILESDIR}/${P}-ignore-findrecentlypushednewbranches-err.diff" -) - src_prepare() { default |