Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Do not flatten the zip files downloaded via http #783

Merged
merged 2 commits into from

2 participants

@kbok

Zip files are extracted in-place so the flattener breaks the archives containing only one directory, such as BugSense with only the framework directory. Related to #727, #728. Fixes the BugSense pod and possibly others.

@kbok

By the way, the related test is currently broken: "Stub "pod" received unexpected message :top_specification with (no args)"

@alloy
Owner

I’m not seeing that failure, but I do get another one that seems more legit:

Bacon::Error: #<Pathname:/var/folders/xb/qk_9wq3n1qn0tlhjmcdf8xbr0000gn/T/d20130205-49874-by5vyt/Pods/BananaLib/GADSearchRequest.h>.exist?() failed
    spec/functional/downloader_spec.rb:77:in `block (3 levels) in <module:Pod>': for HTTP - download file and unzip it
    spec/functional/downloader_spec.rb:70:in `block (2 levels) in <module:Pod>'
    spec/functional/downloader_spec.rb:67:in `block in <module:Pod>'
    spec/functional/downloader_spec.rb:4:in `<module:Pod>'
    spec/functional/downloader_spec.rb:3:in `<top (required)>'

Can you please fix that up and check why you might be getting another failure?

@alloy
Owner

@irrationalfab @Keithbsmiley @orta @siuying @GWStuartClift Hey guys, just an FYI that this change is going to revert some spec changes that you guys probably have had to make in recent history (e.g. Google Analytics). So when we release this version, these changes will have to be made. Doing them gradually is fine imo, but another option is that someone prepares a 0.16.3 branch of the specs repo which we merge on release.

@kbok

Yep, overlooked that one. The last commit basically reverts the spec change in a6aef74.

@kbok

Also nevermind the other failure, rake spec is green.

@alloy
Owner

@kbok Thanks! I’ll look into applying this ASAP.

@alloy alloy merged commit 16d018e into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 5, 2013
  1. Do not flatten the zip files downloaded via http

    Arnaud Bellec authored
This page is out of date. Refresh to see the latest.
View
14 lib/cocoapods/downloader/http.rb
@@ -74,12 +74,14 @@ def extract_with_type(full_filename, type=:zip)
raise UnsupportedFileTypeError.new "Unsupported file type: #{type}"
end
- # If the archive only contained a folder, move its contents to the target (#727)
- contents = target_path.children
- contents.delete(full_filename)
- entry = contents.first
- if contents.count == 1 && entry.directory?
- FileUtils.move(entry.children, target_path)
+ # If the archive is a tarball and it only contained a folder, move its contents to the target (#727)
+ if [:tgz, :tar, :tbz].include? type
+ contents = target_path.children
+ contents.delete(full_filename)
+ entry = contents.first
+ if contents.count == 1 && entry.directory?
+ FileUtils.move(entry.children, target_path)
+ end
end
end
View
4 spec/functional/downloader_spec.rb
@@ -74,8 +74,8 @@ module Pod
downloader = Downloader.for_pod(@pod)
VCR.use_cassette('tarballs', :record => :new_episodes) { downloader.download }
- (@pod.root + 'GADSearchRequest.h').should.exist
- (@pod.root + 'GADSearchRequest.h').read.strip.should =~ /Google Search Ads iOS SDK/
+ (@pod.root + 'GoogleAdMobSearchAdsSDK/GADSearchRequest.h').should.exist
+ (@pod.root + 'GoogleAdMobSearchAdsSDK/GADSearchRequest.h').read.strip.should =~ /Google Search Ads iOS SDK/
end
it "raises if it fails to download" do
Something went wrong with that request. Please try again.