diff options
Diffstat (limited to 'Library/Homebrew/formula_installer.rb')
| -rw-r--r-- | Library/Homebrew/formula_installer.rb | 74 |
1 files changed, 0 insertions, 74 deletions
diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index 562232b16..5870ceeff 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -73,76 +73,6 @@ class FormulaInstaller raise end - def git_etc_preinstall - return unless quiet_system 'git', '--version' - - etc = HOMEBREW_PREFIX+'etc' - etc.cd do - quiet_system 'git', 'init' unless (etc+'.git').directory? - quiet_system 'git', 'checkout', '-B', "#{f.name}-preinstall" - unless quiet_system 'git', 'diff', '--exit-code', 'HEAD' - system 'git', 'add', '--all', '.' - system 'git', 'commit', '-m', "#{f.name}-#{f.version}: preinstall" - end - - unless quiet_system 'git', 'rev-parse', 'master' - quiet_system 'git', 'branch', 'master' - end - end - end - - def git_etc_postinstall - return unless quiet_system 'git', '--version' - - preinstall_branch = "#{f.name}-preinstall" - default_branch = "#{f.name}-default" - merged = false - f.etc.mkpath - f.etc.cd do - if quiet_system 'git', 'diff', '--exit-code', preinstall_branch - quiet_system 'git', 'branch', default_branch - quiet_system 'git', 'branch', '-D', preinstall_branch - elsif not quiet_system 'git', 'rev-parse', default_branch - quiet_system 'git', 'checkout', '-B', default_branch - quiet_system 'git', 'add', '--all', '.' - system 'git', 'commit', '-m', "#{f.name}-#{f.version}: default" - quiet_system 'git', 'branch', '-D', preinstall_branch - else - previous_default_branch = `git rev-parse #{default_branch}`.strip - quiet_system 'git', 'checkout', '-B', default_branch - quiet_system 'git', 'add', '--all', '.' - system 'git', 'commit', '-m', "#{f.name}-#{f.version}: default" - - default_unchanged = quiet_system('git', 'diff', '--exit-code', \ - previous_default_branch) - - if default_unchanged - system 'git', 'reset', '--hard', previous_default_branch - end - - quiet_system 'git', 'checkout', 'master' - quiet_system 'git', 'reset', '--hard', preinstall_branch - - unless default_unchanged - merge_ff = quiet_system 'git', 'merge', '--ff-only', '--no-edit', - '-X', 'ours', default_branch - unless merge_ff - merged = true - system 'git', 'merge', '--no-ff', '--no-edit', - '-X', 'ours', default_branch - end - end - end - - if merged - ohai "Configuration Files" - puts "Your configuration files for #{f.name} in etc were merged:" - puts "To reverse this merge: git reset --hard #{preinstall_branch}" - puts "To restore defaults: git reset --hard #{default_branch}" - end - end - end - def build_bottle_preinstall @etc_var_glob ||= "#{HOMEBREW_PREFIX}/{etc,var}/**/*" @etc_var_preinstall = Dir[@etc_var_glob] @@ -183,8 +113,6 @@ class FormulaInstaller @@attempted << f - git_etc_preinstall if ENV['HOMEBREW_GIT_ETC'] - @poured_bottle = false begin @@ -221,8 +149,6 @@ class FormulaInstaller opoo "#{f.name} post_install failed. Rerun with `brew postinstall #{f.name}`." end - git_etc_postinstall if ENV['HOMEBREW_GIT_ETC'] - opoo "Nothing was installed to #{f.prefix}" unless f.installed? end |
