CocoaPods/CocoaPods

Cocoapods doesn't install the correct version when versions have metadata

Open

#8,341 opened on Dec 7, 2018

View on GitHub
 (7 comments) (0 reactions) (0 assignees)Ruby (2,685 forks)batch import
d2:moderatehelp wantedt1:enhancement

Repository metrics

Stars
 (14,815 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

Report

What did you do?

I have a dependency which has a couple of metadata options. Based on that, I have the following podspec versions:

MyDependency

  • 1.0.0
  • 1.0.0+code
  • 1.0.0+debug

My Podfile has

pod 'MyDependency, '1.0.0+code'

Run pod install

What did you expect to happen?

Cocoapods installs version 1.0.0+code

What happened instead?

Cocoapods installs version 1.0.0+debug

CocoaPods Environment

Stack

   CocoaPods : 1.5.3
        Ruby : ruby 2.2.4p230 (2015-12-16 revision 53155) [x86_64-darwin15]
    RubyGems : 2.4.8
        Host : Mac OS X 10.13.6 (17G3025)
       Xcode : 10.1 (10B61)
         Git : git version 2.14.1
Ruby lib dir : /Users/bhasingh/.rvm/rubies/ruby-2.2.4/lib
Repositories : bhavdeepsingh - https://github.com/bhavdeepsingh/SamplePodspecs @ 216607e32f826d6684e61b82c0ced260e193344b
               cocoapods - https://github.com/CocoaPods/Old-Specs @ 6e256ccc84aad851d401fabb79b2c0f9e09bb875
               master - https://github.com/CocoaPods/Specs.git @ 9c630913ab7acc44e7e060adfc0211a33b56686d

Installation Source

Executable Path: /Users/bhasingh/.rvm/gems/ruby-2.2.4/bin/pod

Plugins

cocoapods-deintegrate : 1.0.2
cocoapods-plugins     : 1.0.0
cocoapods-search      : 1.0.0
cocoapods-stats       : 1.0.0
cocoapods-trunk       : 1.3.1
cocoapods-try         : 1.1.0

Podfile

platform :ios, '10.0'

source 'https://github.com/bhavdeepsingh/SamplePodspecs'
project 'SampleProject'

target 'SampleProject' do
 pod 'MyDependency', '1.0.0+code'
end

Project that demonstrates the issue

https://github.com/bhavdeepsingh/SampleProject

Contributor guide