build-tool 0.6.1 → 0.6.2

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/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- build-tool (0.6.0.rc2)
4
+ build-tool (0.6.2)
5
5
  activerecord (>= 3.2.1)
6
6
  ansi (>= 1.4.2)
7
7
  grit (>= 2.4.1)
@@ -11,15 +11,15 @@ PATH
11
11
  GEM
12
12
  remote: http://rubygems.org/
13
13
  specs:
14
- activemodel (3.2.1)
15
- activesupport (= 3.2.1)
14
+ activemodel (3.2.3)
15
+ activesupport (= 3.2.3)
16
16
  builder (~> 3.0.0)
17
- activerecord (3.2.1)
18
- activemodel (= 3.2.1)
19
- activesupport (= 3.2.1)
20
- arel (~> 3.0.0)
17
+ activerecord (3.2.3)
18
+ activemodel (= 3.2.3)
19
+ activesupport (= 3.2.3)
20
+ arel (~> 3.0.2)
21
21
  tzinfo (~> 0.3.29)
22
- activesupport (3.2.1)
22
+ activesupport (3.2.3)
23
23
  i18n (~> 0.6)
24
24
  multi_json (~> 1.0)
25
25
  ansi (1.4.2)
@@ -31,17 +31,17 @@ GEM
31
31
  mime-types (~> 1.15)
32
32
  i18n (0.6.0)
33
33
  little-plugger (1.1.3)
34
- logging (1.7.0)
34
+ logging (1.7.2)
35
35
  little-plugger (>= 1.1.3)
36
- mime-types (1.17.2)
37
- multi_json (1.1.0)
36
+ mime-types (1.18)
37
+ multi_json (1.2.0)
38
38
  racc (1.4.7)
39
39
  rake (0.9.2.2)
40
40
  rexical (1.0.5)
41
41
  sqlite3 (1.3.5)
42
42
  turn (0.9.3)
43
43
  ansi
44
- tzinfo (0.3.31)
44
+ tzinfo (0.3.32)
45
45
  yard (0.7.5)
46
46
 
47
47
  PLATFORMS
data/History.rdoc CHANGED
@@ -1,349 +1,85 @@
1
- == 0.6.1 ==
1
+ == Version 0.6.2
2
+ === Features
3
+ - <tt>environment set</tt>: Add <tt>--command</tt> option (Execute command and return)
4
+ - <tt>module shell</tt>: Add <tt>--command</tt> option (Execute command and return)
5
+
6
+ === Enhancements
7
+ - <tt>module list</tt>: Add <tt>--outdated</tt> option (Sort by last successful build)
8
+
9
+ === Bugfixes
10
+ - <tt>git-svn clone</tt>: Correctly fetch HEAD. Cloned the complete history.
11
+ - <tt>module enable</tt>: Did not work (Failed to save the change.).
12
+ - <tt>module info</tt>: Handle mercurial.
13
+ - Correctly handle two modules removed at once from the recipe.
14
+ - Features nested three levels did not work.
15
+ - The pushUrl in GIT would always be set.
16
+
17
+ == Version 0.6.1
18
+
19
+ === Bugfixes
20
+ - Fix qt build-system if no custom flags are defined.
21
+
22
+ == Version 0.6.0
23
+
24
+ === Features
25
+ - Add --ionice and --nice N options to set IO (idle) and CPU Priority.
26
+ kde-build --ionice --nice 19 build ....
27
+ - When updating the source show the newly applied commits if -v is specified.
28
+ They will allways end up in the rebase logfile.
29
+ - Make it possible to specify all modules at once.
30
+ kde-build fetch :all
31
+ - New command 'recipe edit'
32
+ - Opens the recipe override file in a editor.
33
+ - --global will open the recipe itself.
34
+ - --browser will open a file browser instead.
35
+ - New command 'module cleanup'
36
+ - Can remove the src and build dir of a module. Handle with care.
37
+ - The enabled/disabled state of features has been moved to the database.
38
+ - On the first start the current state will be migrated to the database.
39
+ AFTER that remove all 'feature enable|disable' lines from the override
40
+ file.
41
+ - command 'feature enable FEATURE' enables a feature.
42
+ - command 'feature disable FEATURE' disables a feature.
43
+ - The enabled/disabled state of modules has been moved to the database.
44
+ - On the first start the current state will be migrated to the database.
45
+ AFTER that remove all 'modules enable|disable' lines from the override
46
+ file.
47
+ - command 'module enable MODULE' enables a module.
48
+ - command 'module disable MODULE' disables a module and has options to
49
+ remove src and bld directory in one step.
50
+ - The 'recipe fetch incoming' command now works against a branch that has the
51
+ build-tool version encoded. This makes it possible to make a recipe that is
52
+ compatible to more than one version.
53
+ - The configuration values have been moved into the command line. A migration
54
+ will be done automatically on first run.
55
+ - 'configuration list' Will show the configuration values.
56
+ - 'configuration edit' will edit them.
57
+ - Support for the bazar vcs.
58
+
59
+
60
+ === Enhancements
61
+ - Most of the --help texts have been improved dramatically.
62
+ - Unit testing was reenabled again.
63
+ - Command: lsmod
64
+ - Sort output alphabetically by default
65
+ - With --broken only shows modules that failed.
66
+ - With --no-sort shows modules in order of declaration / build order.
67
+ - With --all shows disabled modules too.
68
+ - With --disabled shows only disabled modules.
69
+ - Command lsfeat
70
+ - Looks much more similar to the module list output.
71
+ - Shows only active features by default.
72
+ - With --all shows all features.
73
+ - The long description statement now accepts multiline string with """....""".
74
+ - Command: gc
75
+ - Cleanup the logfiles more thoroughly.
76
+ - Disabled modules are accepted when given explicit on the command line if
77
+ they are associated with a active feature. This makes it possible to build
78
+ disabled modules.
79
+
80
+
81
+ === Bugfixes
82
+ - Change current directory to $HOME on start. The current working directory
83
+ could be removed while the command runs.
2
84
 
3
- - Bugfixes
4
- - Fix qt build-system if no custom flags are defined.
5
85
 
6
- == 0.6.0 ==
7
-
8
- - Features
9
- - Add --ionice and --nice N options to set IO (idle) and CPU Priority.
10
- > kde-build --ionice --nice 19 build ....
11
- - When updating the source show the newly applied commits if -v is specified.
12
- They will allways end up in the rebase logfile.
13
- - Make it possible to specify all modules at once.
14
- kde-build fetch :all
15
- - New command 'recipe edit'
16
- - Opens the recipe override file in a editor.
17
- - --global will open the recipe itself.
18
- - --browser will open a file browser instead.
19
- - New command 'module cleanup'
20
- - Can remove the src and build dir of a module. Handle with care.
21
- - The enabled/disabled state of features has been moved to the database.
22
- - On the first start the current state will be migrated to the database.
23
- AFTER that remove all 'feature enable|disable' lines from the override
24
- file.
25
- - command 'feature enable FEATURE' enables a feature.
26
- - command 'feature disable FEATURE' disables a feature.
27
- - The enabled/disabled state of modules has been moved to the database.
28
- - On the first start the current state will be migrated to the database.
29
- AFTER that remove all 'modules enable|disable' lines from the override
30
- file.
31
- - command 'module enable MODULE' enables a module.
32
- - command 'module disable MODULE' disables a module and has options to
33
- remove src and bld directory in one step.
34
- - The 'recipe fetch incoming' command now works against a branch that has the
35
- build-tool version encoded. This makes it possible to make a recipe that is
36
- compatible to more than one version.
37
- - The configuration values have been moved into the command line. A migration
38
- will be done automatically on first run.
39
- - 'configuration list' Will show the configuration values.
40
- - 'configuration edit' will edit them.
41
- - Support for the bazar vcs.
42
-
43
-
44
- - Enhancements
45
- - Most of the --help texts have been improved dramatically.
46
- - Unit testing was reenabled again.
47
- - Command: lsmod
48
- - Sort output alphabetically by default
49
- - With --broken only shows modules that failed.
50
- - With --no-sort shows modules in order of declaration / build order.
51
- - With --all shows disabled modules too.
52
- - With --disabled shows only disabled modules.
53
- - Command lsfeat
54
- - Looks much more similar to the module list output.
55
- - Shows only active features by default.
56
- - With --all shows all features.
57
- - The long description statement now accepts multiline string with """....""".
58
- - Command: gc
59
- - Cleanup the logfiles more thoroughly.
60
- - Disabled modules are accepted when given explicit on the command line if
61
- they are associated with a active feature. This makes it possible to build
62
- disabled modules.
63
-
64
-
65
- - Bugfixes
66
- - Change current directory to $HOME on start. The current working directory
67
- could be removed while the command runs.
68
-
69
-
70
-
71
- == 0.5.7 ==
72
-
73
- - Features
74
- - None
75
-
76
- - Enhancements
77
- - Check for git, svn and git-svn executables before doing anything.
78
- - Guard against relative pathnames.
79
- - Better error message in case of a ambiguous module name.
80
-
81
- - Bugfixes
82
- - "git files <unknown>" npo longer throws scary backtrace.
83
- - git supports serverless declaration for push url too.
84
- git "server" "path/to"
85
- git "full/url"
86
-
87
- == 0.5.6 ==
88
-
89
- Failed release.
90
-
91
- == 0.5.5 ==
92
-
93
- Failed release.
94
-
95
- == 0.5.4 ==
96
-
97
- - Features
98
- - Support --resume-from for all module based commands (configure)
99
- - Show a progressbar when checking for obstacles at the beginning. That can take quite some time.
100
- - If a repository contains a file named .commit-template add it to the git configuration.
101
-
102
- - Enhancements
103
- - Check the recipe directory for validity before installing the recipe.
104
- - Only consider a directory a valid recipe if it has a recipe file.
105
- - Support --resume-from for all module based commands (configure)
106
- - Support --resume-from for all module based commands (configure)
107
- - Show core dumps too if make fails.
108
- - If a exception happens when checking if modules are ready stop the command.
109
-
110
- - Bugfixes
111
- - If an svn repository had no repository an error occured while trying to build the error message.
112
- - Fix reconfigure --from-scratch
113
- - AutoConf: Fix options without values
114
- - sqlite3-ruby was renamed to sqlite3 only.
115
- - Add grit as dependency
116
- - Bugfix: Use correct Error class
117
- - Fix a exception of recipe info <recipe>.
118
- - Do not claim to Fetch if we do Clone.
119
- - Remove a wrong info() line
120
- - Bugfix: history <modulename> -> Use same logic as build.
121
-
122
- == 0.5.3
123
- - Feature
124
- - Errors during a make call are both printed to the logfile and stdout even without verbose
125
- mode. Currently lines with "error:" and "ld:" are considered as errors. Report more. If the
126
- progressbar was active it is stopped.
127
- - Git: Check for a dirty index if asked for rebase. No automatic stashing (Yet?). Build-tool
128
- will bail out with an error message if you have uncommited changes. This step will be done
129
- before asking for the ssh key.
130
- - Enhancements
131
- - Do not print the classname for BuildTool Error classes. Only the message.
132
- - First fetch and rebase, then clean out the build-dir. If the fetch rebase fails you still have
133
- your old build to sort out the problems.
134
- - Improve the error message if --resume-from is given an invalid/ambiguous module name.
135
- - Bugfix
136
- - Fix ssh key handling. Now build-tool will stop if ssh-add fails.
137
- - Fix the progressbar for build-system not giving progress information(like qmake)
138
-
139
- == 0.5.2
140
- - Bugfix
141
- - Be less verbose about adding ssh-key to the agent. One time is enough.
142
- - If a environment variable is empty in the recipe remove it from the environment instead of
143
- setting it to "".
144
- - Bring back the archive build-system. It was temporarily unavailable since 0.5.0
145
-
146
- == 0.5.1
147
- - Bugfix
148
- - Add missing files.
149
-
150
- == 0.5.0
151
- - Enhancements
152
- - Support url and pushUrl for git modules.
153
-
154
- == 0.4.4
155
- - Enhancements
156
- - More ways to specify a module on the command line.
157
- - foo matches any module foo disregarding namespaces as long as only one matching module is
158
- found. ( kdelibs -> KDE/kdelibs )
159
- - foo/ matches any module that has foo/ as a namespace part.
160
- ( kdebase/ -> kdebase/(runtime, workspace, apps )
161
- - Implement kdesrc-builds --resume-from feature. Skips all modules before the module specified is
162
- found.
163
- - kde-build build --resume-from kdebase/runtime KDE/
164
- - kde-build build --resume-from runtime KDE/
165
- - Build System Qt: Print a message when running bin/synqt after each rebase.
166
- - Build System Autotools: Try autoconf to bootstrap. May fail.
167
- - Build System Package: Be more verbose about what we do.
168
- - CMD: build - If a module is not checked out ignore it when --update is not given on the command line.
169
- - Bugfix
170
- - The command "environment set [env] did set a wrong shell var to the name of the environment
171
- set. Use the documented BUILD_TOOL_ENV instead.
172
-
173
- == 0.4.3
174
- - Ruby 1.9 Compatibility.
175
-
176
- == 0.4.2
177
- - Enhancements
178
- - Usability: When working on many modules show (current number/total number) of modules for information.
179
- - SSH Key Handling: Make it possible to associate a key with a server.
180
- - SSH Key Handling: Print a message when adding/removing keys from ssh-agent.
181
- - Bugfixes
182
- - Some typo fixes.
183
- - Improved documentation.
184
- - Fixed gem dependencies.
185
-
186
- == 0.4.1
187
- - Enhancements
188
- - Colorize the output of the history command.
189
- - When fetching from remote specify the --prune option.
190
- - Improve some error messages.
191
- - Bugfix
192
- - Some ruby 1.9 compatibility fixes. No idea if it really works with 1.99.
193
- - Do not register remotes as repository declarations.
194
-
195
- == 0.4.0
196
- - Feature
197
- - Show a ansi terminal code based progressbar when compiling or installing in non verbose mode.
198
- That feature is courtesy of the ansi rubygem from (http://github.com/rubyworks/ansi). The lib
199
- has some shortcomings.
200
- - Colorize output. Powered by the ansi module too. The lib has a shortcoming here. It does not
201
- check if the terminal supports colors. You will get some escape codes then. I will send a
202
- patch upstream.
203
- - Enhancements
204
- - Rework the way build-systems are handled. This makes it possible to solve the cmake issue with
205
- rpath handling by properly creating an inheritance between build-systems. It makes it possible
206
- to alter or overwrite build-system options too.
207
-
208
-
209
- == 0.3.3
210
- - Feature
211
- - The history command now supports the -n --number [COUNT] option. Use it to specify how many
212
- entries you want to see.
213
- - Bugfixes
214
- - Fix the gc command. Sqlite really starts to enforce foreign key constraints.
215
- - Support arbitrary build options for autoconf
216
- - Do not reassociate a module / environment with a different feature when just changing it. The
217
- initial associtation is correct.
218
-
219
-
220
- == 0.3.2
221
- - Main Features
222
- - none
223
- - Bugfixes
224
- - Fix the database initialization. SQLite3 seems to start enforcing foreign keys. And ours had a
225
- typo.
226
- - Fix the "vcs git remote "whatever" end end" stuff. Handle it exactly like a repository. This
227
- fixes the qt/qt modules initialization from the kdeqt recipe. It tried to clone a pure server
228
- url because the path part was not possible to specify for remotes.
229
- - Fix a bug with the sequel logging stuff that only happened if sequel reported an error.
230
- - Imporve the warning that say "The following command sometimes fails ..." on git clone.
231
- - If a module is specified for a command and inactive issue a warning. Same for specified groups
232
- with only inactive modules.
233
-
234
-
235
- == 0.3.1
236
- - Main Features
237
- - BuildSystem: QMake support
238
- - Bugfixes
239
- - Fix the gc command
240
- - Fix the installation comment on gem update/install
241
-
242
-
243
- == 0.3
244
- - Main Features
245
- * Split the recipes from the gem
246
- * New command: recipe add <url> <name>
247
- * New command: recipe incoming
248
- * Qt: Call bin/synqt after each rebase
249
- - Features
250
- * VCS Autoconf: support autogen.sh and bootstrap
251
- * VCS SVN: sparse checkout support
252
- * VCS: Mercurial support
253
- - Bugfixes
254
- * Initialize the log directory on demand
255
-
256
-
257
- == 0.2
258
- - Features
259
- * Implement include directive.
260
- * Implement feature directive.
261
- * Group modules into features.
262
- * Enable/Disable features.
263
- * Implement "gc" command.
264
- * execute "git gc" for all git repositories.
265
- * Implement build-system "None".
266
- * Implement vcs "archive".
267
- - Download an archive.
268
- - Unpack it.
269
- * Add a database
270
- - Keep record of executed commands and results
271
- - Command "history" to query the commands.
272
- - no argument -> show last 50 commands
273
- - number -> show detailed info about that command
274
- - +number -> show detailed info about number last command
275
- +0 = last
276
- +1 = next to last
277
- ...
278
- - <module> -> show the last 3 commands affecting the module.
279
- - Fixes
280
- * Sort command listing on "help".
281
- * Fixed autoconf support.
282
- * Many changes to the kde recipe.
283
-
284
-
285
- == 0.1.4 2009-12-10
286
- * konversation moved to git
287
-
288
-
289
- == 0.1.3 2009-11-28
290
- * Add some links to the homepage with documentation
291
- * kdevelop/kdevplatform moved to extragear for the kde recipe
292
-
293
- == 0.1.2 2009-11-28
294
- * Add support for Shared-desktop-ontologies.
295
- * Switch the qt tracking branch to master.
296
- * Build phonon from kdesupport for now. It is currently needed because of some
297
- recent pulseaudio related changes which makes it a requirement event for
298
- those of us which do not need pulseaudio.
299
- * Add attica because it is needed for knewstuff3.
300
-
301
- == 0.1.1 2009-11-19
302
- * No changes
303
-
304
- == 0.1.0 2009-11-19
305
- * Major rewrite
306
- * Substitute the yaml format for a tailormade file format with
307
- handmade lexer and parser
308
- * This release is a major backstep in case of functionality but it is
309
- usable for everyday use.
310
-
311
- == 0.0.3 2009-07-07
312
- * New commands:
313
- * ctags - Create tags file for module(s)
314
- * compile - Just compile the module(s)
315
- * configure - Just configure the module(s)
316
- * install - install the module(s)
317
- * fetch - Only fetch remote changes. Do not update only if vcs supports
318
- it.
319
- * rebase - Rebase the checkout against already fetched remote changes.
320
- This command will not fetch.
321
- * info - Print out some usefule information about a module.
322
- * Example Config File
323
- * Set PKG_CONFIG_PATH
324
- * Fix lensfun receipt
325
- * Fix some packages and orders
326
- * General Bugfixing
327
- * Fix subversion repository initialization.
328
- * Improve the documentation strings
329
-
330
-
331
- == 0.0.2 2009-06-14
332
- * Improved example configuration file
333
- * Checkout the 4.5 version by default. Not trunk.
334
- * Some bugfixes
335
- * Make sure the build directory exists, THEN call bootstrap.
336
- * Show the options for subcommands in the help texts
337
- * Improvement
338
- * Add option "remote-branch" for git-svn. Default to master
339
- * Break out of the program on SIGBREAK. Not only out of the currently
340
- * build module.
341
-
342
-
343
- == 0.0.1 2009-06-04
344
-
345
- * 1 major enhancement:
346
- * Initial release (test)
347
- * The only currently supported command is build. It's possible to compile a
348
- complete kde session using it with nearly no manual intervention. If your
349
- system has the deveopment requirements met for kde.
@@ -288,7 +288,7 @@ def visit_FeatureNode( node )
288
288
  # Get the name if nested
289
289
  name = childs.shift
290
290
  if configuration.active_feature
291
- @feature = configuration.feature( "#{configuration.active_feature.name}/#{name}" )
291
+ @feature = configuration.feature( "#{configuration.active_feature.path}/#{name}" )
292
292
  else
293
293
  @feature = configuration.feature( name )
294
294
  end
@@ -11,7 +11,11 @@ class Set < Standard
11
11
 
12
12
  name "set"
13
13
  description "Open a shell with the environment set."
14
- long_description "Opens a new shell with the exact environment used by build-tool for the script."
14
+ long_description [
15
+ "Opens a new shell with the given environment and and executes COMMAND.",
16
+ "It then waits for COMMAND to finish and returns its exit code. The",
17
+ "default command is $SHELL." ]
18
+
15
19
 
16
20
  def do_execute( args )
17
21
  case args.length
@@ -25,13 +29,30 @@ def do_execute( args )
25
29
 
26
30
  # Get the environment.
27
31
  env = configuration.environment(args[0])
28
- return env.shell
32
+
33
+ verbose "> #{@command}"
34
+ rc = env.shell( @command, { detach: @detach } )
35
+ verbose "> #{rc}" if not @detach
36
+ verbose "> send to background" if @detach
37
+
38
+ return rc.exitstatus if not @detach
39
+ return 0
29
40
  end
30
41
 
31
42
  def initialize_options
32
43
  options.banner = "Usage: #{self.fullname} [OPTIONS]... MODULE"
33
44
  options.separator( "" )
34
45
  options.separator( "Options" )
46
+
47
+ @command = ENV['SHELL']
48
+ options.on( "-c", "--command COMMAND", "Execute command COMMAND (#{@command}]" ) { |c|
49
+ @command = "#{ENV['SHELL']} -c '#{c}'"
50
+ }
51
+
52
+ @detach = nil
53
+ options.on( "-d", "--detach", "Detach the process and return immediately." ) {
54
+ @detach = true
55
+ }
35
56
  super
36
57
  end
37
58
 
@@ -74,13 +74,44 @@ def show_feature( name )
74
74
  return -1
75
75
  end
76
76
 
77
- info( "Name : %s" % feature.path )
77
+ info( "%s : %s" % [ feature.path, feature.description ] )
78
+ if feature.parent
79
+ info( "Active : %s (Parent %s: %s)" % [ feature.active_char, feature.parent.name, feature.parent.active_char ] )
80
+ else
81
+ info( "Active : %s" % [ feature.active_char ] )
82
+ end
83
+ info( "" )
84
+
85
+ if feature.long_description
86
+ info( feature.long_description.sub( /^/, ' ' ) )
87
+ info( "" )
88
+ end
89
+
90
+ subfeats = []
91
+ features = configuration.features
92
+ features.keys.sort.each do |name|
93
+ if name.start_with? feature.path
94
+ next if name == feature.path
95
+ subfeats << features[name]
96
+ end
97
+ end
98
+
99
+ if not subfeats.empty?
100
+ info( "Features" )
101
+ info( "====================================================" )
102
+ subfeats.each do |feat|
103
+ info( "%s %-35s : %s" % [ feat.active_char, feat.path, feat.description || "No description specified" ] )
104
+ end
105
+ info( "" )
106
+ end
107
+
78
108
  info( "Modules" )
79
109
  info( "====================================================" )
80
110
  feature.modules.each do |mod|
81
111
  next if mod.is_template?
82
112
  info( "%s%s %-35s : %s" % [ mod.active_char, mod.state_char, mod.name, mod.description || "No description specified" ] )
83
113
  end
114
+ info( "" )
84
115
  return 0
85
116
  end
86
117
 
@@ -33,6 +33,12 @@ def applicable?
33
33
  BuildTool::Application.instance.has_recipe?
34
34
  end
35
35
 
36
+ def do_execute( args )
37
+ super( args )
38
+ configuration.save()
39
+ return 0
40
+ end
41
+
36
42
  def do_execute_module( mod )
37
43
 
38
44
  if @default and mod.default_active? == true
@@ -62,6 +62,9 @@ def do_execute_module( mod )
62
62
  info( " Repository: %s/%s" % [ mod.vcs_configuration.repository.url, mod.vcs_configuration.remote_path ] )
63
63
  when 'bazar'
64
64
  info( " Branch: %s" % [ mod.vcs_configuration.url ] )
65
+ when 'mercurial'
66
+ info( " URL: %s" % [ mod.vcs_configuration.url ] )
67
+ info( " Track: %s" % [ mod.vcs_configuration.track ] )
65
68
  when 'archive'
66
69
  info( " URL: %s" % [ mod.vcs.archive_url ] )
67
70
  when 'git'
@@ -28,21 +28,35 @@ class List < Standard
28
28
  " Fourth column: The modules short description." ]
29
29
  cmdalias "lsmods"
30
30
 
31
+ def ensure_option_not_set( option, name, conflicts )
32
+ if option
33
+ raise UsageError, "Options --#{conflicts} and --#{name} are mutually exclusive."
34
+ end
35
+ end
36
+
31
37
  def initialize_options
32
38
  options.banner = "Usage: #{self.fullname} [OPTIONS]... [MODULE|GROUP]..."
33
39
  options.separator( "" )
34
40
  options.separator( "Options" )
35
41
 
36
- @all = true
42
+ @all = false
43
+
44
+ options.separator( '' )
45
+ options.separator( ' Criterias' )
37
46
 
38
47
  @active = true
39
48
  @inactive = false
40
49
  options.on( "--all", "Include inactive modules." ) {
50
+ ensure_option_not_set( @disabled, 'disabled', 'all' )
51
+ ensure_option_not_set( @broken, 'broken', 'all' )
52
+ @all = true
41
53
  @active = true
42
54
  @inactive = true
43
55
  }
44
56
 
45
57
  options.on( "--disabled", "Only show inactive modules." ) {
58
+ ensure_option_not_set( @all, 'all', 'disabled' )
59
+ ensure_option_not_set( @broken, 'broken', 'disabled' )
46
60
  @active = false
47
61
  @inactive = true
48
62
  }
@@ -54,11 +68,23 @@ def initialize_options
54
68
 
55
69
  @broken = false
56
70
  options.on( "--broken", "Show only broken modules." ) {
71
+ ensure_option_not_set( @all, 'all', 'broken' )
72
+ ensure_option_not_set( @disabled, 'disabled', 'broken' )
57
73
  @broken = true
58
74
  }
59
75
 
76
+ options.separator( '' )
77
+ options.separator( ' Sort order' )
78
+
79
+ @outdated = false
80
+ options.on( "--outdated", "Show modules sorted by date of last successful compile." ) {
81
+ ensure_option_not_set( !@sort, 'no-sort', 'outdated' )
82
+ @outdated = true
83
+ }
84
+
60
85
  @sort = true
61
86
  options.on( "--no-sort", "Show modules in order of declaration." ) {
87
+ ensure_option_not_set( @outdated, 'outdated', 'no-sort' )
62
88
  @sort = false
63
89
  }
64
90
 
@@ -82,6 +108,7 @@ def do_execute( args )
82
108
 
83
109
  def show_modules( mods )
84
110
  mods = mods.sort if @sort
111
+ mods = mods.sort { |x, y| x.last_success <=> y.last_success }.reverse if @outdated
85
112
  mods.each do |mod|
86
113
  show_module( mod )
87
114
  end
@@ -98,8 +125,15 @@ def show_module( mod )
98
125
 
99
126
  if @broken
100
127
  info( "%s%s %-35s : %-25s" % [ mod.active_char, mod.state_char, mod.name, mod.state ] )
128
+ elsif @outdated
129
+ if mod.last_success == DateTime.new
130
+ success = 'unknown'
131
+ else
132
+ success = mod.last_success.strftime("%x %X")
133
+ end
134
+ info( "%s%s %-35s : %s" % [ mod.active_char, mod.state_char, mod.name, success ] )
101
135
  else
102
- info( "%s%s %-35s : %s" % [ mod.active_char, mod.state_char, mod.name, mod.description || "No description specified" ] )
136
+ info( "%s%s %-35s : %s" % [ mod.active_char, mod.state_char, mod.name, mod.description || "No description specified" ] )
103
137
  end
104
138
  end
105
139
 
@@ -14,12 +14,27 @@ class MyShell < Standard
14
14
 
15
15
  name "shell"
16
16
  description "Open a shell with the environment for the given module."
17
+ long_description [
18
+ "Opens a new shell with the exact environment used to build the MODULE and",
19
+ "then executes the given shell command. It then waits for the shell command",
20
+ "to finish and returns its exit code. The default command is $SHELL." ]
17
21
 
18
22
  def initialize_options
19
23
  options.banner = "Usage: #{self.fullname} [OPTIONS]... MODULE"
20
24
  options.separator( "" )
21
25
  options.separator( "Options" )
26
+
27
+ @command = ENV['SHELL']
28
+ options.on( "-c", "--command COMMAND", "Execute command COMMAND (#{@command}]" ) { |c|
29
+ @command = "#{ENV['SHELL']} -c '#{c}'"
30
+ }
31
+
32
+ @detach = nil
33
+ options.on( "-d", "--detach", "Detach the process and return immediately" ) {
34
+ @detach = true
35
+ }
22
36
  super
37
+
23
38
  end
24
39
 
25
40
  def do_execute( args )
@@ -35,7 +50,13 @@ def do_execute( args )
35
50
  end
36
51
 
37
52
  # Get our one and only module
38
- mod[0].environment.shell
53
+ verbose "> #{@command}"
54
+ rc = mod[0].environment.shell( @command, { detach: @detach } )
55
+ verbose "> #{rc}" if not @detach
56
+ verbose "> send to background" if @detach
57
+
58
+ return rc.exitstatus if not @detach
59
+ return 0
39
60
  end
40
61
 
41
62
  end # class Shell
@@ -193,7 +193,7 @@ def add_build_system( bs )
193
193
  def save
194
194
  logger.debug "Saving features to database."
195
195
  @features.each do |name, f|
196
- logger.debug2( " Feature %s" % [ f.name ] ) if f.changed?
196
+ logger.debug2( " Feature %s (%s)" % [ f.name, f.parent_id ] ) if f.changed?
197
197
  f.save! if f.changed?
198
198
  end
199
199
  logger.debug "Saving modules to database."
@@ -247,7 +247,7 @@ def truncate
247
247
  def migrate()
248
248
 
249
249
  logger.debug( 'Checking for obsolete modules in db.' )
250
- for mod in @modules do
250
+ for mod in @modules.reverse() do
251
251
  if not mod.found_in_recipe
252
252
  logger.info 'Module %s no longer supported by recipe. Removing it from db.' % [ mod.name ]
253
253
  # Remove it from our bookkeeping first.
@@ -74,14 +74,23 @@ def set( name, value )
74
74
  # It sets an environment variable *BUILD_TOOL_ENV* with the name of
75
75
  # the environment set. This can be used to add this information to
76
76
  # the prompt.
77
- def shell( wd = nil )
77
+ def shell( command = nil, options = {} )
78
+ wd = options[ :wd ]
79
+ detach = options[ :detach ] || false
80
+
78
81
  begin
82
+ logger.verbose( "BUILD_TOOL_ENV = #{name}" )
79
83
  ENV['BUILD_TOOL_ENV'] = name
80
84
  self.class.adjust_environment( wd, values ) {
81
- logger.info "Starting #{ENV['SHELL']}"
82
- system( ENV['SHELL'] )
83
- logger.info "#{ENV['SHELL']} stopped."
84
- return 0;
85
+ pid = Process.fork {
86
+ exec( command )
87
+ }
88
+ if detach
89
+ return Process.detach( pid )
90
+ else
91
+ Process.wait( pid )
92
+ return $?
93
+ end
85
94
  }
86
95
  ensure
87
96
  ENV['BUILD_TOOL_ENV'] = nil
@@ -79,6 +79,15 @@ def last_by_module( modname, count = 3 )
79
79
  where( 'id in ( select distinct command_log_id from module_logs where module = ? )', modname ).order( 'id DESC' ).first( count );
80
80
  end
81
81
 
82
+ # Return the last entry with the given state.
83
+ def last_success_by_module( modname )
84
+ where( "command_logs.id not in ( select command_log_id from module_logs where module_logs.module = ? and module_logs.state != #{StateHelper::FINISHED_SUCCESSFUL})", modname ).
85
+ joins( "INNER JOIN module_logs ON module_logs.command_log_id = command_logs.id and module_logs.module = \"#{modname}\"" ).
86
+ order( 'id DESC' ).
87
+ first()
88
+ end
89
+
90
+
82
91
  # Get all commands older than :days
83
92
  def older_than
84
93
  where( 'finished_at < ?', Date.today - 10 )
@@ -65,7 +65,7 @@ def path
65
65
  if parent.nil?
66
66
  name
67
67
  else
68
- "%s/%s" % [ parent.name, name ]
68
+ "%s/%s" % [ parent.path, name ]
69
69
  end
70
70
  end
71
71
 
@@ -46,6 +46,7 @@ def my_initialize()
46
46
 
47
47
  @long_description = nil
48
48
  @description = nil
49
+ @last_success = nil
49
50
  end
50
51
 
51
52
  #
@@ -150,7 +151,6 @@ def build_system_required
150
151
 
151
152
  # Return true if the last build failed for whatever reason
152
153
  def broken?
153
- lastlog = BuildTool::History::CommandLog.last_by_module( name )
154
154
  return true if lastlog.empty?
155
155
  lastlog[0].module_logs.where( :module => name ).each do |e|
156
156
  if e.state != History::ModuleLog::FINISHED_SUCCESSFUL
@@ -262,9 +262,13 @@ def source_directory
262
262
  end
263
263
  alias source_directory_required source_directory
264
264
 
265
+ # Return the logfile of the last compilation attempt
266
+ def lastlog
267
+ return BuildTool::History::CommandLog.last_by_module( name )
268
+ end
269
+
265
270
  # Returns a current state in string format
266
271
  def state
267
- lastlog = BuildTool::History::CommandLog.last_by_module( name )
268
272
  return 'UNKNOWN' if lastlog.empty?
269
273
  lastlog[0].module_logs.where( :module => name ).each do |e|
270
274
  if e.state != History::ModuleLog::FINISHED_SUCCESSFUL
@@ -276,7 +280,6 @@ def state
276
280
 
277
281
  # Return the current state as one char.
278
282
  def state_char
279
- lastlog = BuildTool::History::CommandLog.last_by_module( name )
280
283
  return '?' if lastlog.empty?
281
284
  lastlog[0].module_logs.where( :module => name ).each do |e|
282
285
  if e.state != History::ModuleLog::FINISHED_SUCCESSFUL
@@ -286,6 +289,17 @@ def state_char
286
289
  return History::ModuleLog::state_char( History::ModuleLog::FINISHED_SUCCESSFUL )
287
290
  end
288
291
 
292
+ def last_success
293
+ return @last_success if @last_success
294
+ lastlog = BuildTool::History::CommandLog.last_success_by_module( name )
295
+ if lastlog.nil?
296
+ @last_success = DateTime.new
297
+ else
298
+ @last_success = lastlog[:finished_at]
299
+ end
300
+ return @last_success
301
+ end
302
+
289
303
  def active_char
290
304
  if active?
291
305
  ANSI::Code.green { "A" }
@@ -104,9 +104,9 @@ def apply_patches( patches )
104
104
 
105
105
  end
106
106
 
107
- def clone
108
- fetch()
109
- rebase()
107
+ def clone( verbose = false )
108
+ fetch( verbose )
109
+ rebase( verbose )
110
110
  0
111
111
  end
112
112
 
@@ -110,7 +110,7 @@ def checkedout?
110
110
  return true
111
111
  end
112
112
 
113
- def clone
113
+ def clone( verbose = false )
114
114
  if local_path_exist?
115
115
  raise GitSvnError, "Failed to create repository at '#{local_path}': Path exists"
116
116
  end
@@ -121,7 +121,7 @@ def clone
121
121
  raise GitSvnError, "Error while initializing the repo `git svn init '#{config.repository}/#{remote_path}'`: #{$?}"
122
122
  end
123
123
 
124
- fetch( revision: "HEAD" )
124
+ fetch(false, "HEAD")
125
125
  end
126
126
 
127
127
  def configure
@@ -131,11 +131,9 @@ def configure
131
131
  # Fetch from +repository+
132
132
  #
133
133
  # Initializes the local clone if it does not exist.
134
- def fetch( verbose = false, options = {} )
135
- revision = options[:revision] || nil
136
-
134
+ def fetch( verbose = false, revision = nil )
137
135
  if !checkedout? and !$noop # Beware of looping
138
- clone
136
+ clone( verbose )
139
137
  else
140
138
  # clone() calls those methods.
141
139
  git.check_config
@@ -366,7 +366,7 @@ def check_config
366
366
  end
367
367
 
368
368
  if val.push_server and val.push_url
369
- if val.push_url != gitconfig["remote.#{name}.pushurl"].nil?
369
+ if val.push_url != gitconfig["remote.#{name}.pushurl"]
370
370
  if git( "remote set-url --push #{name} #{val.push_url}" ) != 0
371
371
  raise GitError, "Error while initializing the repo `git remote add #{name} #{val.url}`: #{$?}"
372
372
  end
@@ -26,5 +26,5 @@ def recipe_version()
26
26
 
27
27
  end
28
28
 
29
- VERSION = Version.new( 0, 6, 1 )
29
+ VERSION = Version.new( 0, 6, 2 )
30
30
  end
data/tasks/rdoc.rake CHANGED
@@ -1,7 +1,7 @@
1
1
  require 'yard'
2
2
 
3
3
  YARD::Rake::YardocTask.new do |t|
4
- t.files = ['lib/**/*.rb']
4
+ t.files = ['lib/**/*.rb', '-', 'README.rdoc', 'History.rdoc' ]
5
5
  # t.options = [] -> see .yardopts
6
6
  t.name = 'doc'
7
7
  end
@@ -72,4 +72,18 @@ def setup
72
72
 
73
73
  end
74
74
 
75
+ test 'Nested feature definitione' do
76
+ assert_nothing_raised() { @parser.parse_string <<-EOF }
77
+ feature "test_root"
78
+ feature "test_child1"
79
+ feature "test_grandchild1"
80
+ end
81
+ end
82
+ end
83
+ EOF
84
+ assert( @configuration.feature( 'test_root' ) )
85
+ assert( @configuration.feature( 'test_root/test_child1' ) )
86
+ assert( @configuration.feature( 'test_root/test_child1/test_grandchild1' ) )
87
+ end
88
+
75
89
  end # class TestParserFeatureTest
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.6.1
4
+ version: 0.6.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-04-04 00:00:00.000000000 Z
12
+ date: 2012-04-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: logging
16
- requirement: &5733960 !ruby/object:Gem::Requirement
16
+ requirement: &5733800 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 1.6.0
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *5733960
24
+ version_requirements: *5733800
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: activerecord
27
- requirement: &5733340 !ruby/object:Gem::Requirement
27
+ requirement: &5733160 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 3.2.1
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *5733340
35
+ version_requirements: *5733160
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: sqlite3
38
- requirement: &5732660 !ruby/object:Gem::Requirement
38
+ requirement: &5732520 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 1.3.5
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *5732660
46
+ version_requirements: *5732520
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: ansi
49
- requirement: &5731740 !ruby/object:Gem::Requirement
49
+ requirement: &5731580 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: 1.4.2
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *5731740
57
+ version_requirements: *5731580
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: grit
60
- requirement: &5731220 !ruby/object:Gem::Requirement
60
+ requirement: &5731060 !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: *5731220
68
+ version_requirements: *5731060
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: racc
71
- requirement: &5730680 !ruby/object:Gem::Requirement
71
+ requirement: &5730500 !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: *5730680
79
+ version_requirements: *5730500
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: rexical
82
- requirement: &5730220 !ruby/object:Gem::Requirement
82
+ requirement: &5730040 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ! '>='
@@ -87,10 +87,10 @@ dependencies:
87
87
  version: 1.0.5
88
88
  type: :development
89
89
  prerelease: false
90
- version_requirements: *5730220
90
+ version_requirements: *5730040
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: rake
93
- requirement: &5759100 !ruby/object:Gem::Requirement
93
+ requirement: &5758900 !ruby/object:Gem::Requirement
94
94
  none: false
95
95
  requirements:
96
96
  - - ! '>='
@@ -98,10 +98,10 @@ dependencies:
98
98
  version: 0.9.2
99
99
  type: :development
100
100
  prerelease: false
101
- version_requirements: *5759100
101
+ version_requirements: *5758900
102
102
  - !ruby/object:Gem::Dependency
103
103
  name: yard
104
- requirement: &5758600 !ruby/object:Gem::Requirement
104
+ requirement: &5758400 !ruby/object:Gem::Requirement
105
105
  none: false
106
106
  requirements:
107
107
  - - ! '>='
@@ -109,10 +109,10 @@ dependencies:
109
109
  version: 0.7.5
110
110
  type: :development
111
111
  prerelease: false
112
- version_requirements: *5758600
112
+ version_requirements: *5758400
113
113
  - !ruby/object:Gem::Dependency
114
114
  name: turn
115
- requirement: &5757980 !ruby/object:Gem::Requirement
115
+ requirement: &5757740 !ruby/object:Gem::Requirement
116
116
  none: false
117
117
  requirements:
118
118
  - - ! '>='
@@ -120,7 +120,7 @@ dependencies:
120
120
  version: '0.9'
121
121
  type: :development
122
122
  prerelease: false
123
- version_requirements: *5757980
123
+ version_requirements: *5757740
124
124
  description: ! "\n The tool helps \n\n ...\n "
125
125
  email:
126
126
  - info@michael-jansen.biz