Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
`pod cache list` print incorrect pod path #8422
What did you do?
What did you expect to happen?
print correct pod path
What happened instead?
print incorrect pod path
Project that demonstrates the issue
sample project link https://github.com/tripleCC/podTestLibrary.git
I found that CocoaPods generated the path of pod cache by podTestLibrary.podspec's checksum , but print the path which was generated by podTestLibrary.podspec.json's checksum.
the podspecs' checksum of podTestLibrary :
➜ Example git:(master) ✗ irb 2.4.1 :001 > require 'cocoapods' => true 2.4.1 :002 > Pod::Specification.from_file(Pathname.new('/Users/songruiwang/Library/Caches/CocoaPods/Pods/Specs/Release/podTestLibrary/0.1.podspec.json')).checksum => "beec68153b3753f9283eae5f8c84ca55e0fa34ff" 2.4.1 :003 > Pod::Specification.from_file(Pathname.new('/Users/songruiwang/.cocoapods/repos/PrivateSpecRepo/podTestLibrary/0.1.0/podTestLibrary.podspec')).checksum => "479bb0f018b9bbc0704f53c15d31c6dca90f2366"
how about generating checksum by pretty JSON of the specification ?
# lib/cocoapods-core/specification.rb def checksum generate_checksum(to_pretty_json) end def file_checksum generate_checksum(File.read(defined_in_file)) unless defined_in_file.nil? end def generate_checksum(string) require 'digest' checksum = Digest::SHA1.hexdigest(string) checksum = checksum.encode('UTF-8') if checksum.respond_to?(:encode) checksum end