mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
cmd/uninstall: note etc files that stay around.
We don't remove `etc` files on uninstall. Now we have `pkgetc`, though, we have a pretty decent guess at what files in `etc` may belong to a given package and can warn about them being left around on uninstall. Thoughts: should we do the same thing for `var`? I don't see it being used nearly as consistently.
This commit is contained in:
parent
a635db0f26
commit
04ae589d5c
@ -80,6 +80,27 @@ module Homebrew
|
||||
puts "#{keg.name} #{versions.to_sentence} #{"is".pluralize(versions.count)} still installed."
|
||||
puts "Run `brew uninstall --force #{keg.name}` to remove all versions."
|
||||
end
|
||||
|
||||
paths = f.pkgetc.find.map(&:to_s) if f.pkgetc.exist?
|
||||
if paths.present?
|
||||
puts
|
||||
opoo <<~EOS
|
||||
The following #{f.name} configuration files have not been removed!
|
||||
If desired, remove them manually with `rm -rf`:
|
||||
#{paths.sort.uniq.join("\n ")}
|
||||
EOS
|
||||
end
|
||||
|
||||
unversioned_name = f.name.gsub(/@.+$/, "")
|
||||
maybe_paths = Dir.glob("#{f.etc}/*#{unversioned_name}*") - paths
|
||||
if maybe_paths.present?
|
||||
puts
|
||||
opoo <<~EOS
|
||||
The following may be #{f.name} configuration files and have not been removed!
|
||||
If desired, remove them manually with `rm -rf`:
|
||||
#{maybe_paths.sort.uniq.join("\n ")}
|
||||
EOS
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user