Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uninstall: refuse when dependents still installed #1082

Merged
merged 32 commits into from
Nov 11, 2016
Merged
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
6f0aabe
uninstall: refuse when dependants still installed
alyssais Sep 22, 2016
e41c4e5
uninstall: better message when dependents remain
alyssais Sep 27, 2016
08f3aec
uninstall: consistent spelling of "dependent"
alyssais Sep 27, 2016
563b567
keg: rename #formula to #to_formula
alyssais Sep 27, 2016
08c898f
integration tests: testball install overridable
alyssais Sep 27, 2016
888c44b
uninstall: fix dependent order bug
alyssais Sep 27, 2016
b42f769
uninstall: reorganise code
alyssais Sep 28, 2016
ecb1075
uninstall: check for dependents even with --force
alyssais Sep 28, 2016
13d705c
integration tests: preserve HOMEBREW_DEVELOPER
alyssais Sep 28, 2016
7792acd
uninstall: allow dependent checks to be by-passed
alyssais Sep 28, 2016
ed0fffd
uninstall: style fixes
alyssais Sep 29, 2016
7fa4ffe
missing: allow hiding specified formulae
ilovezfs Sep 29, 2016
8e3e8e3
missing: add tests for not missing and hide
alyssais Sep 30, 2016
c88b67f
missing: simplify code a bit
alyssais Sep 30, 2016
ae3f53a
keg: fallback to missing_deps if deps not in tab
alyssais Sep 30, 2016
4526915
Revert "keg: fallback to missing_deps if deps not in tab"
alyssais Sep 30, 2016
ef13f8e
uninstall: only <=1 Diagnostic.missing_deps call
alyssais Sep 30, 2016
99a7fb8
uninstall: don't use unless ||
alyssais Oct 2, 2016
0cd9834
missing_deps: extract formula instance method
alyssais Oct 5, 2016
422f38b
missing: call Formula#missing_dependencies directly
alyssais Oct 5, 2016
a4dc835
uninstall: call Formula#missing_dependencies directly
alyssais Oct 5, 2016
c4c855b
ARGV: extract #values from missing
alyssais Oct 10, 2016
aff5f42
missing: document --hide
alyssais Oct 10, 2016
d0ad097
uninstall: remove duplicated method
alyssais Oct 25, 2016
5a3d6c4
uninstall, keg: update style
alyssais Oct 25, 2016
3702e56
uninstall: test should_check_for_dependents?
alyssais Oct 25, 2016
bb30b01
uninstall: go easier on the integration tests
alyssais Oct 25, 2016
481a097
uninstall: document --ignore-dependencies
alyssais Oct 25, 2016
b71ce88
test_uninstall: style fixes
alyssais Oct 25, 2016
ec83d1d
uninstall: remove more integration tests
alyssais Oct 26, 2016
702345e
docs: fix typo for brew missing
alyssais Oct 30, 2016
f352638
Update man
alyssais Oct 30, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
uninstall: remove duplicated method
This was moved to Keg, but looks like I forgot to get rid of it here.
  • Loading branch information
alyssais committed Oct 25, 2016
commit d0ad09708218bfbffed4857387b259bceba177c2
33 changes: 0 additions & 33 deletions Library/Homebrew/cmd/uninstall.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,39 +92,6 @@ def check_for_dependents(kegs)
true
end

# Will return some kegs, and some dependencies, if they're present.
# For efficiency, we don't bother trying to get complete data.
def find_some_installed_dependents(kegs)
kegs.each do |keg|
dependents = keg.installed_dependents - kegs
dependents.map! { |d| "#{d.name} #{d.version}" }
return [keg], dependents if dependents.any?
end

# Find formulae that didn't have dependencies saved in all of their kegs,
# so need them to be calculated now.
#
# This happens after the initial dependency check because it's sloooow.
remaining_formulae = Formula.installed.select { |f|
f.installed_kegs.any? { |k| Tab.for_keg(k).runtime_dependencies.nil? }
}

keg_names = kegs.map(&:name)
kegs_by_name = kegs.group_by(&:to_formula)
remaining_formulae.each do |dependent|
required = dependent.missing_dependencies(hide: keg_names)
required.select! do |f|
kegs_by_name.key?(f)
end
next unless required.any?

required_kegs = required.map { |f| kegs_by_name[f].sort_by(&:version).last }
return required_kegs, [dependent]
end

nil
end

def rm_pin(rack)
Formulary.from_rack(rack).unpin
rescue
Expand Down