Commit a46f739d authored by Samuel E. Giddins's avatar Samuel E. Giddins

[LockingDependencyAnalyzer] Fix updating a pod that has subspec dependencies

Closes https://github.com/CocoaPods/CocoaPods/issues/2879.
parent 855aeac0
......@@ -21,6 +21,12 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
[Samuel Giddins](https://github.com/segiddins)
[#2639](https://github.com/CocoaPods/CocoaPods/issues/2639)
##### Bug Fixes
* Fix updating a pod that has subspec dependencies.
[Samuel Giddins](https://github.com/segiddins)
[#2879](https://github.com/CocoaPods/CocoaPods/issues/2879)
## 0.35.0
......
......@@ -32,8 +32,13 @@ module Pod
add_to_dependency_graph(pod, [], dependency_graph)
end
pods_to_update = pods_to_update.flat_map do |u|
root_name = Specification.root_name(u)
dependency_graph.vertices.keys.select { |n| Specification.root_name(n) == root_name }
end
pods_to_update.each do |u|
dependency_graph.detach_vertex_named(u) if dependency_graph.vertex_named(u)
dependency_graph.detach_vertex_named(u)
end
end
......
......@@ -134,6 +134,36 @@ module Pod
@analyzer.send(:locked_dependencies).to_a.map(&:payload).should == []
end
it 'unlocks all dependencies with the same root name in update mode' do
podfile = Podfile.new do
platform :ios, '8.0'
xcodeproj 'SampleProject/SampleProject'
pod 'AFNetworking'
pod 'AFNetworkActivityLogger'
end
hash = {}
hash['PODS'] = [
{"AFNetworkActivityLogger (2.0.3)" => ["AFNetworking/NSURLConnection (~> 2.0)", "AFNetworking/NSURLSession (~> 2.0)"]},
{"AFNetworking (2.4.0)" => ["AFNetworking/NSURLConnection (= 2.4.0)", "AFNetworking/NSURLSession (= 2.4.0)", "AFNetworking/Reachability (= 2.4.0)", "AFNetworking/Security (= 2.4.0)", "AFNetworking/Serialization (= 2.4.0)", "AFNetworking/UIKit (= 2.4.0)"]},
{"AFNetworking/NSURLConnection (2.4.0)" => ["AFNetworking/Reachability", "AFNetworking/Security", "AFNetworking/Serialization"]},
{"AFNetworking/NSURLSession (2.4.0)" => ["AFNetworking/Reachability", "AFNetworking/Security", "AFNetworking/Serialization"]},
"AFNetworking/Reachability (2.4.0)",
"AFNetworking/Security (2.4.0)",
"AFNetworking/Serialization (2.4.0)",
{"AFNetworking/UIKit (2.4.0)" => ["AFNetworking/NSURLConnection", "AFNetworking/NSURLSession"]}
]
hash['DEPENDENCIES'] = ['AFNetworkActivityLogger', 'AFNetworking (2.4.0)']
hash['SPEC CHECKSUMS'] = {}
hash['COCOAPODS'] = Pod::VERSION
lockfile = Pod::Lockfile.new(hash)
analyzer = Installer::Analyzer.new(config.sandbox, podfile, lockfile)
analyzer.update = { :pods => %w(AFNetworking) }
analyzer.analyze.specifications.
find { |s| s.name == 'AFNetworking' }.
version.to_s.should == '2.4.1'
end
#--------------------------------------#
it 'takes into account locked implicit dependencies' do
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment