build-tool 0.5.5 → 0.5.6
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/History.txt +5 -1
- data/lib/build-tool.rb +1 -1
- data/lib/build-tool/build-system/base.rb +21 -0
- data/lib/build-tool/build-system/none.rb +5 -0
- data/lib/build-tool/cfg/visitor.rb +10 -4
- data/lib/build-tool/commands.rb +1 -1
- data/lib/build-tool/commands/fetch.rb +1 -1
- data/lib/build-tool/commands/files.rb +6 -5
- data/lib/build-tool/configuration.rb +5 -1
- data/lib/build-tool/module.rb +11 -12
- data/lib/build-tool/vcs/git-svn.rb +18 -1
- data/lib/build-tool/vcs/git.rb +21 -0
- data/lib/build-tool/vcs/svn.rb +22 -0
- metadata +25 -25
data/History.txt
CHANGED
data/lib/build-tool.rb
CHANGED
@@ -154,6 +154,27 @@ def prepend( var, value )
|
|
154
154
|
end
|
155
155
|
end
|
156
156
|
|
157
|
+
# This method checks if the build-system is prepared for installation. Do not check if the
|
158
|
+
# module is configured, this will be done by Module. Only check stuff that is outside of
|
159
|
+
# the scope of build-tool.
|
160
|
+
def prepare_for_installation
|
161
|
+
return check_install_prefix
|
162
|
+
end
|
163
|
+
|
164
|
+
# Check that the installation prefix exists and is writable
|
165
|
+
def check_install_prefix
|
166
|
+
prefix = @module.install_prefix_required
|
167
|
+
if !prefix.exist? or !prefix.writable?
|
168
|
+
begin
|
169
|
+
FileUtils.mkdir_p prefix.to_s
|
170
|
+
rescue Errno::EACCES => e
|
171
|
+
logger.error "#{name}: The directory #{prefix.to_s} is not writable! Installation will fail!"
|
172
|
+
return false
|
173
|
+
end
|
174
|
+
end
|
175
|
+
return true
|
176
|
+
end
|
177
|
+
|
157
178
|
def install_prefix
|
158
179
|
return @module.install_prefix_required if @module
|
159
180
|
raise ConfigurationError, "No module set for build-system"
|
@@ -37,6 +37,11 @@ def reconfigure()
|
|
37
37
|
0
|
38
38
|
end
|
39
39
|
|
40
|
+
# We have no buildsystem so we need no install prefix
|
41
|
+
def check_install_prefix
|
42
|
+
true
|
43
|
+
end
|
44
|
+
|
40
45
|
# Execute a cmake command in the context of the build directory
|
41
46
|
def cmake( command, wd = build_directory )
|
42
47
|
0
|
@@ -344,13 +344,19 @@ def visit_GitRemoteUrlNode( node )
|
|
344
344
|
end
|
345
345
|
|
346
346
|
def visit_GitRemotePushNode( node )
|
347
|
-
|
348
|
-
|
349
|
-
|
347
|
+
if node.values.length == 2
|
348
|
+
@remote.push_server = configuration.server( node.values[0] )
|
349
|
+
if @remote.push_server.nil?
|
350
|
+
raise ConfigurationError, "Unknown server #{node.values[0]} configured."
|
351
|
+
end
|
352
|
+
@remote.push_path = node.values[1]
|
353
|
+
else
|
354
|
+
@remote.push_server = BuildTool::Server.new( "unnamed" )
|
355
|
+
@remote.push_server.host = node.values[0]
|
350
356
|
end
|
351
|
-
@remote.push_path = node.values[1]
|
352
357
|
end
|
353
358
|
|
359
|
+
|
354
360
|
end # class GitRemoteDeclarationNodeVisitor
|
355
361
|
|
356
362
|
|
data/lib/build-tool/commands.rb
CHANGED
@@ -418,7 +418,7 @@ def complete_modules( name, include_templates = false )
|
|
418
418
|
|
419
419
|
# Raise an error if the result should be unique but is not.
|
420
420
|
if should_be_unique and res.size > 1
|
421
|
-
raise UsageError, "#{name} is
|
421
|
+
raise UsageError, "#{name} is ambiguous (#{res.map { |m| m.name }.join( ', ' ) })."
|
422
422
|
end
|
423
423
|
|
424
424
|
# Give a warning if all modules where
|
@@ -34,7 +34,7 @@ def initialize_options
|
|
34
34
|
def is_module_ready?( mod )
|
35
35
|
isready = true
|
36
36
|
isready &= mod.ready_for_fetch
|
37
|
-
if !mod.vcs.fetching_supported?
|
37
|
+
if isready && !mod.vcs.fetching_supported?
|
38
38
|
logger.warn "#{mod.name}: fetching not supported by #{mod.vcs.name} -> implicit rebase."
|
39
39
|
end
|
40
40
|
return isready
|
@@ -41,10 +41,10 @@ def print_file_list
|
|
41
41
|
recipe = Application::instance.recipe
|
42
42
|
files_dir = recipe.files_path
|
43
43
|
if !files_dir.exist?
|
44
|
-
|
44
|
+
logger.error "No files supplied with this recipe"
|
45
45
|
return 0
|
46
46
|
end
|
47
|
-
Dir.new(files_dir).each do |entry|
|
47
|
+
Dir.new(files_dir).sort.each do |entry|
|
48
48
|
next if entry == "."
|
49
49
|
next if entry == ".."
|
50
50
|
say entry
|
@@ -56,12 +56,13 @@ def print_file( filename )
|
|
56
56
|
recipe = Application::instance.recipe
|
57
57
|
files_dir = recipe.files_path
|
58
58
|
if !files_dir.exist?
|
59
|
-
|
59
|
+
logger.error "No files supplied with this recipe"
|
60
60
|
return 0
|
61
61
|
end
|
62
62
|
file = files_dir.join( filename )
|
63
|
-
if !
|
64
|
-
|
63
|
+
if !file.exist?
|
64
|
+
logger.error "File '#{filename}' not found! Found those:"
|
65
|
+
print_file_list
|
65
66
|
return -1
|
66
67
|
end
|
67
68
|
|
@@ -28,7 +28,11 @@ def log_directory
|
|
28
28
|
raise BuildTool::ConfigurationError, "No log directory configured"
|
29
29
|
end
|
30
30
|
def log_directory=( path )
|
31
|
-
|
31
|
+
path = Pathname.new( path.sub( /\$HOME/, '~' ) )
|
32
|
+
if path.to_s[0] != '~' and path.relative?
|
33
|
+
raise ConfigurationError, "Log directory '#{path}' is relative!"
|
34
|
+
end
|
35
|
+
@log_directory = path.expand_path
|
32
36
|
end
|
33
37
|
|
34
38
|
def environment( name )
|
data/lib/build-tool/module.rb
CHANGED
@@ -60,7 +60,11 @@ def build_directory
|
|
60
60
|
|
61
61
|
def build_prefix=( path )
|
62
62
|
if path
|
63
|
-
|
63
|
+
path = Pathname.new( path.sub( /\$HOME/, '~' ) )
|
64
|
+
if path.to_s[0] != '~' and path.relative?
|
65
|
+
raise ConfigurationError, "Build-prefix '#{path}' is relative!"
|
66
|
+
end
|
67
|
+
@build_prefix = path.expand_path
|
64
68
|
else
|
65
69
|
@build_prefix = nil
|
66
70
|
end
|
@@ -151,7 +155,11 @@ def gc
|
|
151
155
|
# Installation prefix
|
152
156
|
def install_prefix=( path )
|
153
157
|
if path
|
154
|
-
|
158
|
+
path = Pathname.new( path.sub( /\$HOME/, '~' ) )
|
159
|
+
if path.to_s[0] != '~' and path.relative?
|
160
|
+
raise ConfigurationError, "Install-prefix '#{path}' is relative!"
|
161
|
+
end
|
162
|
+
@install_prefix = path.expand_path
|
155
163
|
else
|
156
164
|
@install_prefix = nil
|
157
165
|
end
|
@@ -345,16 +353,7 @@ def ready_for_rebase
|
|
345
353
|
|
346
354
|
|
347
355
|
def prepare_for_installation
|
348
|
-
|
349
|
-
if !prefix.exist? or !prefix.writable?
|
350
|
-
begin
|
351
|
-
FileUtils.mkdir_p prefix.to_s
|
352
|
-
rescue Errno::EACCES => e
|
353
|
-
logger.error "#{name}: The directory #{prefix.to_s} is not writable! Installation will fail!"
|
354
|
-
return false
|
355
|
-
end
|
356
|
-
end
|
357
|
-
return true
|
356
|
+
return build_system_required.prepare_for_installation
|
358
357
|
end
|
359
358
|
|
360
359
|
def to_s
|
@@ -64,6 +64,20 @@ def initialize( *args )
|
|
64
64
|
super( *args )
|
65
65
|
end
|
66
66
|
|
67
|
+
class << self
|
68
|
+
|
69
|
+
git_svn_available = nil
|
70
|
+
|
71
|
+
# Is the git executable available?
|
72
|
+
def git_svn_available
|
73
|
+
return @git_svn_available unless @git_svn_available.nil?
|
74
|
+
%x( git svn --help 2>&1 )
|
75
|
+
@git_svn_available = $?.success?
|
76
|
+
return @git_svn_available
|
77
|
+
end
|
78
|
+
|
79
|
+
end
|
80
|
+
|
67
81
|
#
|
68
82
|
### ATTRIBUTES
|
69
83
|
#
|
@@ -150,7 +164,10 @@ def rebase
|
|
150
164
|
end
|
151
165
|
|
152
166
|
def ready_for_fetch
|
153
|
-
|
167
|
+
if not GitSvn.git_svn_available
|
168
|
+
logger.info( "#{config.module.name}: Calling `git svn` failed!" )
|
169
|
+
end
|
170
|
+
return GitSvn.git_svn_available && git.ready_for_fetch
|
154
171
|
end
|
155
172
|
|
156
173
|
def ready_for_rebase
|
data/lib/build-tool/vcs/git.rb
CHANGED
@@ -140,6 +140,20 @@ def initialize( config )
|
|
140
140
|
@vcs = nil
|
141
141
|
end
|
142
142
|
|
143
|
+
class << self
|
144
|
+
|
145
|
+
git_available = nil
|
146
|
+
|
147
|
+
# Is the git executable available?
|
148
|
+
def git_available
|
149
|
+
return @git_available unless @git_available.nil?
|
150
|
+
%x( git --version 2>&1 )
|
151
|
+
@git_available = $?.success?
|
152
|
+
return @git_available
|
153
|
+
end
|
154
|
+
|
155
|
+
end
|
156
|
+
|
143
157
|
#
|
144
158
|
### ATTRIBUTES
|
145
159
|
#
|
@@ -261,6 +275,13 @@ def ready_for_access
|
|
261
275
|
end
|
262
276
|
end
|
263
277
|
|
278
|
+
def ready_for_fetch
|
279
|
+
if not Git.git_available
|
280
|
+
logger.info( "#{config.module.name}: Calling `git` failed!" )
|
281
|
+
end
|
282
|
+
return Git.git_available
|
283
|
+
end
|
284
|
+
|
264
285
|
# Check if the module is ready for a rebase.
|
265
286
|
def ready_for_rebase
|
266
287
|
|
data/lib/build-tool/vcs/svn.rb
CHANGED
@@ -61,6 +61,21 @@ class SvnError < BuildTool::Error; end
|
|
61
61
|
# super( *args )
|
62
62
|
# end
|
63
63
|
|
64
|
+
class << self
|
65
|
+
|
66
|
+
svn_available = nil
|
67
|
+
|
68
|
+
# Is the git executable available?
|
69
|
+
def svn_available
|
70
|
+
return @svn_available unless @svn_available.nil?
|
71
|
+
%x( svn --version 2>&1 )
|
72
|
+
@svn_available = $?.success?
|
73
|
+
return @svn_available
|
74
|
+
end
|
75
|
+
|
76
|
+
end
|
77
|
+
|
78
|
+
|
64
79
|
#
|
65
80
|
### ATTRIBUTES
|
66
81
|
#
|
@@ -107,6 +122,13 @@ def clone
|
|
107
122
|
end
|
108
123
|
end
|
109
124
|
|
125
|
+
def ready_for_fetch
|
126
|
+
if not Svn.svn_available
|
127
|
+
logger.info( "#{config.module.name}: Calling `svn` failed!" )
|
128
|
+
end
|
129
|
+
return Svn.svn_available
|
130
|
+
end
|
131
|
+
|
110
132
|
def fetch()
|
111
133
|
if !checkedout?
|
112
134
|
clone
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: build-tool
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2012-01-04 00:00:00.000000000Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: logging
|
16
|
-
requirement: &
|
16
|
+
requirement: &6487260 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 1.4.3
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *6487260
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: sequel
|
27
|
-
requirement: &
|
27
|
+
requirement: &6486640 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 3.18.0
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *6486640
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: sqlite3
|
38
|
-
requirement: &
|
38
|
+
requirement: &6486000 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: 1.3.3
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *6486000
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: ansi
|
49
|
-
requirement: &
|
49
|
+
requirement: &6485380 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: 1.2.2
|
55
55
|
type: :runtime
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *6485380
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: grit
|
60
|
-
requirement: &
|
60
|
+
requirement: &6484800 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: 2.4.1
|
66
66
|
type: :runtime
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *6484800
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: racc
|
71
|
-
requirement: &
|
71
|
+
requirement: &6484300 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ~>
|
@@ -76,10 +76,10 @@ dependencies:
|
|
76
76
|
version: 1.4.7
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *6484300
|
80
80
|
- !ruby/object:Gem::Dependency
|
81
81
|
name: hoe-debugging
|
82
|
-
requirement: &
|
82
|
+
requirement: &6483680 !ruby/object:Gem::Requirement
|
83
83
|
none: false
|
84
84
|
requirements:
|
85
85
|
- - ! '>='
|
@@ -87,10 +87,10 @@ dependencies:
|
|
87
87
|
version: 1.0.1
|
88
88
|
type: :development
|
89
89
|
prerelease: false
|
90
|
-
version_requirements: *
|
90
|
+
version_requirements: *6483680
|
91
91
|
- !ruby/object:Gem::Dependency
|
92
92
|
name: hoe-doofus
|
93
|
-
requirement: &
|
93
|
+
requirement: &6483080 !ruby/object:Gem::Requirement
|
94
94
|
none: false
|
95
95
|
requirements:
|
96
96
|
- - ! '>='
|
@@ -98,10 +98,10 @@ dependencies:
|
|
98
98
|
version: 1.0.0
|
99
99
|
type: :development
|
100
100
|
prerelease: false
|
101
|
-
version_requirements: *
|
101
|
+
version_requirements: *6483080
|
102
102
|
- !ruby/object:Gem::Dependency
|
103
103
|
name: hoe-git
|
104
|
-
requirement: &
|
104
|
+
requirement: &6467480 !ruby/object:Gem::Requirement
|
105
105
|
none: false
|
106
106
|
requirements:
|
107
107
|
- - ! '>='
|
@@ -109,10 +109,10 @@ dependencies:
|
|
109
109
|
version: 1.3.0
|
110
110
|
type: :development
|
111
111
|
prerelease: false
|
112
|
-
version_requirements: *
|
112
|
+
version_requirements: *6467480
|
113
113
|
- !ruby/object:Gem::Dependency
|
114
114
|
name: racc
|
115
|
-
requirement: &
|
115
|
+
requirement: &6467000 !ruby/object:Gem::Requirement
|
116
116
|
none: false
|
117
117
|
requirements:
|
118
118
|
- - ! '>='
|
@@ -120,10 +120,10 @@ dependencies:
|
|
120
120
|
version: 1.4.6
|
121
121
|
type: :development
|
122
122
|
prerelease: false
|
123
|
-
version_requirements: *
|
123
|
+
version_requirements: *6467000
|
124
124
|
- !ruby/object:Gem::Dependency
|
125
125
|
name: rexical
|
126
|
-
requirement: &
|
126
|
+
requirement: &6466480 !ruby/object:Gem::Requirement
|
127
127
|
none: false
|
128
128
|
requirements:
|
129
129
|
- - ! '>='
|
@@ -131,10 +131,10 @@ dependencies:
|
|
131
131
|
version: 1.0.5
|
132
132
|
type: :development
|
133
133
|
prerelease: false
|
134
|
-
version_requirements: *
|
134
|
+
version_requirements: *6466480
|
135
135
|
- !ruby/object:Gem::Dependency
|
136
136
|
name: hoe
|
137
|
-
requirement: &
|
137
|
+
requirement: &6465900 !ruby/object:Gem::Requirement
|
138
138
|
none: false
|
139
139
|
requirements:
|
140
140
|
- - ~>
|
@@ -142,7 +142,7 @@ dependencies:
|
|
142
142
|
version: '2.9'
|
143
143
|
type: :development
|
144
144
|
prerelease: false
|
145
|
-
version_requirements: *
|
145
|
+
version_requirements: *6465900
|
146
146
|
description: ! 'This project is inspired by kdesrc-build[http://kdesrc-build.kde.org/].
|
147
147
|
|
148
148
|
|