build-tool 0.2 → 0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (83) hide show
  1. data.tar.gz.sig +0 -0
  2. data/History.txt +14 -0
  3. data/Manifest.txt +5 -36
  4. data/lib/build-tool.rb +1 -1
  5. data/lib/build-tool/build-system/autoconf.rb +26 -11
  6. data/lib/build-tool/build-system/base.rb +7 -0
  7. data/lib/build-tool/build-system/custom.rb +0 -4
  8. data/lib/build-tool/build-system/qt.rb +6 -0
  9. data/lib/build-tool/cfg/lexer.rb +49 -0
  10. data/lib/build-tool/cfg/lexer.rex +19 -0
  11. data/lib/build-tool/cfg/node.rb +4 -0
  12. data/lib/build-tool/cfg/parser.rb +495 -401
  13. data/lib/build-tool/cfg/parser.y +34 -2
  14. data/lib/build-tool/cfg/visitor.rb +46 -6
  15. data/lib/build-tool/commands.rb +7 -4
  16. data/lib/build-tool/commands/build.rb +3 -0
  17. data/lib/build-tool/commands/configure.rb +5 -0
  18. data/lib/build-tool/commands/ctags.rb +6 -0
  19. data/lib/build-tool/commands/environments/list.rb +5 -0
  20. data/lib/build-tool/commands/environments/set.rb +6 -0
  21. data/lib/build-tool/commands/fetch.rb +8 -0
  22. data/lib/build-tool/commands/files.rb +7 -0
  23. data/lib/build-tool/commands/gc.rb +4 -0
  24. data/lib/build-tool/commands/history.rb +7 -0
  25. data/lib/build-tool/commands/info.rb +2 -0
  26. data/lib/build-tool/commands/install.rb +3 -1
  27. data/lib/build-tool/commands/lsfeatures.rb +3 -0
  28. data/lib/build-tool/commands/modules/info.rb +15 -0
  29. data/lib/build-tool/commands/modules/list.rb +8 -3
  30. data/lib/build-tool/commands/modules/shell.rb +1 -1
  31. data/lib/build-tool/commands/rebase.rb +6 -0
  32. data/lib/build-tool/commands/recipes.rb +0 -4
  33. data/lib/build-tool/commands/recipes/add.rb +45 -0
  34. data/lib/build-tool/commands/recipes/incoming.rb +66 -0
  35. data/lib/build-tool/commands/recipes/info.rb +4 -0
  36. data/lib/build-tool/commands/recipes/install.rb +11 -1
  37. data/lib/build-tool/commands/recipes/list.rb +2 -0
  38. data/lib/build-tool/configuration.rb +3 -0
  39. data/lib/build-tool/module.rb +27 -3
  40. data/lib/build-tool/vcs/archive.rb +58 -30
  41. data/lib/build-tool/vcs/base.rb +14 -0
  42. data/lib/build-tool/vcs/mercurial.rb +113 -0
  43. data/lib/build-tool/vcs/svn.rb +20 -2
  44. data/lib/mj/error.rb +7 -0
  45. data/lib/mj/vcs/git.rb +133 -0
  46. metadata +9 -40
  47. metadata.gz.sig +2 -3
  48. data/recipes/kde/custom/qt/qtscriptgenerator/compile.sh +0 -77
  49. data/recipes/kde/custom/qt/qtscriptgenerator/configure.sh +0 -70
  50. data/recipes/kde/custom/qt/qtscriptgenerator/install.sh +0 -39
  51. data/recipes/kde/custom/scripting/pyqt4/compile.sh +0 -10
  52. data/recipes/kde/custom/scripting/pyqt4/configure.sh +0 -14
  53. data/recipes/kde/custom/scripting/pyqt4/install.sh +0 -10
  54. data/recipes/kde/custom/scripting/sip/compile.sh +0 -10
  55. data/recipes/kde/custom/scripting/sip/configure.sh +0 -13
  56. data/recipes/kde/custom/scripting/sip/install.sh +0 -10
  57. data/recipes/kde/files/finish_installation.sh +0 -16
  58. data/recipes/kde/files/kde4.desktop +0 -22
  59. data/recipes/kde/files/xsession +0 -93
  60. data/recipes/kde/info.yaml +0 -10
  61. data/recipes/kde/kde-bindings.recipe +0 -22
  62. data/recipes/kde/kde-core.recipe +0 -104
  63. data/recipes/kde/kde-devel.recipe +0 -38
  64. data/recipes/kde/kde-finance.recipe +0 -17
  65. data/recipes/kde/kde-graphics.recipe +0 -27
  66. data/recipes/kde/kde-kdevelop.recipe +0 -116
  67. data/recipes/kde/kde-l10n.recipe +0 -14
  68. data/recipes/kde/kde-multimedia.recipe +0 -31
  69. data/recipes/kde/kde-network.recipe +0 -55
  70. data/recipes/kde/kde-office.recipe +0 -28
  71. data/recipes/kde/kde-plasma.recipe +0 -117
  72. data/recipes/kde/kde-qt.recipe +0 -122
  73. data/recipes/kde/kde-scripting.recipe +0 -63
  74. data/recipes/kde/kde-support.recipe +0 -73
  75. data/recipes/kde/kde-utils.recipe +0 -22
  76. data/recipes/kde/kde-webdev.recipe +0 -41
  77. data/recipes/kde/recipe +0 -155
  78. data/recipes/kde/recipe-local +0 -146
  79. data/recipes/kde/settings.yaml +0 -69
  80. data/recipes/kde43/info.yaml +0 -10
  81. data/recipes/kde43/recipe +0 -256
  82. data/recipes/kde43/recipe-local +0 -146
  83. data/recipes/kde43/settings.yaml +0 -32
@@ -1,6 +1,7 @@
1
1
  class BuildTool::Cfg::Parser < BuildTool::Cfg::Lexer
2
2
 
3
3
  token APPEND
4
+ token APPLY
4
5
  token ARCHIVE
5
6
  token BUILD_PREFIX
6
7
  token BUILD_SYSTEM
@@ -23,7 +24,9 @@ class BuildTool::Cfg::Parser < BuildTool::Cfg::Lexer
23
24
  token LOG_DIRECTORY
24
25
  token LONG
25
26
  token MODULE
27
+ token ONLY
26
28
  token OPTION
29
+ token PATCH
27
30
  token PATH
28
31
  token PREPEND
29
32
  token PROTOCOL
@@ -35,6 +38,7 @@ class BuildTool::Cfg::Parser < BuildTool::Cfg::Lexer
35
38
  token SHORT
36
39
  token SSH_KEY
37
40
  token STRING
41
+ token SVN
38
42
  token TEMPLATE
39
43
  token TOKEN
40
44
  token TRACK_BRANCH
@@ -96,6 +100,7 @@ rule
96
100
 
97
101
  vcs_declaration
98
102
  : git_declaration { result = val[0]; }
103
+ | svn_declaration { result = val[0]; }
99
104
  | git_svn_declaration { result = val[0]; }
100
105
  | archive_declaration { result = val[0]; }
101
106
  ;
@@ -165,7 +170,7 @@ rule
165
170
 
166
171
  feature_statement
167
172
  : statement { result = val.flatten; }
168
- | LONG DESCRIPTION STRING { result = LongDescriptionNode.new( val[2] ); }
173
+ | LONG DESCRIPTION multiline_string { result = LongDescriptionNode.new( val[2] ); }
169
174
  | SHORT DESCRIPTION STRING { result = ShortDescriptionNode.new( val[2] ); }
170
175
  ;
171
176
 
@@ -237,6 +242,8 @@ rule
237
242
  | USE ENVIRONMENT identifier { result = UseEnvironmentNode.new( val[2] ); }
238
243
  | USE REPOSITORY identifier { result = UseRepositoryNode.new( val[2] ); }
239
244
  | USE VCS identifier { result = UseVcsNode.new( val[2] ); }
245
+ | LONG DESCRIPTION multiline_string { result = LongDescriptionNode.new( val[2] ); }
246
+ | DESCRIPTION STRING { result = ShortDescriptionNode.new( val[1] ); }
240
247
  | build_system_declaration { result = val[0]; }
241
248
  | vcs_declaration { result = val[0]; }
242
249
  | repository_declaration { result = val[0]; }
@@ -245,7 +252,8 @@ rule
245
252
  | BUILD_PREFIX STRING { result = ModuleBuildPrefixNode.new( val[1] ); }
246
253
  | REMOTE_PATH STRING { result = ModuleRemotePathNode.new( val[1] ); }
247
254
  | LOCAL_PATH STRING { result = ModuleLocalPathNode.new( val[1] ); }
248
- | TEMPLATE { result = ModuleTemplateNode.new(); }
255
+ | TEMPLATE { result = ModuleTemplateNode.new(); }
256
+ | APPLY PATCH STRING { result = ApplyPatchesNode.new(val[2]); }
249
257
  ;
250
258
 
251
259
  #
@@ -303,6 +311,30 @@ rule
303
311
  : FILE STRING { result = SshKeyFileNode.new( val[1] ); }
304
312
  ;
305
313
 
314
+ #
315
+ ### SVN CONFIGURATION
316
+ #
317
+ svn_declaration
318
+ : VCS SVN svn_statements END { result = SvnDeclarationNode.new( val[2] ); }
319
+ ;
320
+
321
+ svn_statements
322
+ : /* empty */
323
+ | svn_statement svn_statements { result = val.flatten; }
324
+ ;
325
+
326
+ svn_statement
327
+ : ONLY STRING { result = SvnCheckoutOnlyNode.new(val[1]); }
328
+ ;
329
+
330
+ #
331
+ ### HELPER
332
+ #
333
+ multiline_string
334
+ : /* empty */
335
+ | multiline_string STRING { result = val[0] ? val[0] + "\n" + val[1] : val[1]; }
336
+ ;
337
+
306
338
  end # class BuildTool::Cfg::GitParser
307
339
 
308
340
  ---- header ----
@@ -136,11 +136,6 @@ module BuildTool; module Cfg;
136
136
  node.accept( visitor )
137
137
  end
138
138
 
139
- def visit_GitDeclarationNode( node )
140
- visitor = GitDeclarationNodeVisitor.new( configuration )
141
- return node.accept( visitor )
142
- end
143
-
144
139
  def visit_IncludeNode( node )
145
140
  visitor = IncludeNodeVisitor.new( configuration )
146
141
  node.accept( visitor )
@@ -266,7 +261,6 @@ module BuildTool; module Cfg;
266
261
 
267
262
  def visit_LongDescriptionNode( node )
268
263
  if @feature.long_description
269
- puts @feature.description
270
264
  logger.warn "Overwriting long description for feature #{@feature.name}"
271
265
  end
272
266
  @feature.long_description = node.values
@@ -376,6 +370,10 @@ module BuildTool; module Cfg;
376
370
  @module = nil
377
371
  end
378
372
 
373
+ def visit_ApplyPatchesNode( node )
374
+ @module.patches << node.value
375
+ end
376
+
379
377
  def visit_ArchiveDeclarationNode( node )
380
378
  if @module.vcs_configuration and @module.vcs_configuration.name == "archive"
381
379
  vcs = @module.vcs_configuration.dup
@@ -400,6 +398,13 @@ module BuildTool; module Cfg;
400
398
  @module.build_system.module = @module
401
399
  end
402
400
 
401
+ def visit_LongDescriptionNode( node )
402
+ if @module.long_description
403
+ logger.warn "Overwriting long description for feature #{@module.name}"
404
+ end
405
+ @module.long_description = node.values
406
+ end
407
+
403
408
  def visit_EnvironmentDeclarationNode( node )
404
409
  visitor = EnvironmentDeclarationNodeVisitor.new( configuration )
405
410
  @module.environment = node.accept( visitor )
@@ -491,6 +496,24 @@ module BuildTool; module Cfg;
491
496
  @module.repository = node.accept( visitor )
492
497
  end
493
498
 
499
+ def visit_ShortDescriptionNode( node )
500
+ if !@module.description.nil?
501
+ logger.warn "Overwriting short description for module #{@module.name}"
502
+ end
503
+ @module.description = node.values
504
+ end
505
+
506
+ def visit_SvnDeclarationNode( node )
507
+ if @module.vcs_configuration and @module.vcs_configuration.name == "svn"
508
+ vcs = @module.vcs_configuration.dup
509
+ else
510
+ vcs = BuildTool::VCS::SvnConfiguration.new
511
+ end
512
+ @module.vcs_configuration = vcs
513
+ visitor = SvnDeclarationNodeVisitor.new( configuration, vcs )
514
+ node.accept( visitor )
515
+ end
516
+
494
517
  def visit_UseBuildSystemNode( node )
495
518
  @module.build_system = configuration.build_system( node.value ).dup
496
519
  @module.build_system.module = @module
@@ -624,6 +647,23 @@ module BuildTool; module Cfg;
624
647
 
625
648
  end
626
649
 
650
+ class SvnDeclarationNodeVisitor < GitDeclarationNodeVisitor
651
+
652
+ def initialize( configuration, vcs )
653
+ super( configuration, vcs )
654
+ end
655
+
656
+ def visit_SvnDeclarationNode( node )
657
+ visit_nodes( node.values )
658
+ return @vcs
659
+ end
660
+
661
+ def visit_SvnCheckoutOnlyNode( node )
662
+ @vcs.only = node.value.split( / +/ )
663
+ end
664
+
665
+ end # class SvnDeclarationNodeVisitor
666
+
627
667
  end; end
628
668
 
629
669
 
@@ -41,6 +41,7 @@ module BuildTool; module Commands;
41
41
 
42
42
  def_attribute :name
43
43
  def_attribute :description
44
+ def_attribute :long_description
44
45
  def_attribute :cmdalias
45
46
 
46
47
  end
@@ -57,6 +58,10 @@ module BuildTool; module Commands;
57
58
  self.class.description
58
59
  end
59
60
 
61
+ def long_description
62
+ self.class.long_description || nil
63
+ end
64
+
60
65
  def self.included( klass )
61
66
  klass.extend( ClassMethods )
62
67
  end
@@ -86,9 +91,6 @@ module BuildTool; module Commands;
86
91
  attr_accessor :cmd
87
92
 
88
93
  def initialize(parent = nil)
89
- @options = OptionParser.new
90
- @options.set_program_name( name )
91
- initialize_options
92
94
  @skip_command = false
93
95
  @parent = parent
94
96
  @cmd = nil
@@ -206,6 +208,7 @@ module BuildTool; module Commands;
206
208
  def execute( args )
207
209
  @options = OptionParser.new
208
210
  @options.set_program_name( name )
211
+ @options.separator long_description if long_description
209
212
 
210
213
  @parsing = true
211
214
  initialize_options
@@ -257,7 +260,7 @@ module BuildTool; module Commands;
257
260
  # @return [String] The commands full name
258
261
  #
259
262
  def fullname
260
- if parent.fullname
263
+ if parent && parent.fullname
261
264
  return parent.fullname + " " + name
262
265
  else
263
266
  return name
@@ -10,6 +10,7 @@ module BuildTool; module Commands;
10
10
 
11
11
  name "build"
12
12
  description "Build a module."
13
+ long_description [ "Build the given modules. This is the all in one interface to build-tool." ]
13
14
 
14
15
  # Log this command if $noop is not active
15
16
  def log?
@@ -17,7 +18,9 @@ module BuildTool; module Commands;
17
18
  end
18
19
 
19
20
  def initialize_options
21
+ @options.banner = "Usage: #{Pathname.new($0).basename} #{self.fullname} [MODULES]..."
20
22
 
23
+ @options.separator "Options:"
21
24
  @clean = false
22
25
  @configure = false
23
26
  @from_scratch = false
@@ -13,6 +13,8 @@ module BuildTool; module Commands;
13
13
 
14
14
  name "configure"
15
15
  description "configure the module"
16
+ long_description [ "Invokes the configuration phase for the specified modules." ]
17
+
16
18
 
17
19
  # Log this command if $noop is not active
18
20
  def log?
@@ -21,10 +23,13 @@ module BuildTool; module Commands;
21
23
 
22
24
  def initialize_options
23
25
 
26
+ @options.banner = "Usage: #{Pathname.new($0).basename} #{self.fullname} MODULES..."
24
27
  @rmcache = false
25
28
  @from_scratch = false
26
29
  @clean = false
27
30
 
31
+ @options.separator "Options:"
32
+
28
33
  options.on( "--[no-]clean", "Make clean before building." ) { |t|
29
34
  @clean = t
30
35
  }
@@ -13,6 +13,12 @@ module BuildTool; module Commands;
13
13
 
14
14
  name "ctags"
15
15
  description "run ctags on the module."
16
+ long_description [ "Invoke ctags for the specified MODULES." ]
17
+
18
+ def initialize_options
19
+ @options.banner = "Usage: #{Pathname.new($0).basename} #{self.fullname} MODULES..."
20
+ super
21
+ end
16
22
 
17
23
  def applicable?
18
24
  BuildTool::Application.instance.name != "build-tool"
@@ -9,13 +9,18 @@ module BuildTool; module Commands; module Environments
9
9
 
10
10
  name "list"
11
11
  description "List all available environments in alphabetical order."
12
+ long_description [ "Shows the list of all environments of the current recipe."]
12
13
  cmdalias "lsenv"
13
14
 
14
15
  def initialize_options
16
+ @options.banner = "Usage: #{Pathname.new($0).basename} #{self.fullname}"
17
+
18
+ @options.separator "Options:"
15
19
  @all = false
16
20
  options.on( "--all", "Show inactive environments." ) { |t|
17
21
  @all = true
18
22
  }
23
+ super
19
24
  end
20
25
 
21
26
  def do_execute( args )
@@ -9,6 +9,7 @@ module BuildTool; module Commands; module Environments
9
9
 
10
10
  name "set"
11
11
  description "Open a shell with the environment set."
12
+ long_description "Opens a new shell with the exact environment used by build-tool for the script."
12
13
 
13
14
  def do_execute( args )
14
15
  case args.length
@@ -25,6 +26,11 @@ module BuildTool; module Commands; module Environments
25
26
  return env.shell
26
27
  end
27
28
 
29
+ def initialize_options
30
+ @options.banner = "Usage: #{Pathname.new($0).basename} #{self.fullname} MODULE"
31
+ super
32
+ end
33
+
28
34
  end # class
29
35
 
30
36
  end; end; end # module BuildTool::Commands::Modules
@@ -13,6 +13,9 @@ module BuildTool; module Commands;
13
13
 
14
14
  name "fetch"
15
15
  description "fetch remote changes (if applicable)"
16
+ long_description [ "Invoke the fetch phase for the given modules. It depends on the modules",
17
+ "VCS if this command has any effect." ]
18
+
16
19
 
17
20
  # Log this command if $noop is not active
18
21
  def log?
@@ -23,6 +26,11 @@ module BuildTool; module Commands;
23
26
  BuildTool::Application.instance.name != "build-tool"
24
27
  end
25
28
 
29
+ def initialize_options
30
+ @options.banner = "Usage: #{Pathname.new($0).basename} #{self.fullname} MODULES..."
31
+ super
32
+ end
33
+
26
34
  def is_module_ready?( mod )
27
35
  isready = true
28
36
  isready &= mod.prepare_for_vcs_access
@@ -10,6 +10,8 @@ module BuildTool; module Commands;
10
10
 
11
11
  name "files"
12
12
  description "Get the content of some helper files."
13
+ long_description [ "Shows the list of files provided with this recipe without parameters",
14
+ "or the content of the given file if one is specified." ]
13
15
 
14
16
  def applicable?
15
17
  BuildTool::Application.instance.name != "build-tool"
@@ -30,6 +32,11 @@ module BuildTool; module Commands;
30
32
  end
31
33
  end
32
34
 
35
+ def initialize_options
36
+ @options.banner = "Usage: #{Pathname.new($0).basename} #{self.fullname} [FILENAME]"
37
+ super
38
+ end
39
+
33
40
  def print_file_list
34
41
  recipe = Application::instance.recipe
35
42
  files_dir = recipe.files_path
@@ -9,8 +9,12 @@ module BuildTool; module Commands;
9
9
 
10
10
  name "gc"
11
11
  description "Remove old stuff"
12
+ long_description [ "Invokes maintenance actions. The history db is purged from entries older",
13
+ "than 10 days. If supplied do garbage collection for the modules too.",
14
+ "What that means is subject to the modules. See with -vvvv."]
12
15
 
13
16
  def initialize_options
17
+ @options.banner = "Usage: #{Pathname.new($0).basename} #{self.fullname} [MODULE|GROUP]..."
14
18
  super
15
19
  end
16
20
 
@@ -9,9 +9,16 @@ module BuildTool; module Commands;
9
9
 
10
10
  name "history"
11
11
  description "show command history"
12
+ long_description [ "Query the command history",
13
+ " NO PARAM: Show the history list",
14
+ " NUMBER: Show detailed information about entry NUMBER",
15
+ " +NUMBER: Show detailed information about NUMBER next to last entry",
16
+ " MODULE: Show the last three commands on MODULE" ]
12
17
 
13
18
  def initialize_options
19
+ @options.banner = "Usage: #{Pathname.new($0).basename} #{self.fullname} [NUMBER|+NUMBER|MODULE]"
14
20
 
21
+ @options.separator "Options:"
15
22
  # Show detailed history. Add start time, duration and success/failure
16
23
  @long = false
17
24
  options.on( "-l", "--long", "Use long list format." ) { |t|
@@ -9,8 +9,10 @@ module BuildTool; module Commands;
9
9
 
10
10
  name "info"
11
11
  description "show info"
12
+ long_description [ "Show information about the currently used recipe" ]
12
13
 
13
14
  def initialize_options
15
+ @options.banner = "Usage: #{Pathname.new($0).basename} #{self.fullname}"
14
16
  super
15
17
  end
16
18
 
@@ -13,6 +13,7 @@ module BuildTool; module Commands;
13
13
 
14
14
  name "install"
15
15
  description "install the module"
16
+ long_description [ "Invokes the installation phase for the specified modules." ]
16
17
 
17
18
  # Log this command if $noop is not active
18
19
  def log?
@@ -20,9 +21,10 @@ module BuildTool; module Commands;
20
21
  end
21
22
 
22
23
  def initialize_options
24
+ @options.banner = "Usage: #{Pathname.new($0).basename} #{self.fullname} MODULES..."
23
25
 
26
+ @options.separator "Options:"
24
27
  @fast = false
25
-
26
28
  options.on( "--fast", "Fast install. No compile (if supported)" ) { |t|
27
29
  @fast = t
28
30
  }
@@ -9,8 +9,11 @@ module BuildTool; module Commands;
9
9
 
10
10
  name "lsfeatures"
11
11
  description "List all available features."
12
+ long_description [ "Shows the list of all features available with the current recipe or",
13
+ "detailed info about one or more features given as arguments." ]
12
14
 
13
15
  def initialize_options
16
+ @options.banner = "Usage: #{Pathname.new($0).basename} #{self.fullname} [FEATURES]..."
14
17
  super
15
18
  end
16
19
 
@@ -11,6 +11,15 @@ module BuildTool; module Commands; module Modules
11
11
  description "show detailed information about modules."
12
12
 
13
13
  def do_execute_module( mod )
14
+ if mod.description
15
+ say mod.description
16
+ say ""
17
+ else
18
+ say "No description specified to the module"
19
+ say ""
20
+ end
21
+ say mod.long_description if mod.long_description
22
+
14
23
  say "Active: #{mod.active?}"
15
24
 
16
25
  if mod.repository
@@ -18,6 +27,7 @@ module BuildTool; module Commands; module Modules
18
27
  if mod.repository.sshkey
19
28
  say " SSH Key: '#{mod.repository.sshkey.name}' (#{mod.repository.sshkey.file})"
20
29
  end
30
+ say "Apply Patches: #{mod.patches.join(", ")}"
21
31
  else
22
32
  say "Repository: not configured"
23
33
  end
@@ -77,6 +87,11 @@ module BuildTool; module Commands; module Modules
77
87
  return 0
78
88
  end
79
89
 
90
+ def initialize_options
91
+ @options.banner = "Usage: #{Pathname.new($0).basename} #{self.fullname} MODULES..."
92
+ super
93
+ end
94
+
80
95
  end # class Info
81
96
 
82
97
  end; end; end # module BuildTool::Commands::Modules