Add support for dependency & architectures as common options.

This commit is contained in:
Andrey Smirnov
2014-01-12 23:55:58 +04:00
parent f9853de144
commit d684c87fd1
6 changed files with 50 additions and 35 deletions
+12 -4
View File
@@ -8,14 +8,22 @@ import (
// ConfigStructure is structure of main configuration
type ConfigStructure struct {
RootDir string `json:"rootDir"`
DownloadConcurrency int `json:"downloadConcurrency"`
RootDir string `json:"rootDir"`
DownloadConcurrency int `json:"downloadConcurrency"`
Architectures []string `json:"architectures"`
DepFollowSuggests bool `json:"dependencyFollowSuggests"`
DepFollowRecommends bool `json:"dependencyFollowRecommends"`
DepFollowAllVariants bool `json:"dependencyFollowAllVariants"`
}
// Config is configuration for aptly, shared by all modules
var Config = ConfigStructure{
RootDir: filepath.Join(os.Getenv("HOME"), ".aptly"),
DownloadConcurrency: 4,
RootDir: filepath.Join(os.Getenv("HOME"), ".aptly"),
DownloadConcurrency: 4,
Architectures: []string{},
DepFollowSuggests: false,
DepFollowRecommends: false,
DepFollowAllVariants: false,
}
// LoadConfig loads configuration from json file
+5 -1
View File
@@ -43,7 +43,11 @@ func (s *ConfigSuite) TestSaveConfig(c *C) {
c.Check(string(buf), Equals, ""+
"{\n"+
" \"rootDir\": \"/tmp/aptly\",\n"+
" \"downloadConcurrency\": 5\n"+
" \"downloadConcurrency\": 5,\n"+
" \"architectures\": null,\n"+
" \"dependencyFollowSuggests\": false,\n"+
" \"dependencyFollowRecommends\": false,\n"+
" \"dependencyFollowAllVariants\": false\n"+
"}")
}