aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAndre Arko <andre@arko.net>2010-04-19 23:18:07 -0700
committerAndre Arko <andre@arko.net>2010-04-23 10:02:39 -0700
commita20c08aee8a8a727ecc94b9ae9e556fb4eb32dc9 (patch)
treeaf61205c270d808940c3766d145022cf42217a9b /lib
parent9810e3803b43f5d620206aba310746371fc2e64e (diff)
downloadbundler-a20c08aee8a8a727ecc94b9ae9e556fb4eb32dc9.tar.gz
Fetch full arch from RemoteSpecifications before installing
It turns out quick gem indexes don't include the arch in the platform string. So we have to fetch the full spec before we install or risk trying to install the wrong arch. You'll need to `rm -rf tmp/gems/base` for this to pass the first time. Cleanups or suggestions on how to make this spec less ugly would also be welcome. Closes #277
Diffstat (limited to 'lib')
-rw-r--r--lib/bundler/remote_specification.rb9
-rw-r--r--lib/bundler/source.rb1
2 files changed, 9 insertions, 1 deletions
diff --git a/lib/bundler/remote_specification.rb b/lib/bundler/remote_specification.rb
index cac0f99b..ee5a8068 100644
--- a/lib/bundler/remote_specification.rb
+++ b/lib/bundler/remote_specification.rb
@@ -17,6 +17,12 @@ module Bundler
@source_uri = source_uri
end
+ # Needed before installs, since the arch matters then and quick
+ # specs don't bother to include the arch in the platform string
+ def fetch_platform
+ @platform = _remote_specification.platform
+ end
+
def full_name
if platform == Gem::Platform::RUBY or platform.nil? then
"#{@name}-#{@version}"
@@ -26,7 +32,7 @@ module Bundler
end
# Because Rubyforge cannot be trusted to provide valid specifications
- # once the remote gem is donwloaded, the backend specification will
+ # once the remote gem is downloaded, the backend specification will
# be swapped out.
def __swap__(spec)
@specification = spec
@@ -36,6 +42,7 @@ module Bundler
def _remote_specification
@specification ||= begin
+ Bundler.ui.debug "Fetching spec for #{full_name}"
Gem::SpecFetcher.new.fetch_spec([@name, @version, @platform], URI(@source_uri.to_s))
end
end
diff --git a/lib/bundler/source.rb b/lib/bundler/source.rb
index 02fd8228..5c127b2e 100644
--- a/lib/bundler/source.rb
+++ b/lib/bundler/source.rb
@@ -41,6 +41,7 @@ module Bundler
def fetch(spec)
Bundler.ui.debug " * Downloading"
uri = @spec_uri_map[[spec.name, spec.version, spec.platform]]
+ spec.fetch_platform
Gem::RemoteFetcher.fetcher.download(spec, uri, Gem.dir)
end