autoproj 1.7.5 → 1.7.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 CHANGED
@@ -1,3 +1,9 @@
1
+ = Version 1.7.6
2
+ * ship the generic configuration of gitorious
3
+ server from Rock. It defines
4
+ Autoproj.gitorious_server_configuration
5
+ (see autoproj's API documentation)
6
+
1
7
  = Version 1.7.5
2
8
  * quickfix release
3
9
  * fix osdeps_mode issue on bootstrapping
data/Manifest.txt CHANGED
@@ -13,6 +13,7 @@ lib/autoproj/cmdline.rb
13
13
  lib/autoproj/default.osdeps
14
14
  lib/autoproj/manifest.rb
15
15
  lib/autoproj/options.rb
16
+ lib/autoproj/gitorious.rb
16
17
  lib/autoproj/osdeps.rb
17
18
  lib/autoproj/system.rb
18
19
  lib/autoproj/version.rb
@@ -0,0 +1,72 @@
1
+ module Autoproj
2
+ # Adds the relevant options to handle a gitorious server
3
+ # What this does is ask the user how he would like to access the gitorious
4
+ # server. Then, it sets
5
+ #
6
+ # #{name}_ROOT to be the base URL for pulling
7
+ # #{name}_PUSH_ROOT to be the corresponding ssh-based URL for pushing
8
+ #
9
+ # For instance, with
10
+ #
11
+ # handle_gitorious_server "GITORIOUS", "gitorious.org"
12
+ #
13
+ # the URLs for the rtt repository in the orocos-toolchain gitorious project would
14
+ # be defined in the source.yml files as
15
+ #
16
+ # ${GITORIOUS_ROOT}/orocos-toolchain/rtt.git
17
+ # ${GITORIOUS_PUSH_ROOT}/orocos-toolchain/rtt.git
18
+ #
19
+ # Since it seems that the http method for gitorious servers is more stable, a
20
+ # fallback importer is set up that falls back to using http for pulling as soon
21
+ # as import failed
22
+ def gitorious_server_configuration(name, base_url, options = Hash.new)
23
+ options = Kernel.validate_options options,
24
+ :fallback_to_http => true
25
+
26
+ gitorious_long_doc = [
27
+ "Access method to import data from #{base_url} (git, http or ssh)",
28
+ "Use 'ssh' only if you have an account there. Note that",
29
+ "ssh will always be used to push to the repositories, this is",
30
+ "only to get data from the server. Therefore, we advise to use",
31
+ "'git' as it is faster than ssh and better than http"]
32
+
33
+ configuration_option name, 'string',
34
+ :default => "git",
35
+ :values => ["http", "ssh"],
36
+ :doc => gitorious_long_doc do |value|
37
+
38
+ value
39
+ end
40
+
41
+ access_mode = Autoproj.user_config(name)
42
+ if access_mode == "git"
43
+ Autoproj.change_option("#{name}_ROOT", "git://#{base_url}")
44
+ elsif access_mode == "http"
45
+ Autoproj.change_option("#{name}_ROOT", "http://git.#{base_url}")
46
+ elsif access_mode == "ssh"
47
+ Autoproj.change_option("#{name}_ROOT", "git@#{base_url}:")
48
+ end
49
+ Autoproj.change_option("#{name}_PUSH_ROOT", "git@#{base_url}:")
50
+
51
+ # If running on a recent enough autobuild version, register a fallback to
52
+ # use http when git fails
53
+ if Autobuild::Importer.respond_to?(:fallback) && options[:fallback_to_http]
54
+ Autobuild::Importer.fallback do |package, importer|
55
+ root_rx = /^(?:http:\/\/git\.|git:\/\/|git@)#{Regexp.quote(base_url)}/
56
+ if importer.kind_of?(Autobuild::Git) && importer.repository =~ root_rx && importer.repository !~ /^http/
57
+ Autoproj.warn "import from #{importer.repository} failed, falling back to using http for all packages on #{base_url}"
58
+ Autobuild::Package.each do |pkg_name, pkg|
59
+ if pkg.importer.kind_of?(Autobuild::Git) && pkg.importer.repository =~ root_rx
60
+ pkg.importer.repository.gsub!(root_rx, "http://git.#{base_url}")
61
+ end
62
+ end
63
+
64
+ http_importer = importer.dup
65
+ http_importer.repository = importer.repository.gsub(root_rx, "http://git.#{base_url}")
66
+ http_importer
67
+ end
68
+ end
69
+ end
70
+ end
71
+ end
72
+
@@ -1,3 +1,3 @@
1
1
  module Autoproj
2
- VERSION = "1.7.5"
2
+ VERSION = "1.7.6"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: autoproj
3
3
  version: !ruby/object:Gem::Version
4
- hash: 1
4
+ hash: 7
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 7
9
- - 5
10
- version: 1.7.5
9
+ - 6
10
+ version: 1.7.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - Sylvain Joyeux
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-02-02 00:00:00 +01:00
18
+ date: 2011-02-07 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -201,6 +201,7 @@ files:
201
201
  - lib/autoproj/default.osdeps
202
202
  - lib/autoproj/manifest.rb
203
203
  - lib/autoproj/options.rb
204
+ - lib/autoproj/gitorious.rb
204
205
  - lib/autoproj/osdeps.rb
205
206
  - lib/autoproj/system.rb
206
207
  - lib/autoproj/version.rb