build-tool 0.5.7 → 0.6.0.rc1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +1 -0
- data/.rvmrc +1 -0
- data/.yardopts +1 -0
- data/Gemfile +5 -0
- data/Gemfile.lock +56 -0
- data/History.txt +64 -0
- data/README.txt +0 -7
- data/Rakefile +8 -56
- data/bin/build-tool +4 -1
- data/build-tool.gemspec +62 -0
- data/db/migrations/20110703074000_add_command_logs.rb +17 -0
- data/db/migrations/20110703075000_add_module_logs.rb +20 -0
- data/db/migrations/20110815170000_add_features.rb +17 -0
- data/db/migrations/20120103204700_add_modules.rb +17 -0
- data/db/migrations/20120106181200_add_settings.rb +18 -0
- data/lib/build-tool.rb +3 -4
- data/lib/build-tool/application.rb +127 -37
- data/lib/build-tool/build-system/autoconf.rb +2 -8
- data/lib/build-tool/build-system/base.rb +12 -4
- data/lib/build-tool/build-system/cmake.rb +2 -0
- data/lib/build-tool/build-system/custom.rb +2 -0
- data/lib/build-tool/build-system/kdel10n.rb +2 -0
- data/lib/build-tool/build-system/make.rb +2 -0
- data/lib/build-tool/build-system/none.rb +2 -0
- data/lib/build-tool/build-system/qmake.rb +2 -0
- data/lib/build-tool/build-system/qt.rb +4 -0
- data/lib/build-tool/cfg/lexer.rex +40 -8
- data/lib/build-tool/cfg/lexer_base.rb +3 -1
- data/lib/build-tool/cfg/node.rb +17 -1
- data/lib/build-tool/cfg/parser.y +92 -10
- data/lib/build-tool/cfg/visitor.rb +202 -78
- data/lib/build-tool/command_actions.rb +26 -10
- data/lib/build-tool/commands.rb +289 -197
- data/lib/build-tool/commands/build.rb +13 -9
- data/lib/build-tool/commands/configuration.rb +25 -0
- data/lib/build-tool/commands/configuration/edit.rb +42 -0
- data/lib/build-tool/commands/configuration/list.rb +48 -0
- data/lib/build-tool/commands/configure.rb +9 -5
- data/lib/build-tool/commands/ctags.rb +8 -3
- data/lib/build-tool/commands/environments.rb +2 -4
- data/lib/build-tool/commands/environments/list.rb +13 -10
- data/lib/build-tool/commands/environments/set.rb +5 -1
- data/lib/build-tool/commands/features.rb +24 -0
- data/lib/build-tool/commands/features/disable.rb +70 -0
- data/lib/build-tool/commands/features/enable.rb +66 -0
- data/lib/build-tool/commands/features/list.rb +92 -0
- data/lib/build-tool/commands/fetch.rb +9 -3
- data/lib/build-tool/commands/files.rb +9 -5
- data/lib/build-tool/commands/gc.rb +48 -15
- data/lib/build-tool/commands/history.rb +21 -16
- data/lib/build-tool/commands/info.rb +16 -13
- data/lib/build-tool/commands/install.rb +8 -4
- data/lib/build-tool/commands/modules.rb +2 -4
- data/lib/build-tool/commands/modules/cleanup.rb +52 -0
- data/lib/build-tool/commands/modules/disable.rb +95 -0
- data/lib/build-tool/commands/modules/enable.rb +52 -0
- data/lib/build-tool/commands/modules/info.rb +44 -35
- data/lib/build-tool/commands/modules/list.rb +67 -15
- data/lib/build-tool/commands/modules/shell.rb +8 -2
- data/lib/build-tool/commands/rebase.rb +15 -7
- data/lib/build-tool/commands/recipes.rb +2 -4
- data/lib/build-tool/commands/recipes/add.rb +16 -2
- data/lib/build-tool/commands/recipes/edit.rb +72 -0
- data/lib/build-tool/commands/recipes/incoming.rb +11 -7
- data/lib/build-tool/commands/recipes/info.rb +12 -8
- data/lib/build-tool/commands/recipes/install.rb +37 -42
- data/lib/build-tool/commands/recipes/list.rb +6 -2
- data/lib/build-tool/configuration.rb +88 -3
- data/lib/build-tool/environment.rb +2 -0
- data/lib/build-tool/errors.rb +5 -0
- data/lib/build-tool/history.rb +3 -181
- data/lib/build-tool/model/command_log.rb +93 -0
- data/lib/build-tool/model/feature.rb +80 -0
- data/lib/build-tool/{module.rb → model/module.rb} +110 -29
- data/lib/build-tool/model/module_log.rb +64 -0
- data/lib/build-tool/model/setting.rb +84 -0
- data/lib/build-tool/recipe.rb +40 -18
- data/lib/build-tool/repository.rb +39 -33
- data/lib/build-tool/server.rb +27 -3
- data/lib/build-tool/singleton.rb +2 -0
- data/lib/build-tool/sshkey.rb +2 -0
- data/lib/build-tool/state_helper.rb +64 -0
- data/lib/build-tool/vcs/archive.rb +3 -1
- data/lib/build-tool/vcs/base.rb +13 -0
- data/lib/build-tool/vcs/git-svn.rb +36 -14
- data/lib/build-tool/vcs/git.rb +180 -44
- data/lib/build-tool/vcs/mercurial.rb +25 -13
- data/lib/build-tool/vcs/svn.rb +20 -15
- data/lib/build-tool/version.rb +30 -0
- data/lib/mj/error.rb +2 -0
- data/lib/mj/logging.rb +2 -0
- data/lib/mj/mixins/inherited_attributes.rb +73 -0
- data/lib/mj/tools/editor.rb +34 -0
- data/lib/mj/tools/ssh.rb +2 -0
- data/lib/mj/tools/subprocess.rb +2 -1
- data/lib/mj/vcs/git.rb +14 -2
- data/lib/mj/visitor.rb +22 -0
- data/tasks/db.rake +36 -0
- data/tasks/racc.rake +14 -0
- data/tasks/rdoc.rake +8 -0
- data/tasks/rexical.rake +14 -0
- data/tasks/test.rake +21 -0
- data/test/integration/history_test.rb +88 -0
- data/test/integration/parser_configuration.rb +36 -0
- data/test/integration/parser_environment_parser.rb +156 -0
- data/test/integration/parser_feature_test.rb +75 -0
- data/test/integration/parser_git-svn_test.rb +92 -0
- data/test/integration/parser_git_test.rb +97 -0
- data/test/integration/parser_mercurial_test.rb +77 -0
- data/test/integration/parser_module_test.rb +103 -0
- data/test/integration/parser_svn_test.rb +92 -0
- data/test/integration/parser_test.rb +73 -0
- data/test/test_helper.rb +61 -0
- data/test/unit/configuration_test.rb +36 -0
- data/test/unit/git_configuration_test.rb +163 -0
- data/test/unit/git_svn_configuration_test.rb +240 -0
- data/test/unit/mercurial_configuration_test.rb +64 -0
- data/test/unit/model/command_log_test.rb +103 -0
- data/test/unit/model/feature_test.rb +29 -0
- data/test/unit/model/module_log_test.rb +70 -0
- data/test/unit/model/module_test.rb +32 -0
- data/test/unit/repository_test.rb +110 -0
- data/test/unit/server_test.rb +66 -0
- data/test/unit/svn_configuration_test.rb +90 -0
- metadata +134 -93
- data/Manifest.txt +0 -80
- data/db/migrations/001_command_histories.rb +0 -20
- data/db/migrations/002_module_events.rb +0 -24
- data/db/migrations/003_command_histories_add_logfile.rb +0 -19
- data/lib/build-tool/GUI.rb +0 -360
- data/lib/build-tool/commands/help.rb +0 -22
- data/lib/build-tool/commands/lsfeatures.rb +0 -76
- data/lib/build-tool/feature.rb +0 -47
@@ -1,3 +1,6 @@
|
|
1
|
+
# -*- coding: UTF-8 -*-
|
2
|
+
|
3
|
+
require 'mj/tools/subprocess'
|
1
4
|
require 'build-tool/commands'
|
2
5
|
|
3
6
|
module BuildTool; module Commands; module Modules
|
@@ -5,14 +8,17 @@ module BuildTool; module Commands; module Modules
|
|
5
8
|
#
|
6
9
|
# BuildCommand
|
7
10
|
#
|
8
|
-
class
|
11
|
+
class MyShell < Standard
|
9
12
|
|
10
13
|
include MJ::Tools::SubProcess
|
11
14
|
|
12
15
|
name "shell"
|
16
|
+
description "Open a shell with the environment for the given module."
|
13
17
|
|
14
18
|
def initialize_options
|
15
|
-
|
19
|
+
options.banner = "Usage: #{self.fullname} [OPTIONS]... MODULE"
|
20
|
+
options.separator( "" )
|
21
|
+
options.separator( "Options" )
|
16
22
|
super
|
17
23
|
end
|
18
24
|
|
@@ -1,3 +1,6 @@
|
|
1
|
+
# -*- coding: UTF-8 -*-
|
2
|
+
|
3
|
+
require 'mj/tools/subprocess'
|
1
4
|
require 'build-tool/application'
|
2
5
|
require 'build-tool/commands'
|
3
6
|
|
@@ -25,18 +28,26 @@ def applicable?
|
|
25
28
|
end
|
26
29
|
|
27
30
|
def initialize_options
|
28
|
-
|
31
|
+
options.banner = "Usage: #{self.fullname} [OPTIONS]... MODULES..."
|
32
|
+
options.separator( "" )
|
33
|
+
options.separator( "Options" )
|
34
|
+
|
35
|
+
@verbose_rebase = true
|
36
|
+
options.on( nil, "--[no]-verbose-rebase", "Show the changes applied by rebase." ) { |t|
|
37
|
+
@verbose_rebase = false
|
38
|
+
}
|
39
|
+
|
29
40
|
super
|
30
41
|
end
|
31
42
|
|
32
43
|
def is_module_ready?( mod )
|
33
44
|
isready = true
|
34
45
|
if !mod.checkedout?
|
35
|
-
|
46
|
+
info( "#{mod.name}: Skipping: Not checked out." )
|
36
47
|
else
|
37
48
|
isready &= mod.ready_for_rebase
|
38
49
|
if !mod.vcs.fetching_supported?
|
39
|
-
|
50
|
+
info( "#{mod.name}: Skipping: Rebasing not support by #{mod.vcs.name}" )
|
40
51
|
end
|
41
52
|
end
|
42
53
|
return isready
|
@@ -45,10 +56,7 @@ def is_module_ready?( mod )
|
|
45
56
|
|
46
57
|
def do_execute_module( mod )
|
47
58
|
if mod.checkedout? and mod.vcs.fetching_supported?
|
48
|
-
|
49
|
-
rebase( mod )
|
50
|
-
else
|
51
|
-
logger.info "Skipping: Not checked out."
|
59
|
+
rebase( mod, @verbose_rebase )
|
52
60
|
end
|
53
61
|
end
|
54
62
|
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# -*- coding: UTF-8 -*-
|
2
|
+
|
1
3
|
require 'build-tool/commands'
|
2
4
|
|
3
5
|
module BuildTool; module Commands;
|
@@ -14,10 +16,6 @@ def initialize_options
|
|
14
16
|
super
|
15
17
|
end
|
16
18
|
|
17
|
-
def do_execute
|
18
|
-
raise NotImplementedError
|
19
|
-
end
|
20
|
-
|
21
19
|
end # class CLI
|
22
20
|
|
23
21
|
end; end # module BuildTool::Commands::RecipesCLI
|
@@ -1,9 +1,13 @@
|
|
1
|
+
# -*- coding: UTF-8 -*-
|
2
|
+
|
1
3
|
require 'build-tool/commands'
|
2
4
|
require 'build-tool/recipe'
|
3
5
|
require 'mj/vcs/git'
|
4
6
|
|
5
7
|
module BuildTool; module Commands; module Recipes
|
6
8
|
|
9
|
+
class RecipeError < BuildTool::Error; end
|
10
|
+
|
7
11
|
#
|
8
12
|
# BuildCommand
|
9
13
|
#
|
@@ -14,7 +18,9 @@ class Add < Standard
|
|
14
18
|
long_description "Add a new recipe to build-tool from URL with NAME."
|
15
19
|
|
16
20
|
def initialize_options
|
17
|
-
|
21
|
+
options.banner = "Usage: #{self.fullname} [OPTIONS]... URL NAME"
|
22
|
+
options.separator( "" )
|
23
|
+
options.separator( "Options" )
|
18
24
|
super
|
19
25
|
end
|
20
26
|
|
@@ -25,13 +31,21 @@ def do_execute( args )
|
|
25
31
|
return usage( "To many arguments" )
|
26
32
|
end
|
27
33
|
|
34
|
+
if not MJ::VCS::Git.git_available?
|
35
|
+
raise RecipeError, 'Can\'t add recipe because git is not available'
|
36
|
+
end
|
37
|
+
|
28
38
|
path = BuildTool::Application::instance.local_configuration_dir.join( "recipes" )
|
29
39
|
if ! path.exist? && ! $noop
|
30
40
|
FileUtils.mkdir_p( path )
|
31
41
|
end
|
32
42
|
|
33
43
|
repo = MJ::VCS::Git::Repository.new(path.join(args[1]), $noop)
|
34
|
-
|
44
|
+
|
45
|
+
branch = 'build-tool-%s' % BuildTool::VERSION.recipe_version()
|
46
|
+
repo.clone(args[0], branch )
|
47
|
+
|
48
|
+
logger.info( "Cloned the recipe to #{path.join(args[1] )}" )
|
35
49
|
return 0
|
36
50
|
end
|
37
51
|
|
@@ -0,0 +1,72 @@
|
|
1
|
+
# -*- coding: UTF-8 -*-
|
2
|
+
|
3
|
+
require 'build-tool/commands'
|
4
|
+
require 'build-tool/recipe'
|
5
|
+
|
6
|
+
require 'fileutils'
|
7
|
+
|
8
|
+
module BuildTool; module Commands; module Recipes
|
9
|
+
|
10
|
+
#
|
11
|
+
# BuildCommand
|
12
|
+
#
|
13
|
+
class Edit < Standard
|
14
|
+
|
15
|
+
name "edit"
|
16
|
+
description "Edit the recipe."
|
17
|
+
long_description [
|
18
|
+
"Opens the recipe in a editor (or file browser). By default opens the override file.",
|
19
|
+
"The command uses xdg-open." ]
|
20
|
+
|
21
|
+
def applicable?
|
22
|
+
BuildTool::Application.instance.has_recipe?
|
23
|
+
end
|
24
|
+
|
25
|
+
def initialize_options
|
26
|
+
options.banner = "Usage: #{self.fullname} RECIPE [OPTIONS]... MODULE"
|
27
|
+
options.separator( "" )
|
28
|
+
options.separator( "Options" )
|
29
|
+
|
30
|
+
@global = false
|
31
|
+
options.on( "-g", "--global", "Open the recipe." ) { |t|
|
32
|
+
@global = t
|
33
|
+
}
|
34
|
+
@browser = false
|
35
|
+
options.on( "-b", "--browser", "Open a file browser." ) { |t|
|
36
|
+
@browser = t
|
37
|
+
}
|
38
|
+
super
|
39
|
+
end
|
40
|
+
|
41
|
+
def do_execute( args )
|
42
|
+
if ( args.length > 0 )
|
43
|
+
return usage( args.length == 0 ? "Not enough arguments" : "To many arguments" )
|
44
|
+
end
|
45
|
+
|
46
|
+
rec = BuildTool::Application::instance.recipe
|
47
|
+
|
48
|
+
if @global
|
49
|
+
if @browser
|
50
|
+
system( 'xdg-open %s' % [ rec.global_path ] )
|
51
|
+
else
|
52
|
+
system( 'xdg-open %s' % [ rec.global_config_file_path( 'recipe' ) ] )
|
53
|
+
end
|
54
|
+
else
|
55
|
+
if @browser
|
56
|
+
system( 'xdg-open %s' % [ rec.local_path() ] )
|
57
|
+
else
|
58
|
+
system( 'xdg-open %s' % [ rec.local_config_file_path( 'recipe' ) ] )
|
59
|
+
end
|
60
|
+
end
|
61
|
+
return 0
|
62
|
+
end
|
63
|
+
|
64
|
+
end # class
|
65
|
+
|
66
|
+
end; end # module Commands::Recipes
|
67
|
+
|
68
|
+
end; # module BuildTool
|
69
|
+
|
70
|
+
|
71
|
+
|
72
|
+
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# -*- coding: UTF-8 -*-
|
2
|
+
|
1
3
|
require 'build-tool/commands'
|
2
4
|
require 'build-tool/recipe'
|
3
5
|
require 'mj/vcs/git'
|
@@ -17,9 +19,10 @@ def applicable?
|
|
17
19
|
end
|
18
20
|
|
19
21
|
def initialize_options
|
20
|
-
|
22
|
+
options.banner = "Usage: #{self.fullname} [OPTIONS]..."
|
23
|
+
options.separator( "" )
|
24
|
+
options.separator( "Options" )
|
21
25
|
|
22
|
-
@options.separator "Options:"
|
23
26
|
@rebase = false
|
24
27
|
@fetch = false
|
25
28
|
options.on( "-f", "--[no-]fetch", "Fetch from origin." ) { |t|
|
@@ -38,19 +41,20 @@ def do_execute( args )
|
|
38
41
|
|
39
42
|
recipe = BuildTool::Application::instance.recipe
|
40
43
|
repo = MJ::VCS::Git::Repository.new(recipe.global_path, $noop)
|
44
|
+
branch = 'build-tool-%s' % BuildTool::VERSION.recipe_version()
|
41
45
|
|
42
46
|
if @fetch
|
43
|
-
|
47
|
+
info( "Fetching" )
|
44
48
|
repo.fetch("origin")
|
45
49
|
end
|
46
50
|
|
47
|
-
repo.log(
|
48
|
-
|
51
|
+
repo.log('HEAD..%s' % branch ).each do |line|
|
52
|
+
info( line )
|
49
53
|
end
|
50
54
|
|
51
55
|
if @rebase
|
52
|
-
|
53
|
-
repo.rebase(
|
56
|
+
info( "Rebasing" )
|
57
|
+
repo.rebase( branch, 'origin' )
|
54
58
|
end
|
55
59
|
return 0
|
56
60
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# -*- coding: UTF-8 -*-
|
2
|
+
|
1
3
|
require 'build-tool/commands'
|
2
4
|
require 'build-tool/recipe'
|
3
5
|
|
@@ -15,7 +17,9 @@ class Info < Standard
|
|
15
17
|
long_description [ "Show detailed information about RECIPE." ]
|
16
18
|
|
17
19
|
def initialize_options
|
18
|
-
|
20
|
+
options.banner = "Usage: #{self.fullname} RECIPE [OPTIONS]... MODULE"
|
21
|
+
options.separator( "" )
|
22
|
+
options.separator( "Options" )
|
19
23
|
super
|
20
24
|
end
|
21
25
|
|
@@ -25,14 +29,14 @@ def do_execute( args )
|
|
25
29
|
end
|
26
30
|
|
27
31
|
rec = Recipe.new( args[0] )
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
+
info( "Description: #{rec.short_description}" )
|
33
|
+
info( "Website: #{rec.website}" ) if rec.website
|
34
|
+
info( "Repository: #{rec.repository}" ) if rec.repository
|
35
|
+
info( "Browse Repository: #{rec.browse_repository}" ) if rec.browse_repository
|
32
36
|
if rec.long_description
|
33
|
-
|
34
|
-
|
35
|
-
|
37
|
+
info( "Long Description:" )
|
38
|
+
info( rec.long_description )
|
39
|
+
info( "" )
|
36
40
|
end
|
37
41
|
|
38
42
|
return 0
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# -*- coding: UTF-8 -*-
|
2
|
+
|
1
3
|
require 'build-tool/application'
|
2
4
|
require 'build-tool/commands'
|
3
5
|
require 'fileutils'
|
@@ -15,13 +17,15 @@ class Install < Standard
|
|
15
17
|
"installed as SCRIPTNAME-build instead of RECIPE-build" ]
|
16
18
|
|
17
19
|
def initialize_options
|
18
|
-
|
20
|
+
options.banner = "Usage: #{self.fullname} [OPTIONS]... RECIPE [SCRIPTNAME]"
|
21
|
+
options.separator( "" )
|
22
|
+
options.separator( "Options" )
|
19
23
|
super
|
20
24
|
end
|
21
25
|
|
22
26
|
def do_execute(args)
|
23
27
|
|
24
|
-
require '
|
28
|
+
require 'rubygems/user_interaction'
|
25
29
|
|
26
30
|
# Check parameters
|
27
31
|
if args.length < 1 or args.length > 2
|
@@ -40,16 +44,18 @@ def do_execute(args)
|
|
40
44
|
conffile = Application::instance.local_configuration_dir.join("#{commandname}.yaml")
|
41
45
|
|
42
46
|
# Our executable
|
43
|
-
buildtool = Application::instance.application_root.join(
|
47
|
+
buildtool = Application::instance.application_root.join(
|
48
|
+
'bin',
|
49
|
+
Pathname.new( $0 ).basename ).to_s
|
44
50
|
|
45
51
|
# Load the recipe
|
46
52
|
recipe = Recipe.find_recipe(recipename)
|
47
53
|
if !recipe
|
48
|
-
|
54
|
+
error( "Unknown recipe #{recipename}!" )
|
49
55
|
return -1
|
50
56
|
end
|
51
57
|
|
52
|
-
|
58
|
+
info( <<-EOS )
|
53
59
|
Step 1)
|
54
60
|
We need to add a symbolic link name '#{exename}' into $PATH.
|
55
61
|
EOS
|
@@ -62,24 +68,24 @@ def do_execute(args)
|
|
62
68
|
if exe.symlink? and File.identical? exe, buildtool
|
63
69
|
found = true
|
64
70
|
else
|
65
|
-
|
71
|
+
warn( "Found another command named #{exename} at #{exe.to_s}" )
|
66
72
|
end
|
67
73
|
end
|
68
74
|
end
|
69
75
|
|
70
76
|
if found == true
|
71
|
-
|
77
|
+
info( "The symlink already exists. We will skip this step." )
|
72
78
|
else
|
73
79
|
dirs = find_writable_dirs( ENV['PATH'] )
|
74
80
|
dir = nil
|
75
81
|
if dirs.empty?
|
76
|
-
|
77
|
-
|
78
|
-
|
82
|
+
error( "No writable directory found in $PATH. Please add one (usually $HOME/bin)" )
|
83
|
+
error( "or create a symbolic link in a directory that is part of $PATH yourself." )
|
84
|
+
error( "> ln -s #{buildtool} #{exename}" )
|
79
85
|
elsif dirs.length == 1
|
80
86
|
dir = dirs[0]
|
81
|
-
|
82
|
-
|
87
|
+
info( "Exactly one writeable directory found in $PATH. I will create the symbolic link in" )
|
88
|
+
info( "#{dir}" )
|
83
89
|
else
|
84
90
|
if dirs.length > 1
|
85
91
|
( dir, index ) = Gem::DefaultUserInteraction.ui.choose_from_list(
|
@@ -88,46 +94,35 @@ def do_execute(args)
|
|
88
94
|
end
|
89
95
|
link = Pathname.new(dir).join(exename)
|
90
96
|
if link.exist?
|
91
|
-
|
92
|
-
|
93
|
-
|
97
|
+
error( "I can not create the link because the 'to' already exists. Please create" )
|
98
|
+
error( "a symbolic link in a directory that is part of $PATH yourself." )
|
99
|
+
error( "> ln -s #{buildtool} #{exename}" )
|
94
100
|
else
|
95
101
|
File.symlink(buildtool, Pathname.new(dir).join(exename))
|
96
102
|
end
|
97
103
|
end
|
98
104
|
|
99
105
|
# Now write the settings file
|
100
|
-
|
106
|
+
info( <<EOS )
|
101
107
|
|
102
108
|
Step 2)
|
103
|
-
|
104
|
-
|
105
|
-
|
109
|
+
A example configuration is imported into the database. I will open a editor so you are able to
|
110
|
+
adjust it to your needs. The configuration contains comments. Please review them carefully. At
|
111
|
+
least look at LIB_SUFFIX and MAKEFLAGS.
|
112
|
+
EOS
|
106
113
|
|
107
|
-
|
108
|
-
|
109
|
-
|
114
|
+
# Now switch to the correct database
|
115
|
+
BuildTool::Application::instance.close_database()
|
116
|
+
BuildTool::Application::instance.open_database( commandname )
|
110
117
|
|
111
|
-
|
112
|
-
|
113
|
-
|
118
|
+
# Add the recipe setting to the database. Needed to load the configuration and
|
119
|
+
# initialize the database.
|
120
|
+
rs = BuildTool::Setting.new( :name => 'BUILD_TOOL.RECIPE', :value => recipename )
|
121
|
+
rs.save!
|
114
122
|
|
115
|
-
|
116
|
-
EOS
|
117
|
-
if conffile.exist?
|
118
|
-
say "The config file already exists. I will not copy the file."
|
119
|
-
else
|
120
|
-
from = File.new(recipe.join("settings.yaml"), "r")
|
121
|
-
to = File.new(conffile, "w")
|
122
|
-
to.write("RECIPE: #{recipename}\n\n")
|
123
|
-
from.each_line do |line|
|
124
|
-
to.write line
|
125
|
-
end
|
126
|
-
to.close
|
127
|
-
from.close
|
128
|
-
end
|
123
|
+
BuildTool::Configuration.edit()
|
129
124
|
|
130
|
-
|
125
|
+
info( <<EOS )
|
131
126
|
|
132
127
|
Step 3)
|
133
128
|
I will create a local configuration file that is used to override the used
|
@@ -135,14 +130,14 @@ def do_execute(args)
|
|
135
130
|
> #{Application::instance.local_configuration_dir.join( commandname, 'recipe' )}
|
136
131
|
EOS
|
137
132
|
if File.exist?( Application::instance.local_configuration_dir.join(commandname))
|
138
|
-
|
133
|
+
error( "Local configuration for #{commandname} already exists." )
|
139
134
|
else
|
140
135
|
FileUtils.mkdir_p( Application::instance.local_configuration_dir.join( commandname ) )
|
141
136
|
FileUtils.cp(recipe.join("recipe-local"),
|
142
137
|
Application::instance.local_configuration_dir.join( commandname, 'recipe' ))
|
143
138
|
end
|
144
139
|
|
145
|
-
|
140
|
+
info( <<EOS )
|
146
141
|
|
147
142
|
Step 4)
|
148
143
|
You now can start to use your recipe. The first commands you should look for are:
|