[www-apps/gitea] sync with PR again

live ebuild omitted as im not interested in it
This commit is contained in:
Robert Förster 2019-11-23 12:38:53 +01:00
parent 6aaa44fde7
commit 1ab1b5a24c
2 changed files with 162 additions and 9 deletions

View File

@ -1,5 +1,8 @@
#Patch to make gitea logging less verbose.
diff --git a/modules/log/flags.go b/modules/log/flags.go
index 992fc62..5578a1b 100644
index 992fc62dd..5578a1b6b 100644
--- a/modules/log/flags.go
+++ b/modules/log/flags.go
@@ -31,7 +31,7 @@ const (
@ -11,3 +14,126 @@ index 992fc62..5578a1b 100644
)
var flagFromString = map[string]int{
#Just patching the tests to keep working with the patch above (avoid using LstdFlags)
diff --git a/modules/log/conn_test.go b/modules/log/conn_test.go
index cc3d758fa..295bee37f 100644
--- a/modules/log/conn_test.go
+++ b/modules/log/conn_test.go
@@ -40,7 +40,7 @@ func TestConnLogger(t *testing.T) {
prefix := "TestPrefix "
level := INFO
- flags := LstdFlags | LUTC | Lfuncname
+ flags := Ldate | Ltime | Lmedfile | Lshortfuncname | Llevelinitial | LUTC | Lfuncname
logger := NewConn()
connLogger := logger.(*ConnLogger)
@@ -112,7 +112,7 @@ func TestConnLoggerCloseBeforeSend(t *testing.T) {
prefix := "TestPrefix "
level := INFO
- flags := LstdFlags | LUTC | Lfuncname
+ flags := Ldate | Ltime | Lmedfile | Lshortfuncname | Llevelinitial | LUTC | Lfuncname
logger := NewConn()
@@ -126,7 +126,7 @@ func TestConnLoggerFailConnect(t *testing.T) {
prefix := "TestPrefix "
level := INFO
- flags := LstdFlags | LUTC | Lfuncname
+ flags := Ldate | Ltime | Lmedfile | Lshortfuncname | Llevelinitial | LUTC | Lfuncname
logger := NewConn()
@@ -169,7 +169,7 @@ func TestConnLoggerClose(t *testing.T) {
prefix := "TestPrefix "
level := INFO
- flags := LstdFlags | LUTC | Lfuncname
+ flags := Ldate | Ltime | Lmedfile | Lshortfuncname | Llevelinitial | LUTC | Lfuncname
logger := NewConn()
connLogger := logger.(*ConnLogger)
diff --git a/modules/log/console_test.go b/modules/log/console_test.go
index a028b5b87..e4fec760a 100644
--- a/modules/log/console_test.go
+++ b/modules/log/console_test.go
@@ -33,7 +33,7 @@ func TestConsoleLoggerMinimalConfig(t *testing.T) {
},
}
prefix := ""
- flags := LstdFlags
+ flags := LstdFlags
cw := NewConsoleLogger()
realCW := cw.(*ConsoleLogger)
@@ -64,7 +64,7 @@ func TestConsoleLogger(t *testing.T) {
}
prefix := "TestPrefix "
level := INFO
- flags := LstdFlags | LUTC | Lfuncname
+ flags := Ldate | Ltime | Lmedfile | Lshortfuncname | Llevelinitial | LUTC | Lfuncname
cw := NewConsoleLogger()
realCW := cw.(*ConsoleLogger)
diff --git a/modules/log/file_test.go b/modules/log/file_test.go
index 38279315a..dc8d291ed 100644
--- a/modules/log/file_test.go
+++ b/modules/log/file_test.go
@@ -24,7 +24,7 @@ func TestFileLoggerFails(t *testing.T) {
prefix := "TestPrefix "
level := INFO
- flags := LstdFlags | LUTC | Lfuncname
+ flags := Ldate | Ltime | Lmedfile | Lshortfuncname | Llevelinitial | LUTC | Lfuncname
//filename := filepath.Join(tmpDir, "test.log")
fileLogger := NewFileLogger()
@@ -52,7 +52,7 @@ func TestFileLogger(t *testing.T) {
prefix := "TestPrefix "
level := INFO
- flags := LstdFlags | LUTC | Lfuncname
+ flags := Ldate | Ltime | Lmedfile | Lshortfuncname | Llevelinitial | LUTC | Lfuncname
filename := filepath.Join(tmpDir, "test.log")
fileLogger := NewFileLogger()
@@ -155,7 +155,7 @@ func TestCompressFileLogger(t *testing.T) {
prefix := "TestPrefix "
level := INFO
- flags := LstdFlags | LUTC | Lfuncname
+ flags := Ldate | Ltime | Lmedfile | Lshortfuncname | Llevelinitial | LUTC | Lfuncname
filename := filepath.Join(tmpDir, "test.log")
fileLogger := NewFileLogger()
diff --git a/modules/log/smtp_test.go b/modules/log/smtp_test.go
index 216d55521..15075dd41 100644
--- a/modules/log/smtp_test.go
+++ b/modules/log/smtp_test.go
@@ -17,7 +17,7 @@ import (
func TestSMTPLogger(t *testing.T) {
prefix := "TestPrefix "
level := INFO
- flags := LstdFlags | LUTC | Lfuncname
+ flags := Ldate | Ltime | Lmedfile | Lshortfuncname | Llevelinitial | LUTC | Lfuncname
username := "testuser"
password := "testpassword"
host := "testhost"
diff --git a/modules/log/writer_test.go b/modules/log/writer_test.go
index 886dd58fb..df2f6e698 100644
--- a/modules/log/writer_test.go
+++ b/modules/log/writer_test.go
@@ -41,7 +41,7 @@ func TestBaseLogger(t *testing.T) {
b := WriterLogger{
out: c,
Level: INFO,
- Flags: LstdFlags | LUTC,
+ Flags: Ldate | Ltime | Lmedfile | Lshortfuncname | Llevelinitial | LUTC,
Prefix: prefix,
}
location, _ := time.LoadLocation("EST")

View File

@ -2,30 +2,42 @@
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit golang-vcs-snapshot tmpfiles systemd
if [[ ${PV} != 9999* ]] ; then
SCM="golang-vcs-snapshot"
else
SCM="git-r3"
fi
inherit golang-base tmpfiles systemd ${SCM}
unset SCM
MY_PV=${PV/_/-}
EGO_PN="code.gitea.io/gitea"
DESCRIPTION="A painless self-hosted Git service"
HOMEPAGE="https://gitea.io"
SRC_URI="https://github.com/go-gitea/gitea/archive/v${MY_PV}.tar.gz -> ${P}.tar.gz"
if [[ ${PV} != 9999* ]] ; then
SRC_URI="https://github.com/go-gitea/gitea/archive/v${MY_PV}.tar.gz -> ${P}.tar.gz"
KEYWORDS="~amd64 ~arm ~arm64"
else
EGIT_REPO_URI="https://github.com/go-gitea/gitea"
EGIT_CHECKOUT_DIR="${WORKDIR}/${P}/src/${EGO_PN}"
has test ${FEATURES} && EGIT_MIN_CLONE_TYPE="mirror"
fi
LICENSE="Apache-2.0 BSD BSD-2 ISC MIT MPL-2.0"
SLOT="0"
KEYWORDS="~amd64 ~arm ~arm64"
IUSE="+acct pam sqlite"
BDEPEND="dev-lang/go"
COMMON_DEPEND="
DEPEND="pam? ( sys-libs/pam )"
RDEPEND="${DEPEND}
acct? (
acct-group/git
acct-user/git[gitea]
)
pam? ( sys-libs/pam )"
DEPEND="${COMMON_DEPEND}"
RDEPEND="${COMMON_DEPEND}
dev-vcs/git"
DOCS=( custom/conf/app.ini.sample CONTRIBUTING.md README.md )
@ -40,10 +52,10 @@ gitea_make() {
$(usex sqlite 'sqlite sqlite_unlock_notify' '')
)
local my_makeopt=(
DRONE_TAG=${MY_PV}
TAGS="${my_tags[@]}"
LDFLAGS="-extldflags \"${LDFLAGS}\""
)
[[ ${PV} != 9999* ]] && my_makeopt+=("DRONE_TAG=${MY_PV}")
GOPATH=${WORKDIR}/${P}:$(get_golibdir_gopath) emake "${my_makeopt[@]}" "$@"
}
@ -76,6 +88,21 @@ src_compile() {
gitea_make build
}
src_test() {
if has network-sandbox ${FEATURES}; then
einfo "Remove tests which are known to fail with network-sandbox enabled."
rm -rf ./modules/migrations/github_test.go
fi
if [[ ${PV} != 9999* ]] ; then
einfo "Remove tests which depend on gitea git-repo."
rm -rf ./modules/git/blob_test.go
rm -rf ./modules/git/repo_test.go
fi
default
}
src_install() {
dobin gitea