Skip to content

Commit

Permalink
Allow fetch-manifest to have override'able remotes
Browse files Browse the repository at this point in the history
Example usage...

./foo/fetch-manifest.rb foo/default.xml foo/override.xml

Change-Id: I01d3d8d8c927fb90e2526943eb81bf57e3c8587c
Reviewed-on: http://review.membase.org/5184
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
  • Loading branch information
steveyen authored and alk committed Mar 31, 2011
1 parent 9bd8f1a commit 584853f
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
13 changes: 12 additions & 1 deletion fetch-manifest.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
require 'rubygems'
require 'rake'

path = ARGV[0] # Example: "some/repo/manifest/default.xml"
path = ARGV[0] # Required. Example: some/repo/manifest/default.xml
more = ARGV[1] # Optional. Example: some/override.xml

root = REXML::Document.new(File.new(path)).root

default = root.get_elements("//default")[0]
Expand All @@ -14,6 +16,15 @@
remotes[remote.attributes['name']] = remote
end

# An override.xml file can be useful to specify different remote
# servers, such as to a closer, local git mirror.
#
if more
REXML::Document.new(File.new(more)).root.each_element("//remote") do |remote|
remotes[remote.attributes['name']] = remote
end
end

root.each_element("//project") do |project|
name = project.attributes['name']
path = project.attributes['path']
Expand Down
11 changes: 11 additions & 0 deletions override.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<remote name="membase"
fetch="git://10.1.1.210/"
review="review.membase.org" />
<remote name="couchbase"
fetch="git://10.1.1.210/"
review="review.membase.org" />
<remote name="apache"
fetch="git://github.com/apache/" />
</manifest>

0 comments on commit 584853f

Please sign in to comment.