From f951a22beacdae7dd95c94eba67236fe221a3ca0 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Wed, 3 May 2017 09:00:17 +0100 Subject: 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. --- Library/Homebrew/formula.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'Library/Homebrew/formula.rb') 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 @@ -1004,11 +1004,6 @@ class Formula # Can be overridden to run commands on both source and bottle installation. 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 @@ -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 -- cgit v1.2.3