autoproj 1.6.0.rc4 → 1.6.0.rc5

Sign up to get free protection for your applications and to get access to all the features.
@@ -43,29 +43,25 @@ module Autoproj
43
43
  Autoproj.change_option('automatic_osdeps', mode, true)
44
44
  end
45
45
 
46
- if Autoproj.has_config_key?("automatic_osdeps")
47
- doc_string = "Should autoproj handle the OS package installation automatically (yes, no, wait or ask) ?"
48
- else
49
- # Ask the user for the automatic_osdeps option
50
- doc_string =<<-EOT
51
- #{Autoproj.color("Should autoproj handle the OS package installation automatically (yes, no, wait or ask) ?", :bold)}
52
- If you say "no", the list of OS dependencies that need to be installed will be listed,
53
- and autoproj will go on, assuming that you have installed them yourself. If you say
54
- "ask", you will be prompted each time a package needs to be installed. Finally, if you
55
- say "wait", autoproj will simply wait for you to press ENTER to continue after it prompted
56
- you for the dependencies.
57
-
58
- This value can be changed anytime by calling an autoproj operation with the --reconfigure
59
- option (e.g. autoproj update --reconfigure). Moreover, the "autoproj osdeps" call will
60
- always allow you to install OS dependencies through autoproj.
61
-
62
- EOT
63
- doc_string = doc_string.strip
64
- end
46
+ short_doc = "Should autoproj handle the OS package installation automatically (yes, no, wait or ask) ?"
47
+ long_doc =<<-EOT
48
+ * if you say "yes", the OS dependencies will be handled by autoproj.
49
+ * if you say "no", the list of OS dependencies that need to be installed will be
50
+ listed, and autoproj will go on, assuming that you have installed them yourself.
51
+ * if you say "ask", you will be prompted each time a package needs to be installed.
52
+ * if you say "wait", autoproj will simply wait for you to press ENTER to continue
53
+ after it prompted you for the dependencies.
54
+
55
+ This value can be changed anytime by calling an autoproj operation
56
+ with the --reconfigure option (e.g. autoproj update --reconfigure).
57
+ Moreover, the "autoproj osdeps" call will always allow you to install
58
+ OS dependencies through autoproj.
59
+ EOT
60
+ long_doc = long_doc.strip
65
61
 
66
62
  Autoproj.configuration_option 'automatic_osdeps', 'string',
67
63
  :default => 'yes',
68
- :doc => doc_string do |value|
64
+ :doc => [short_doc, long_doc] do |value|
69
65
  begin
70
66
  Autoproj::BuildOption.validate_boolean(value, Hash.new)
71
67
  rescue Autoproj::InputError
@@ -160,6 +156,9 @@ module Autoproj
160
156
  # First things first, see if we need to update ourselves
161
157
  if Autoproj.osdeps.install(%w{autobuild autoproj})
162
158
  # We updated autobuild or autoproj themselves ... Restart !
159
+ #
160
+ # ...But first save the configuration (!)
161
+ Autoproj.save_config
163
162
  require 'rbconfig'
164
163
  ruby = RbConfig::CONFIG['RUBY_INSTALL_NAME']
165
164
  exec(ruby, $0, *ARGV)
@@ -561,7 +560,7 @@ where 'mode' is one of:
561
560
  -- Status & Update
562
561
  envsh: update the env.sh script
563
562
  status: displays the state of the packages w.r.t. their source VCS
564
- list-sets: list all available package sets
563
+ list: list all available packages
565
564
  update: only import/update packages, do not build them
566
565
  update-config: only update the configuration
567
566
 
@@ -738,7 +737,7 @@ where 'mode' is one of:
738
737
  Autobuild.do_update = true
739
738
  @update_os_dependencies = false
740
739
  Autobuild.do_build = false
741
- when "list-sets"
740
+ when "list", "list-sets"
742
741
  @only_config = true
743
742
  @display_configuration = true
744
743
  Autobuild.do_update = false
@@ -970,6 +969,8 @@ manifest_source:
970
969
  FileUtils.cp_r ENV['GEM_HOME'], ".gems"
971
970
  ENV['GEM_HOME'] = File.join(Dir.pwd, ".gems")
972
971
 
972
+ Autoproj.save_config
973
+
973
974
  require 'rbconfig'
974
975
  ruby = RbConfig::CONFIG['RUBY_INSTALL_NAME']
975
976
  exec ruby, $0, *ARGV
@@ -937,8 +937,8 @@ module Autoproj
937
937
  dest = File.readlink(symlink_dest)
938
938
  if dest != source.raw_local_dir
939
939
  FileUtils.rm_f symlink_dest
940
+ FileUtils.ln_sf source.raw_local_dir, symlink_dest
940
941
  end
941
- FileUtils.ln_sf source.raw_local_dir, symlink_dest
942
942
  else
943
943
  FileUtils.rm_f symlink_dest
944
944
  FileUtils.ln_sf source.raw_local_dir, symlink_dest
@@ -18,18 +18,36 @@ module Autoproj
18
18
  end
19
19
  end
20
20
 
21
+ def short_doc
22
+ if short_doc = options[:short_doc]
23
+ short_doc
24
+ elsif doc = options[:doc]
25
+ if doc.respond_to?(:to_ary) then doc.first
26
+ else doc
27
+ end
28
+ else "#{name} (no documentation for this option)"
29
+ end
30
+ end
31
+
21
32
  def doc
22
- options[:doc] || "#{name} (no documentation for this option)"
33
+ doc = (options[:doc] || "#{name} (no documentation for this option)")
34
+ if doc.respond_to?(:to_ary) # multi-line
35
+ first_line = Autoproj.color(doc[0, 1], :bold)
36
+ remaining = doc[1..-1].join("\n").split("\n").join("\n ")
37
+ first_line + "\n " + remaining
38
+ else
39
+ doc
40
+ end
23
41
  end
24
42
 
25
- def ask(current_value)
43
+ def ask(current_value, doc = nil)
26
44
  default_value =
27
45
  if current_value then current_value.to_s
28
46
  elsif options[:default] then options[:default].to_str
29
47
  else ''
30
48
  end
31
49
 
32
- STDOUT.print " #{doc} [#{default_value}] "
50
+ STDOUT.print " #{doc || self.doc} [#{default_value}] "
33
51
  STDOUT.flush
34
52
  answer = STDIN.readline.chomp
35
53
  if answer == ''
@@ -92,7 +110,7 @@ module Autoproj
92
110
  value = configure(key)
93
111
  else
94
112
  if !seen
95
- doc = @declared_options[key].doc
113
+ doc = @declared_options[key].short_doc
96
114
  if doc[-1, 1] != "?"
97
115
  doc = "#{doc}:"
98
116
  end
@@ -1,3 +1,3 @@
1
1
  module Autoproj
2
- VERSION = "1.6.0.rc4"
2
+ VERSION = "1.6.0.rc5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: autoproj
3
3
  version: !ruby/object:Gem::Version
4
- hash: 977940589
4
+ hash: 977940586
5
5
  prerelease: true
6
6
  segments:
7
7
  - 1
8
8
  - 6
9
9
  - 0
10
- - rc4
11
- version: 1.6.0.rc4
10
+ - rc5
11
+ version: 1.6.0.rc5
12
12
  platform: ruby
13
13
  authors:
14
14
  - Sylvain Joyeux
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2010-08-04 00:00:00 +02:00
19
+ date: 2010-08-13 00:00:00 +02:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency