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

[Cache] Use the proper slug for recently downloaded pods

parent af2ba68d
...@@ -23,12 +23,18 @@ module Pod ...@@ -23,12 +23,18 @@ module Pod
private private
def path_for_pod(request) # @return [Pathname] The path for the Pod downloaded from the given
root + request.slug # `request`.
#
def path_for_pod(request, slug_opts = {})
root + request.slug(slug_opts)
end end
def path_for_spec(request) # @return [Pathname] The path for the podspec downloaded from the given
path = root + 'Specs' + request.slug # `request`.
#
def path_for_spec(request, slug_opts = {})
path = root + 'Specs' + request.slug(slug_opts)
path.sub_ext('.podspec.json') path.sub_ext('.podspec.json')
end end
...@@ -50,16 +56,16 @@ module Pod ...@@ -50,16 +56,16 @@ module Pod
result.checkout_options = download(request.name, target, request.params, request.head?) result.checkout_options = download(request.name, target, request.params, request.head?)
if request.released_pod? if request.released_pod?
result.location = destination = path_for_pod(request) result.location = destination = path_for_pod(request, :params => result.checkout_options)
copy_and_clean(target, destination, request.spec) copy_and_clean(target, destination, request.spec)
write_spec(request.spec, path_for_spec(request)) write_spec(request.spec, path_for_spec(request, :params => result.checkout_options))
else else
podspecs = Sandbox::PodspecFinder.new(target).podspecs podspecs = Sandbox::PodspecFinder.new(target).podspecs
podspecs[request.name] = request.spec if request.spec podspecs[request.name] = request.spec if request.spec
podspecs.each do |_, spec| podspecs.each do |_, spec|
destination = path_for_pod(request) destination = path_for_pod(request, :name => spec.name, :params => result.checkout_options)
copy_and_clean(target, destination, spec) copy_and_clean(target, destination, spec)
write_spec(spec, path_for_spec(request)) write_spec(spec, path_for_spec(request, :name => spec.name, :params => result.checkout_options))
if request.name == spec.name if request.name == spec.name
result.location = destination result.location = destination
result.spec = spec result.spec = spec
......
...@@ -23,7 +23,7 @@ module Pod ...@@ -23,7 +23,7 @@ module Pod
validate! validate!
end end
def slug def slug(name: self.name, params: self.params)
if released_pod? if released_pod?
"Release/#{name}/#{spec.version}" "Release/#{name}/#{spec.version}"
else else
......
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