Permalink
Browse files

Merge changes Ie978f085,Iedd113eb,I1839c385,I9a6832fc,I772dbbda,I6fee…

…b61e,I2517eac2,I68c9cea8,I342b25f4,I94542715,Idc76f27d,I680d76a5,I7ed33066,I591bd152,Ia004ef66

* changes:
  [common] Use Git source for EM
  [warden] Use Git source in Gemfile
  [package cache client] Clear vendor cache
  [package cache] Clear vendor cache
  [stager] Clear vendor cache
  [staging] Use Git source in Gemfile
  [router] Use Git source in Gemfile
  [HM] Use Git source in Gemfile
  [CC] Use Git source in Gemfile
  [stager] Use Git source in Gemfile
  [DEA] So long vendor cache
  Rewrite Git Sources to Rubygems
  Pick up Gemfile
  Transform Git Sources in Gemfiles
  [dea] Use Git source in Gemfile for EventMachine
  • Loading branch information...
d authored and Gerrit Code Review committed Apr 6, 2012
2 parents 6ae99ab + 28d51fc commit 181734192f8e9576974dff416e21d4a8e4af626d
Showing with 242 additions and 20 deletions.
  1. +1 −1 cloud_controller/Gemfile
  2. +8 −2 cloud_controller/Gemfile.lock
  3. BIN cloud_controller/vendor/cache/eventmachine-0.12.11.cloudfoundry.3.gem
  4. +1 −0 common/Gemfile
  5. +8 −1 common/Gemfile.lock
  6. +158 −0 common/bin/transform_git_source
  7. +1 −1 dea/Gemfile
  8. +8 −2 dea/Gemfile.lock
  9. +2 −0 dea/vendor/cache/.gitignore
  10. BIN dea/vendor/cache/addressable-2.2.4.gem
  11. BIN dea/vendor/cache/builder-3.0.0.gem
  12. BIN dea/vendor/cache/ci_reporter-1.6.4.gem
  13. BIN dea/vendor/cache/daemons-1.1.8.gem
  14. BIN dea/vendor/cache/diff-lcs-1.1.2.gem
  15. BIN dea/vendor/cache/em-http-request-1.0.0.beta.3.gem
  16. BIN dea/vendor/cache/em-socksify-0.1.0.gem
  17. BIN dea/vendor/cache/eventmachine-0.12.11.cloudfoundry.3.gem
  18. BIN dea/vendor/cache/http_parser.rb-0.5.1.gem
  19. BIN dea/vendor/cache/json_pure-1.6.5.gem
  20. BIN dea/vendor/cache/nats-0.4.22.beta.8.gem
  21. BIN dea/vendor/cache/posix-spawn-0.3.6.gem
  22. BIN dea/vendor/cache/rack-1.4.1.gem
  23. BIN dea/vendor/cache/rake-0.8.7.gem
  24. BIN dea/vendor/cache/rcov-0.9.9.gem
  25. BIN dea/vendor/cache/rspec-2.5.0.gem
  26. BIN dea/vendor/cache/rspec-core-2.5.1.gem
  27. BIN dea/vendor/cache/rspec-expectations-2.5.0.gem
  28. BIN dea/vendor/cache/rspec-mocks-2.5.0.gem
  29. BIN dea/vendor/cache/thin-1.3.1.gem
  30. BIN dea/vendor/cache/yajl-ruby-0.8.3.gem
  31. +1 −1 health_manager/Gemfile
  32. +8 −2 health_manager/Gemfile.lock
  33. BIN health_manager/vendor/cache/eventmachine-0.12.11.cloudfoundry.3.gem
  34. +2 −0 package_cache/vendor/cache/.gitignore
  35. BIN package_cache/vendor/cache/daemons-1.1.8.gem
  36. BIN package_cache/vendor/cache/diff-lcs-1.1.3.gem
  37. BIN package_cache/vendor/cache/eventmachine-0.12.11.cloudfoundry.3.gem
  38. BIN package_cache/vendor/cache/json_pure-1.6.5.gem
  39. BIN package_cache/vendor/cache/mime-types-1.17.2.gem
  40. BIN package_cache/vendor/cache/nats-0.4.22.beta.8.gem
  41. BIN package_cache/vendor/cache/posix-spawn-0.3.6.gem
  42. BIN package_cache/vendor/cache/rack-1.4.1.gem
  43. BIN package_cache/vendor/cache/rack-protection-1.2.0.gem
  44. BIN package_cache/vendor/cache/rake-0.9.2.2.gem
  45. BIN package_cache/vendor/cache/rest-client-1.6.3.gem
  46. BIN package_cache/vendor/cache/rspec-2.7.0.gem
  47. BIN package_cache/vendor/cache/rspec-core-2.7.1.gem
  48. BIN package_cache/vendor/cache/rspec-expectations-2.7.0.gem
  49. BIN package_cache/vendor/cache/rspec-mocks-2.7.0.gem
  50. BIN package_cache/vendor/cache/sinatra-1.3.2.gem
  51. BIN package_cache/vendor/cache/thin-1.3.1.gem
  52. BIN package_cache/vendor/cache/tilt-1.3.3.gem
  53. BIN package_cache/vendor/cache/yajl-ruby-0.8.3.gem
  54. +2 −0 package_cache_client/vendor/cache/.gitignore
  55. BIN package_cache_client/vendor/cache/daemons-1.1.8.gem
  56. BIN package_cache_client/vendor/cache/diff-lcs-1.1.3.gem
  57. BIN package_cache_client/vendor/cache/eventmachine-0.12.11.cloudfoundry.3.gem
  58. BIN package_cache_client/vendor/cache/json_pure-1.6.6.gem
  59. BIN package_cache_client/vendor/cache/mime-types-1.18.gem
  60. BIN package_cache_client/vendor/cache/nats-0.4.22.gem
  61. BIN package_cache_client/vendor/cache/posix-spawn-0.3.6.gem
  62. BIN package_cache_client/vendor/cache/rack-1.4.1.gem
  63. BIN package_cache_client/vendor/cache/rake-0.9.2.2.gem
  64. BIN package_cache_client/vendor/cache/rest-client-1.6.3.gem
  65. BIN package_cache_client/vendor/cache/rspec-2.8.0.gem
  66. BIN package_cache_client/vendor/cache/rspec-core-2.8.0.gem
  67. BIN package_cache_client/vendor/cache/rspec-expectations-2.8.0.gem
  68. BIN package_cache_client/vendor/cache/rspec-mocks-2.8.0.gem
  69. BIN package_cache_client/vendor/cache/thin-1.3.1.gem
  70. BIN package_cache_client/vendor/cache/yajl-ruby-0.8.3.gem
  71. +1 −1 router/Gemfile
  72. +8 −2 router/Gemfile.lock
  73. BIN router/vendor/cache/eventmachine-0.12.11.cloudfoundry.3.gem
  74. +1 −1 stager/Gemfile
  75. +8 −2 stager/Gemfile.lock
  76. +2 −0 stager/vendor/cache/.gitignore
  77. BIN stager/vendor/cache/addressable-2.2.6.gem
  78. BIN stager/vendor/cache/builder-3.0.0.gem
  79. BIN stager/vendor/cache/ci_reporter-1.6.5.gem
  80. BIN stager/vendor/cache/crack-0.1.8.gem
  81. BIN stager/vendor/cache/daemons-1.1.8.gem
  82. BIN stager/vendor/cache/diff-lcs-1.1.3.gem
  83. BIN stager/vendor/cache/eventmachine-0.12.11.cloudfoundry.3.gem
  84. BIN stager/vendor/cache/json_pure-1.6.5.gem
  85. BIN stager/vendor/cache/nats-0.4.22.gem
  86. BIN stager/vendor/cache/nokogiri-1.5.2.gem
  87. BIN stager/vendor/cache/posix-spawn-0.3.6.gem
  88. BIN stager/vendor/cache/rack-1.4.1.gem
  89. BIN stager/vendor/cache/rake-0.9.2.2.gem
  90. BIN stager/vendor/cache/rspec-2.9.0.gem
  91. BIN stager/vendor/cache/rspec-core-2.9.0.gem
  92. BIN stager/vendor/cache/rspec-expectations-2.9.0.gem
  93. BIN stager/vendor/cache/rspec-mocks-2.9.0.gem
  94. BIN stager/vendor/cache/sinatra-1.2.6.gem
  95. BIN stager/vendor/cache/thin-1.3.1.gem
  96. BIN stager/vendor/cache/tilt-1.3.2.gem
  97. BIN stager/vendor/cache/uuidtools-2.1.2.gem
  98. BIN stager/vendor/cache/webmock-1.7.4.gem
  99. BIN stager/vendor/cache/yajl-ruby-0.8.3.gem
  100. +5 −0 staging/Gemfile
  101. +8 −1 staging/Gemfile.lock
  102. BIN staging/vendor/cache/eventmachine-0.12.11.cloudfoundry.3.gem
  103. +1 −1 warden/Gemfile
  104. +8 −2 warden/Gemfile.lock
  105. BIN warden/vendor/cache/eventmachine-0.12.11.cloudfoundry.3.gem
View
@@ -33,7 +33,7 @@ group :production do
end
# EventMachine and async support
-gem 'eventmachine'
+gem 'eventmachine', :git => 'git://github.com/cloudfoundry/eventmachine.git', :branch => 'release-0.12.11-cf'
gem 'thin'
gem 'em-http-request', '~> 1.0.0.beta.3', :require => 'em-http'
gem 'em-redis', '~> 0.3.0', :require => nil
@@ -1,3 +1,10 @@
+GIT
+ remote: git://github.com/cloudfoundry/eventmachine.git
+ revision: 2806c630d8631d5dcf9fb2555f665b829052aabe
+ branch: release-0.12.11-cf
+ specs:
+ eventmachine (0.12.11.cloudfoundry.3)
+
GEM
remote: http://rubygems.org/
specs:
@@ -58,7 +65,6 @@ GEM
eventmachine
erubis (2.6.6)
abstract (>= 1.0.0)
- eventmachine (0.12.11.cloudfoundry.3)
hiredis (0.3.2)
http_parser.rb (0.5.1)
i18n (0.5.0)
@@ -160,7 +166,7 @@ DEPENDENCIES
em-hiredis
em-http-request (~> 1.0.0.beta.3)
em-redis (~> 0.3.0)
- eventmachine
+ eventmachine!
mocha
mysql2 (>= 0.2.6)
nats
View
@@ -1,5 +1,6 @@
source "http://rubygems.org"
+gem 'eventmachine', :git => 'git://github.com/cloudfoundry/eventmachine.git', :branch => 'release-0.12.11-cf'
gemspec
group :spec do
View
@@ -1,3 +1,10 @@
+GIT
+ remote: git://github.com/cloudfoundry/eventmachine.git
+ revision: 2806c630d8631d5dcf9fb2555f665b829052aabe
+ branch: release-0.12.11-cf
+ specs:
+ eventmachine (0.12.11.cloudfoundry.3)
+
PATH
remote: .
specs:
@@ -19,7 +26,6 @@ GEM
escape_utils
eventmachine (>= 0.12.9)
escape_utils (0.2.4)
- eventmachine (0.12.11.cloudfoundry.3)
json_pure (1.6.5)
nats (0.4.22.beta.8)
daemons (>= 1.1.4)
@@ -48,6 +54,7 @@ PLATFORMS
DEPENDENCIES
em-http-request
+ eventmachine!
rake (~> 0.9.2)
rspec
vcap_common!
@@ -0,0 +1,158 @@
+#!/usr/bin/env ruby
+# vim: fileencoding=utf-8
+# vim: ts=2 sw=2 sts=2 et
+
+require 'bundler'
+require 'fileutils'
+require 'logger'
+
+# Rewrite git sources in Gemfile and lock files to paths
+#
+# Usage: transform_git_source path/to/dir_w_Gemfile path/to/git/checkout
+
+def `(cmd)
+ @logger.debug "executing #{cmd}"
+ result = super
+ raise RuntimeError, "error while attempting to execute #{cmd}" unless $?.exitstatus == 0
+ result
+end
+
+def checkout(spec, path)
+ unless path.join('.git').exist?
+ path.parent.mkpath
+ path.rmtree if path.exist?
+ %x(git clone --no-checkout #{spec.source.uri} #{path})
+ end
+ Dir.chdir(path) do
+ %x(git fetch --quiet --tags #{spec.source.uri})
+ # This is gross, but why do they keep this private?
+ revision = spec.source.send(:revision)
+ %x(git reset --hard #{revision})
+ end
+end
+
+# Derived from Bundler::Definition#to_lock
+# Copyright Bundler contributors
+# Portions copyright (c) 2010 André Arko
+# Portions copyright (c) 2009 Engine Yard
+def to_lock(specs, platforms, dependencies)
+ out = ""
+
+ specs.map {|s| s.source}.sort_by { |s| s.class.to_s }.uniq.each do |source|
+ # Add the source header
+ out << source.to_lock
+ # Find all specs for this source
+ specs.
+ select { |s| s.source == source }.
+ # This needs to be sorted by full name so that
+ # gems with the same name, but different platform
+ # are ordered consistantly
+ sort_by { |s| s.full_name }.
+ each do |spec|
+ next if spec.name == 'bundler'
+ out << spec.to_lock
+ end
+ out << "\n"
+ end
+
+ out << "PLATFORMS\n"
+
+ platforms.map { |p| p.to_s }.sort.each do |p|
+ out << " #{p}\n"
+ end
+
+ out << "\n"
+ out << "DEPENDENCIES\n"
+
+ handled = []
+ dependencies.
+ sort_by { |d| d.to_s }.
+ each do |dep|
+ next if handled.include?(dep.name)
+ out << dep.to_lock
+ handled << dep.name
+ end
+
+ out
+end
+
+def rewrite_lockfile(lockfile, checkout_base)
+ parser = Bundler::LockfileParser.new(lockfile.read)
+
+ candidates = parser.specs.select { |s| Bundler::Source::Git === s.source }
+ if candidates.empty?
+ @logger.info 'Nothing to see here, move along'
+ return
+ end
+
+ gemsrc = parser.sources.find { |s| Bundler::Source::Rubygems === s } ||
+ Bundler::Source::Rubygems.from_lock('remote' => 'http://rubygems.org')
+ lockfile.parent.join('vendor', 'cache').mkpath
+ candidates.each do |spec|
+ # TODO: shall i sanitize spec.name?
+ checkout_dir = checkout_base.join(spec.name)
+ checkout(spec, checkout_dir)
+ Dir.chdir(checkout_dir) do
+ %x(gem build #{spec.name}.gemspec)
+ gempath = checkout_dir.join("#{spec.name}-#{spec.version}.gem")
+ %x(ln -v #{gempath} -t #{lockfile.parent.join('vendor', 'cache')})
+ end
+ spec.source = gemsrc
+ # make the dependency have "no specified source"
+ parser.dependencies.find { |d| d.name == spec.name }.source = nil
+ end
+
+ lockfile.open('w') do |f|
+ f.puts to_lock(parser.specs, parser.platforms, parser.dependencies)
+ end
+end
+
+# We don't attempt to be a full ruby parser, only rewrite Gemfiles we wrote
+def rewrite_gemfile(gemfile, checkout_base)
+ out = ''
+ probe = Object.new
+ class << probe
+ attr_reader :name, :version, :options, :path
+ def gem(name, *args)
+ @name = name
+ @options = args.last.is_a?(Hash) ? args.pop : {}
+ @version = args
+ unless @options.include?(:git)
+ raise ArgumentError, ':git option expected, none found'
+ end
+ end
+ end
+
+ gemfile.each_line do |line|
+ case line
+ when /^\s*gem.*:git/
+ if line =~ /#.*:git/ && line !~ /^[^#]+:git/
+ out << line
+ next
+ end
+ probe.instance_eval(line)
+ out << "gem #{probe.name.inspect}"
+ out << ", #{probe.version.map(&:inspect).join(', ')}" unless probe.version.empty?
+ out << "\n"
+ else
+ out << line
+ end
+ end
+ gemfile.open('w') { |f| f.write(out) }
+end
+
+if __FILE__ == $0
+ unless ARGV.length == 2
+ puts <<-USAGE
+Incorrect number of arguments! Usage:
+ #{File.basename(__FILE__)} path/to/dir_with_Gemfile path/to/place/git/checkouts
+ USAGE
+ exit 1
+ end
+
+ @logger = Logger.new(STDERR)
+ project_dir, checkout_base = ARGV.map { |x| Pathname.new(x).expand_path }
+ ENV['BUNDLE_GEMFILE'] = project_dir.join('Gemfile').to_s
+ rewrite_lockfile(project_dir.join('Gemfile.lock'), checkout_base)
+ rewrite_gemfile(project_dir.join('Gemfile'), checkout_base)
+end
View
@@ -2,7 +2,7 @@ source "http://rubygems.org"
gem 'bundler', '>= 1.0.10'
gem 'nats', :require => 'nats/client'
-gem 'eventmachine'
+gem 'eventmachine', :git => 'git://github.com/cloudfoundry/eventmachine.git', :branch => 'release-0.12.11-cf'
gem 'em-http-request', '~> 1.0.0.beta.3', :require => 'em-http'
gem 'rack', :require => ["rack/utils", "rack/mime"]
View
@@ -1,3 +1,10 @@
+GIT
+ remote: git://github.com/cloudfoundry/eventmachine.git
+ revision: 2806c630d8631d5dcf9fb2555f665b829052aabe
+ branch: release-0.12.11-cf
+ specs:
+ eventmachine (0.12.11.cloudfoundry.3)
+
GEM
remote: http://rubygems.org/
specs:
@@ -14,7 +21,6 @@ GEM
http_parser.rb (>= 0.5.1)
em-socksify (0.1.0)
eventmachine
- eventmachine (0.12.11.cloudfoundry.3)
http_parser.rb (0.5.1)
json_pure (1.6.5)
nats (0.4.22.beta.8)
@@ -55,7 +61,7 @@ DEPENDENCIES
bundler (>= 1.0.10)
ci_reporter
em-http-request (~> 1.0.0.beta.3)
- eventmachine
+ eventmachine!
nats
rack
rake
@@ -0,0 +1,2 @@
+/*
+!/vcap_*
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
View
@@ -2,7 +2,7 @@ source "http://rubygems.org"
gem 'bundler', '>= 1.0.10'
gem 'nats', :require => 'nats/client'
-gem 'eventmachine'
+gem 'eventmachine', :git => 'git://github.com/cloudfoundry/eventmachine.git', :branch => 'release-0.12.11-cf'
gem 'em-http-request', '~> 1.0.0.beta.3', :require => 'em-http'
gem 'rack', :require => ["rack/utils", "rack/mime"]
@@ -1,3 +1,10 @@
+GIT
+ remote: git://github.com/cloudfoundry/eventmachine.git
+ revision: 2806c630d8631d5dcf9fb2555f665b829052aabe
+ branch: release-0.12.11-cf
+ specs:
+ eventmachine (0.12.11.cloudfoundry.3)
+
GEM
remote: http://rubygems.org/
specs:
@@ -19,7 +26,6 @@ GEM
http_parser.rb (>= 0.5.1)
em-socksify (0.1.0)
eventmachine
- eventmachine (0.12.11.cloudfoundry.3)
http_parser.rb (0.5.3)
json_pure (1.6.5)
mime-types (1.18)
@@ -64,7 +70,7 @@ DEPENDENCIES
cf-uaa-client (>= 0.0.6)
ci_reporter
em-http-request (~> 1.0.0.beta.3)
- eventmachine
+ eventmachine!
nats
rack
rake
@@ -0,0 +1,2 @@
+/*
+!/vcap_*
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,2 @@
+/*
+!/vcap_*
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
View
@@ -3,7 +3,7 @@ source "http://rubygems.org"
gem 'bundler', '>= 1.0.10'
gem 'rake'
gem 'nats', :require => 'nats/client'
-gem 'eventmachine'
+gem 'eventmachine', :git => 'git://github.com/cloudfoundry/eventmachine.git', :branch => 'release-0.12.11-cf'
gem "http_parser.rb", :require => "http/parser"
gem "yajl-ruby", :require => ["yajl", "yajl/json_gem"]
View
@@ -1,3 +1,10 @@
+GIT
+ remote: git://github.com/cloudfoundry/eventmachine.git
+ revision: 2806c630d8631d5dcf9fb2555f665b829052aabe
+ branch: release-0.12.11-cf
+ specs:
+ eventmachine (0.12.11.cloudfoundry.3)
+
GEM
remote: http://rubygems.org/
specs:
@@ -6,7 +13,6 @@ GEM
builder (>= 2.1.2)
daemons (1.1.8)
diff-lcs (1.1.2)
- eventmachine (0.12.11.cloudfoundry.3)
http_parser.rb (0.5.1)
json_pure (1.6.5)
nats (0.4.22.beta.8)
@@ -46,7 +52,7 @@ PLATFORMS
DEPENDENCIES
bundler (>= 1.0.10)
ci_reporter
- eventmachine
+ eventmachine!
http_parser.rb
nats
rake
Binary file not shown.
View
@@ -1,6 +1,6 @@
source :rubygems
-gem 'eventmachine'
+gem 'eventmachine', :git => 'git://github.com/cloudfoundry/eventmachine.git', :branch => 'release-0.12.11-cf'
gem 'nats'
gem 'rake'
gem 'yajl-ruby', '>= 0.7.9'
View
@@ -1,3 +1,10 @@
+GIT
+ remote: git://github.com/cloudfoundry/eventmachine.git
+ revision: 2806c630d8631d5dcf9fb2555f665b829052aabe
+ branch: release-0.12.11-cf
+ specs:
+ eventmachine (0.12.11.cloudfoundry.3)
+
GEM
remote: http://rubygems.org/
specs:
@@ -8,7 +15,6 @@ GEM
crack (0.1.8)
daemons (1.1.8)
diff-lcs (1.1.3)
- eventmachine (0.12.11.cloudfoundry.3)
json_pure (1.6.5)
nats (0.4.22)
daemons (>= 1.1.4)
@@ -61,7 +67,7 @@ PLATFORMS
DEPENDENCIES
ci_reporter
- eventmachine
+ eventmachine!
nats
rake
rspec
@@ -0,0 +1,2 @@
+/*
+!/vcap_*
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
View
@@ -1,5 +1,10 @@
source :rubygems
+# Ideally, we should be able to declare a gem's dependencies in the one true
+# place, which is the gemspec, but there doesn't seem to be another place where
+# I can override this with git source...
+gem 'eventmachine', :git => 'git://github.com/cloudfoundry/eventmachine.git', :branch => 'release-0.12.11-cf'
+
gemspec
group :test do
gem 'ci_reporter'
Oops, something went wrong.

0 comments on commit 1817341

Please sign in to comment.