Skip to content
This repository

Lazy repo update. #533

Closed
wants to merge 1 commit into from

2 participants

Fabio Pelosin Eloy Durán
Fabio Pelosin

Prof of concept patch that allows pod install to update the repos only if needed.

I'm not sure if we should keep the no-update option.

Eloy Durán
Owner

Yup, definitely makes sense.

Fabio Pelosin

This was removed to support the comparison of the specifications checksums, it is still possible to skip the repo update using the config.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Sep 20, 2012
Fabio Pelosin irrationalfab Lazy repo udpate. f8bfb77
This page is out of date. Refresh to see the latest.
8 lib/cocoapods/command.rb
@@ -142,14 +142,6 @@ def verify_lockfile_exists!
142 142 raise Informative, "No `Podfile.lock' found in the current working directory, run `pod install'."
143 143 end
144 144 end
145   -
146   - def update_spec_repos_if_necessary!
147   - if @update_repo
148   - UI.section 'Updating Spec Repositories' do
149   - Repo.new(ARGV.new(["update"])).run
150   - end
151   - end
152   - end
153 145 end
154 146 end
155 147
3  lib/cocoapods/command/install.rb
@@ -27,7 +27,6 @@ def self.options
27 27 ["--no-clean", "Leave SCM dirs like `.git' and `.svn' intact after downloading"],
28 28 ["--no-doc", "Skip documentation generation with appledoc"],
29 29 ["--no-integrate", "Skip integration of the Pods libraries in the Xcode project(s)"],
30   - ["--no-update", "Skip running `pod repo update` before install"],
31 30 ].concat(super)
32 31 end
33 32
@@ -35,7 +34,6 @@ def initialize(argv)
35 34 config.clean = !argv.option('--no-clean')
36 35 config.generate_docs = !argv.option('--no-doc')
37 36 config.integrate_targets = !argv.option('--no-integrate')
38   - @update_repo = !argv.option('--no-update')
39 37 super unless argv.empty?
40 38 end
41 39
@@ -48,7 +46,6 @@ def run_install_with_update(update)
48 46
49 47 def run
50 48 verify_podfile_exists!
51   - update_spec_repos_if_necessary!
52 49 run_install_with_update(false)
53 50 end
54 51 end
8 lib/cocoapods/command/outdated.rb
@@ -10,21 +10,13 @@ def self.banner
10 10 spec repos, not those from local/external sources or `:head' versions.}
11 11 end
12 12
13   - def self.options
14   - [
15   - ["--no-update", "Skip running `pod repo update` before install"],
16   - ].concat(super)
17   - end
18   -
19 13 def initialize(argv)
20   - @update_repo = !argv.option('--no-update')
21 14 super unless argv.empty?
22 15 end
23 16
24 17 def run
25 18 verify_podfile_exists!
26 19 verify_lockfile_exists!
27   - update_spec_repos_if_necessary!
28 20
29 21 sandbox = Sandbox.new(config.project_pods_root)
30 22 resolver = Resolver.new(config.podfile, config.lockfile, sandbox)
1  lib/cocoapods/command/update.rb
@@ -12,7 +12,6 @@ def self.banner
12 12 def run
13 13 verify_podfile_exists!
14 14 verify_lockfile_exists!
15   - update_spec_repos_if_necessary!
16 15 run_install_with_update(true)
17 16 end
18 17 end
5 lib/cocoapods/resolver.rb
@@ -77,6 +77,11 @@ def resolve
77 77 end
78 78 end
79 79 end if config.verbose?
  80 +
  81 + UI.section 'Updating Spec Repositories' do
  82 + Command::Repo.new(Command::ARGV.new(["update"])).run
  83 + end if !(@pods_by_state[:added] + @pods_by_state[:changed]).empty? || update_mode
  84 +
80 85 @pods_to_lock = (lockfile.pods_names - @pods_by_state[:added] - @pods_by_state[:changed] - @pods_by_state[:removed]).uniq
81 86 end
82 87

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.