build-tool 0.5.1 → 0.5.2

Sign up to get free protection for your applications and to get access to all the features.
data.tar.gz.sig CHANGED
Binary file
data/History.txt CHANGED
@@ -1,3 +1,10 @@
1
+ == 0.5.2
2
+ - Bugfix
3
+ - Be less verbose about adding ssh-key to the agent. One time is enough.
4
+ - If a environment variable is empty in the recipe remove it from the environment instead of
5
+ setting it to "".
6
+ - Bring back the archive build-system. It was temporarily unavailable since 0.5.0
7
+
1
8
  == 0.5.1
2
9
  - Bugfix
3
10
  - Add missing files.
data/lib/build-tool.rb CHANGED
@@ -2,6 +2,6 @@
2
2
  $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
3
3
 
4
4
  module BuildTool
5
- VERSION = '0.5.1'
5
+ VERSION = '0.5.2'
6
6
  end
7
7
 
@@ -79,6 +79,9 @@ rule
79
79
  ### ARCHIVE
80
80
  #
81
81
  :ARCHIVE end\b { @state = @states.pop; [ :END, text ]; }
82
+ :ARCHIVE repository\b { @states.push @state; @state = :REPOSITORY; [:REPOSITORY, text]; }
83
+ :ARCHIVE remote-path\b { [:REMOTE_PATH, text]; }
84
+ :ARCHIVE use\b { @states.push @state; @state = :USE; [:USE, text]; }
82
85
  # COMMON
83
86
  :ARCHIVE {STRING} { [:STRING, @ss[1]]; }
84
87
  :ARCHIVE {TOKEN} { [:TOKEN, text]; }
@@ -76,7 +76,7 @@ def initialize(values = nil)
76
76
 
77
77
  SvnDeclaration
78
78
  SvnCheckoutOnly
79
- SvnRemotePath
79
+ RemotePath
80
80
 
81
81
  UseBuildSystem
82
82
  UseEnvironment
@@ -116,11 +116,14 @@ rule
116
116
 
117
117
  archive_statements
118
118
  : /* empty */
119
- # | archive_statement archive_statements { result = val.flatten; }
119
+ | archive_statement archive_statements { result = val.flatten; }
120
120
  ;
121
121
 
122
- # archive_statement
123
- # ;
122
+ archive_statement
123
+ : USE REPOSITORY identifier { result = UseRepositoryNode.new( val[2] ); }
124
+ | REMOTE_PATH STRING { result = RemotePathNode.new( val[1] ); }
125
+ | repository_declaration { result = val[0]; }
126
+ ;
124
127
 
125
128
  #
126
129
  ### BUILD SYSTEM DECLARATION
@@ -226,7 +229,7 @@ rule
226
229
  : git_statement { result = val[0]; }
227
230
  | USE REPOSITORY identifier { result = UseRepositoryNode.new( val[2] ); }
228
231
  | EXTERNAL STRING { result = GitSvnExternalNode.new( val[1] ); }
229
- | REMOTE_PATH STRING { result = SvnRemotePathNode.new( val[1] ); }
232
+ | REMOTE_PATH STRING { result = RemotePathNode.new( val[1] ); }
230
233
  | repository_declaration { result = val[0]; }
231
234
  ;
232
235
 
@@ -338,7 +341,7 @@ rule
338
341
  svn_statement
339
342
  : ONLY STRING { result = SvnCheckoutOnlyNode.new(val[1]); }
340
343
  | USE REPOSITORY identifier { result = UseRepositoryNode.new( val[2] ); }
341
- | REMOTE_PATH STRING { result = SvnRemotePathNode.new( val[1] ); }
344
+ | REMOTE_PATH STRING { result = RemotePathNode.new( val[1] ); }
342
345
  | repository_declaration { result = val[0]; }
343
346
  ;
344
347
 
@@ -191,6 +191,24 @@ def visit_ArchiveDeclarationNode( node )
191
191
  return @vcs
192
192
  end
193
193
 
194
+ def visit_RepositoryDeclarationNode( node )
195
+ visitor = RepositoryDeclarationNodeVisitor.new( configuration )
196
+ @vcs.repository = node.accept( visitor )
197
+ end
198
+
199
+ def visit_UseRepositoryNode( node )
200
+ repo = configuration.repository( node.value )
201
+ if repo.nil?
202
+ raise ConfigurationError, "Unknown repository #{node.value}!"
203
+ end
204
+ @vcs.repository = repo
205
+ end
206
+
207
+ def visit_RemotePathNode( node )
208
+ @vcs.remote_path = node.value
209
+ end
210
+
211
+
194
212
  end # class ArchiveDeclarationNodeVisitor
195
213
 
196
214
 
@@ -399,7 +417,7 @@ def visit_UseRepositoryNode( node )
399
417
  @vcs.repository = repo
400
418
  end
401
419
 
402
- def visit_SvnRemotePathNode( node )
420
+ def visit_RemotePathNode( node )
403
421
  @vcs.remote_path = node.value
404
422
  end
405
423
 
@@ -734,7 +752,7 @@ def visit_UseRepositoryNode( node )
734
752
  @vcs.repository = repo
735
753
  end
736
754
 
737
- def visit_SvnRemotePathNode( node )
755
+ def visit_RemotePathNode( node )
738
756
  @vcs.remote_path = node.value
739
757
  end
740
758
 
@@ -55,6 +55,7 @@ def do_execute_module( mod )
55
55
  when 'svn'
56
56
  say " Repository: %s/%s" % [ mod.vcs_configuration.repository.url, mod.vcs_configuration.remote_path ]
57
57
  when 'archive'
58
+ say " URL: %s" % [ mod.vcs.archive_url ]
58
59
  when 'git'
59
60
  mod.vcs_configuration.remote.each do |key, val|
60
61
  if val.push_url
@@ -12,6 +12,12 @@ def name
12
12
  "archive"
13
13
  end
14
14
 
15
+ def initialize
16
+ super
17
+ @repository = nil
18
+ @remote_path = nil
19
+ end
20
+
15
21
  def vcs( mod )
16
22
  raise StandardError if @module and ! mod.equal?( @module )
17
23
  @module = mod
@@ -22,6 +28,22 @@ def copy_configuration( other )
22
28
  super
23
29
  end
24
30
 
31
+ attr_writer :repository
32
+ def repository
33
+ if @repository.nil?
34
+ raise ConfigurationError, "No repository configured for module #{mod.name}."
35
+ end
36
+ @repository
37
+ end
38
+
39
+ attr_writer :remote_path
40
+ def remote_path
41
+ if @remote_path.nil?
42
+ return @module.name
43
+ end
44
+ @remote_path
45
+ end
46
+
25
47
  end # class ArchiveConfiguration
26
48
 
27
49
  class Archive < Base
@@ -57,7 +79,7 @@ def archive_name
57
79
  end
58
80
 
59
81
  def archive_url
60
- "#{repository.url}/#{remote_path}"
82
+ "#{config.repository.url}/#{config.remote_path}"
61
83
  end
62
84
 
63
85
  #
@@ -168,6 +190,17 @@ def rebase
168
190
  0
169
191
  end
170
192
 
193
+ def prepare_for_access
194
+ # If our server has an associated ssh-key, add it to the ssh-agent.
195
+ if config.repository.sshkey
196
+ key = config.repository.sshkey
197
+ logger.info ""
198
+ logger.info "#### Adding required ssh-key #{key.file} to ssh-agent."
199
+ MJ::Tools::SSH::add_key key.file
200
+ end
201
+ true
202
+ end
203
+
171
204
  end # class Archive
172
205
 
173
206
  end; end
@@ -146,9 +146,11 @@ def prepare_for_access
146
146
  # If our server has an associated ssh-key, add it to the ssh-agent.
147
147
  if config.repository.sshkey
148
148
  key = config.repository.sshkey
149
- logger.info ""
150
- logger.info "#### Adding required ssh-key #{key.file} to ssh-agent."
151
- MJ::Tools::SSH::add_key key.file
149
+ if ! MJ::Tools::SSH::has_key? key.file
150
+ logger.info ""
151
+ logger.info "#### Adding required ssh-key #{key.file} to ssh-agent."
152
+ MJ::Tools::SSH::add_key key.file
153
+ end
152
154
  end
153
155
  true
154
156
  end
@@ -63,8 +63,14 @@ def adjust_environment( wd=nil, env=nil, lang="C" )
63
63
  if env
64
64
  env.each do |var, value|
65
65
  oldenv[var] = ENV[var]
66
- logger.verbose "#{var} = #{value}"
67
- ENV[var] = value
66
+ if value.nil? or value == ""
67
+ next if ENV.has_key?( value )
68
+ ENV[var] = nil
69
+ logger.verbose "Removing #{var} from environment"
70
+ else
71
+ logger.verbose "#{var} = #{value}"
72
+ ENV[var] = value
73
+ end
68
74
  end
69
75
  end
70
76
  # Save old LANG setting and switch to 'C'
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: build-tool
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.5.1
5
+ version: 0.5.2
6
6
  platform: ruby
7
7
  authors:
8
8
  - Michael Jansen
@@ -31,7 +31,7 @@ cert_chain:
31
31
  M3zOaQdtTmiQPBqNIsE=
32
32
  -----END CERTIFICATE-----
33
33
 
34
- date: 2011-02-07 00:00:00 +01:00
34
+ date: 2011-02-12 00:00:00 +01:00
35
35
  default_executable:
36
36
  dependencies:
37
37
  - !ruby/object:Gem::Dependency
@@ -152,7 +152,7 @@ dependencies:
152
152
  requirements:
153
153
  - - ">="
154
154
  - !ruby/object:Gem::Version
155
- version: 2.9.0
155
+ version: 2.9.1
156
156
  type: :development
157
157
  version_requirements: *id011
158
158
  description: |-
metadata.gz.sig CHANGED
@@ -1,3 +1 @@
1
- ��h?C&��e�/��&3�ѱWj����两����6S'v[.���+m�n䉗pt8�>�cB�| l [6��Ul7I|��L?��xrn���dc]��md
2
- �H��^�7kc����(4ob$0A�8 0i@���TL�����
3
- ��7�|DR/7뽴X~
1
+ ��zі����V*�����Ts ��w�q��!�� ��P:����4�-Fl;'�u7Zo� ڎ#iCx)!b�! KN�Y)����ɍ���`2�ȱ���N�_��(A�N�9����@ d&+Z����s T�KsE2���Qy$�O���>�`�!�W�BIِ/�I�0��Q��KW����bx�{��y��@�k&s钟2����49��Q_b�4#�.˴˴�%Aed�DQ��t]��Ul�