diff options
| author | Mike McQuaid | 2017-05-03 09:00:17 +0100 |
|---|---|---|
| committer | Mike McQuaid | 2017-05-03 09:00:17 +0100 |
| commit | f951a22beacdae7dd95c94eba67236fe221a3ca0 (patch) | |
| tree | fe131c76a1baa698ca20240311460b29c1de3295 /Library/Homebrew/formula.rb | |
| parent | 77b9ef84ee0025c85faa78c252291ebddc896313 (diff) | |
| download | brew-f951a22beacdae7dd95c94eba67236fe221a3ca0.tar.bz2 | |
Install etc/var files on postinstall.
Also, don't delete them after that. This means that `brew postinstall`
becomes a way to easily reinstall configuration files for any formula
without needing any changes to any bottles or requiring a reinstall.
Diffstat (limited to 'Library/Homebrew/formula.rb')
| -rw-r--r-- | Library/Homebrew/formula.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index 4ff5d3175..17a34dd13 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -1005,11 +1005,6 @@ class Formula def post_install; end # @private - def post_install_defined? - method(:post_install).owner == self.class - end - - # @private def run_post_install @prefix_returns_versioned_prefix = true build = self.build @@ -1025,6 +1020,11 @@ class Formula ENV.clear_sensitive_environment! + Pathname.glob("#{bottle_prefix}/{etc,var}/**/*") do |path| + path.extend(InstallRenamed) + path.cp_path_sub(bottle_prefix, HOMEBREW_PREFIX) + end + with_logging("post_install") do post_install end |
