aboutsummaryrefslogtreecommitdiffstats
path: root/routers/install.go
diff options
context:
space:
mode:
authorUnknown <joe2010xtmf@163.com>2014-03-30 10:47:08 -0400
committerUnknown <joe2010xtmf@163.com>2014-03-30 10:47:08 -0400
commita6e12aaef6344fff43745baa755c6afa11935550 (patch)
tree85d6320a9917cdb7efdea39b4b85cf1c36aa5b52 /routers/install.go
parent03cc39ea121e87febf4421d84e579770f635695c (diff)
downloadgitea-a6e12aaef6344fff43745baa755c6afa11935550.tar.gz
gitea-a6e12aaef6344fff43745baa755c6afa11935550.zip
Fixing bug
Diffstat (limited to 'routers/install.go')
-rw-r--r--routers/install.go20
1 files changed, 15 insertions, 5 deletions
diff --git a/routers/install.go b/routers/install.go
index 36bba3d41a..20e4241954 100644
--- a/routers/install.go
+++ b/routers/install.go
@@ -11,6 +11,7 @@ import (
"github.com/Unknwon/goconfig"
"github.com/codegangsta/martini"
+ // "github.com/lunny/xorm"
"github.com/gogits/gogs/models"
"github.com/gogits/gogs/modules/auth"
@@ -38,9 +39,14 @@ func GlobalInit() {
models.LoadModelsConfig()
models.LoadRepoConfig()
models.NewRepoContext()
- if err := models.NewEngine(); err != nil && base.InstallLock {
- log.Error("%v", err)
- os.Exit(2)
+
+ if base.InstallLock {
+ if err := models.NewEngine(); err != nil {
+ log.Error("%v", err)
+ os.Exit(2)
+ }
+
+ models.HasEngine = true
}
base.NewServices()
checkRunMode()
@@ -107,7 +113,11 @@ func Install(ctx *middleware.Context, form auth.InstallForm) {
models.DbCfg.SslMode = form.SslMode
models.DbCfg.Path = form.DatabasePath
- if err := models.NewEngine(); err != nil {
+ // ctx.RenderWithErr("Database setting is not correct: ", "install", &form)
+ // return
+ log.Trace("00000000000000000000000000000000000000000000")
+ var x *xorm.Engine
+ if err := models.NewTestEngine(x); err != nil {
if strings.Contains(err.Error(), `unknown driver "sqlite3"`) {
ctx.RenderWithErr("Your release version does not support SQLite3, please download the official binary version "+
"from https://github.com/gogits/gogs/wiki/Install-from-binary, NOT the gobuild version.", "install", &form)
@@ -158,7 +168,7 @@ func Install(ctx *middleware.Context, form auth.InstallForm) {
base.Cfg.SetValue("security", "INSTALL_LOCK", "true")
- if err := goconfig.SaveConfigFile(base.Cfg, "custom/conf/app.ini"); err != nil {
+ if err := goconfig.SaveConfigFile(base.Cfg, "custom/conf/app1.ini"); err != nil {
ctx.RenderWithErr("Fail to save configuration: "+err.Error(), "install", &form)
return
}