mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-05-06 22:18:28 +00:00
support ~ in rootDir
This commit is contained in:
+3
-3
@@ -297,7 +297,7 @@ func (context *AptlyContext) _database() (database.Storage, error) {
|
||||
if len(context.config().DatabaseBackend.DbPath) == 0 {
|
||||
return nil, errors.New("leveldb databaseBackend config invalid")
|
||||
}
|
||||
dbPath := filepath.Join(context.config().RootDir, context.config().DatabaseBackend.DbPath)
|
||||
dbPath := filepath.Join(context.config().GetRootDir(), context.config().DatabaseBackend.DbPath)
|
||||
context.database, err = goleveldb.NewDB(dbPath)
|
||||
case "etcd":
|
||||
context.database, err = etcddb.NewDB(context.config().DatabaseBackend.URL)
|
||||
@@ -388,7 +388,7 @@ func (context *AptlyContext) PackagePool() aptly.PackagePool {
|
||||
} else {
|
||||
poolRoot := context.config().PackagePoolStorage.Local.Path
|
||||
if poolRoot == "" {
|
||||
poolRoot = filepath.Join(context.config().RootDir, "pool")
|
||||
poolRoot = filepath.Join(context.config().GetRootDir(), "pool")
|
||||
}
|
||||
|
||||
context.packagePool = files.NewPackagePool(poolRoot, !context.config().SkipLegacyPool)
|
||||
@@ -529,7 +529,7 @@ func (context *AptlyContext) GetVerifier() pgp.Verifier {
|
||||
|
||||
// SkelPath builds the local skeleton folder
|
||||
func (context *AptlyContext) SkelPath() string {
|
||||
return filepath.Join(context.config().RootDir, "skel")
|
||||
return filepath.Join(context.config().GetRootDir(), "skel")
|
||||
}
|
||||
|
||||
// UpdateFlags sets internal copy of flags in the context
|
||||
|
||||
@@ -21,7 +21,7 @@ func (s *ConfigSuite) TestLoadConfig(c *C) {
|
||||
|
||||
err := LoadConfig(configname, &s.config)
|
||||
c.Assert(err, IsNil)
|
||||
c.Check(s.config.RootDir, Equals, "/opt/aptly/")
|
||||
c.Check(s.config.GetRootDir(), Equals, "/opt/aptly/")
|
||||
c.Check(s.config.DownloadConcurrency, Equals, 33)
|
||||
c.Check(s.config.DatabaseOpenAttempts, Equals, 33)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user