28 Commits

Author SHA1 Message Date
Max Nordlund
fa1fd70a37 Add all the top level comments 2016-04-10 22:59:25 +02:00
Zhiming Wang
81dc194ebf reinstall: add --interactive and --git options
Closes Homebrew/homebrew#47622.

Closes Homebrew/homebrew#47647.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2016-01-09 10:33:19 +00:00
Misty De Meo
727239e12f Merge bottle install without Xcode branch
Merge branch 'bottle_hooks'
2015-08-21 11:04:22 -07:00
William Woodruff
1face808f5 Add guards to calls that would trigger Xcode install requests
add guard in Formula#file_modified? to prevent git popup

add guard in Superenv.bin before calling MacOS::Xcode.version

add guard against missing Xcode/CLT in Xcode.uncached_version

return nil instread of 0 in uncached_version when Xcode/CLT are not present, to distinguish from linuxbrew behavior

checks against pour_bottle? and needs_relocation?, add guard around keg.relocate_install_names to check pour_bottle?/needs_relocation? as well

needs_relocation? becomes skip_relocation?, use cellar attr to indicate relocation instead of does_not_need_relocation

MacOS.can_build? becomes MacOS.has_apple_developer_tools?
2015-08-21 11:02:33 -07:00
William Woodruff
f58506ea6f FormulaInstaller: add prevent_build_flags to eliminate code repetition
remove unneeded definition

change variable in FormulaInstaller.check_build_flags from bf to build_flags
2015-08-21 10:59:35 -07:00
William Woodruff
91e598cf3f Install: add BuildToolsError and BuildFlagsError
Add these new errors, and guards in formula installation and
cmd/{,un,re}install to match, move can_build? to the MacOS module,
flatten conditions, remove redundant can_build? check

reinstate removed (doctor) check
2015-08-21 10:59:09 -07:00
Rafael Kitover
74b18bfe12 put caveats in finish after post_install Homebrew/homebrew#42565
When running brew -v install, long post_install output from the formula,
presumably from upstream, may hide the important instructions in the
caveats and confuse the user. For example, postgresql runs initdb which
prints its own instructions for running the database, making the caveats
scroll off screen.

Per xu-cheng's instructions in Homebrew/homebrew#42565 :

Remove the explicit call to caveats from the install, reinstall, and
upgrade commands, as well as the dependency installer code in
FormulaInstaller#install_dependency , and call caveats right before the
summary code in FormulaInstaller#finish .

Closes Homebrew/homebrew#42565.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-08-09 20:08:42 +08:00
BrewTestBot
13d544e11e Core files style updates.
Closes Homebrew/homebrew#42354.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-08-03 13:22:35 +01:00
Xu Cheng
3da315167c reinstall: use Formula#full_name 2015-05-29 17:02:22 +08:00
Xu Cheng
d338f291df reinstall: use ARGV.resolved_formulae 2015-05-27 13:53:42 +08:00
Mike McQuaid
28f26e0c9f reinstall, upgrade: tweak use of tab build_bottle.
In the case where a bottle wasn't around before and is now it probably
doesn't make sense to use `build-bottle` to build something that will
be identical to the binary bottle package anyway. After all, when you
use the bottle you will end up with something that has been built with
`build-bottle` anyway (just not by you).
2015-03-24 12:11:40 +00:00
Jack Nagel
73cc58641b More specific require 2014-10-31 20:10:49 -05:00
Jack Nagel
9a356fc609 Remove FormulaAlreadyInstalledError
install is the only command that can trigger this warning, so it should
be handled before instantiating the installer.
2014-10-31 18:33:39 -05:00
Jack Nagel
7266ecd4e3 Hide install receipt key names 2014-10-15 01:30:56 -05:00
Jack Nagel
10a1952d2c Only "extend self" once on the Homebrew module 2014-06-19 13:10:36 -05:00
Jack Nagel
ce1f598e98 Avoid realpath where it is not necessary
Symlinks in opt and LinkedKegs point directly at a keg in the cellar, so
only resolving one symlink should suffice, and make it clear what path
we are actually interested in.
2014-04-05 12:17:19 -05:00
Jack Nagel
eab90dcb56 Rewrite brew reinstall
Fixes Homebrew/homebrew#23928.
2014-03-15 10:53:03 -05:00
Jack Nagel
7966b29ac6 reinstall: re-raise original exception after cleaning up 2014-03-01 18:27:30 -06:00
Jack Nagel
cf4e7e5954 reinstall: fix incorrect use of Formula.canonical_name
Fixes Homebrew/homebrew#27117.
2014-03-01 18:22:35 -06:00
Samuel John
6ae2e872d3 reinstall cleanup 2013-09-05 14:59:33 +02:00
Xiyue Deng
8aae1dac7b Make reinstall transaction safe.
* Aborting during reinstall will now restore the originally installed
  keg.
  - Change install code to pass on CannotInstallFormulaError exception
    to caller so it can be reused in reinstall.
* Add "--force-new-install" flag to force installing a new formula.

Closes Homebrew/homebrew#22190.

Signed-off-by: Samuel John <github@SamuelJohn.de>
2013-09-05 14:02:29 +02:00
Mike McQuaid
0c5d928cad brew-reinstall: don't list --force in args. 2013-09-01 13:57:40 +01:00
Mike McQuaid
22da8eb633 brew-reinstall: don't try and rebuild bottles. 2013-09-01 13:57:40 +01:00
Samuel John
43fc7423d7 brew reinstall: Is able to work for all formulae
... and not just installed ones. Of course, strictly speaking,
reinstalling not-yet-installed formulae makes semantically little
sense, but the big win is that we can tell people (after we have
resolved an issue) to `brew reinstall <formula>` and even if a user
has removed that formula in the meantime, reinstall will do the right
thing. Basically adding --force to uninstall. I think this makes
reinstall more robust.
2013-08-21 20:18:55 +02:00
Samuel John
5a0bad6b42 Revert "brew reinstall: Is able to work for all formulae"
This reverts commit 865f763ae59fdf32f496ca416fd98117f3370f86.
2013-08-21 20:17:38 +02:00
Samuel John
4bb49a6439 brew reinstall: Is able to work for all formulae
... and not just installed ones. Of course, strictly speaking,
reinstalling not-yet-installed formulae makes semantically little
sense, but the big win is that we can tell people (after we have
resolved an issue) to `brew reinstall <formula>` and even if a user
has removed that formula in the meantime, reinstall will do the right
thing. Basically adding --force to uninstall. I think this makes
reinstall more robust.
2013-08-21 19:20:41 +02:00
Samuel John
cae03e3363 brew reinstall: Reuse options from last time
Now, we can finally stop stuggesting to
    `brew rm <foo>` and then `brew install <foo> <with-your-preferred options>

So `brew reinstall` will honor all options that have been recorded
into the INSTALL_RECEIPT.json plus if `--build-bottle` was used.
2013-08-14 22:25:03 +02:00
Mike McQuaid
ddaf891add Add 'brew reinstall' command. 2013-02-18 10:41:53 +00:00