288 Commits

Author SHA1 Message Date
Vlad Shablinsky
9754dbada8
Update upgrade/outdated methods for head versions
Introduce `--fetch-HEAD` option. Without this option upgrade and
outdated never fetch latest upstream commit to detect if HEAD is
outdated -- tabs are used instead. However, if option is passed,
we fetch commit from upstream, which is more time consuming,
but we can be sure that version is up-to-date or outdated.
2016-08-06 21:25:56 +08:00
Xu Cheng
a8566c9848 various: eliminate the usage of any? (#638)
`any?` is not the opposite of `empty?`. Besides the case that
`[false, nil].any?` will return false, `any?`(O(n)) has much worse
performance than `empty?`(O(1)).
2016-08-05 22:01:32 +08:00
Mike McQuaid
164e46a729 Add missing development_tools requires. 2016-07-29 21:21:02 -06:00
Xu Cheng
820b6347b8
remove unnecessary Tab.for_formula
We already loaded tab in ARGV.resolved_formulae or Formulary.from_rack
2016-07-18 18:11:53 +08:00
Mike McQuaid
3a127e405e development_tools: add installed? method. (#455) 2016-07-06 11:07:24 +01:00
Andrew Janke
d887dd39ec brew install: make -s apply only to given formula, not deps (#205) 2016-05-06 12:02:13 -07:00
Max Nordlund
fa1fd70a37 Add all the top level comments 2016-04-10 22:59:25 +02:00
Baptiste Fontaine
9bdd6619e2 cleanup: move code away from cmd/
Closes Homebrew/homebrew#47484.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2016-01-04 13:17:21 +01:00
Xu Cheng
863c83a0f5 upgrade: use installed_kegs 2015-11-29 20:24:30 +08:00
Mike McQuaid
6054666fa6 formula: refactor outdated handling, add to hash. 2015-11-27 16:52:54 +00:00
Rakesh
2d60187e1a brew upgrade: provides an option --cleanup
Closes Homebrew/homebrew#44305.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-10-07 14:05:11 +08: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
Mike McQuaid
f4af833714 Revert "upgrade: announce usage of --all."
This reverts commit 9032f165bec3d0c7452169093fab32578816043b.

This seems to have been universally unpopular so let's revert it.

Closes Homebrew/homebrew#40372.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-06-05 14:20:21 +01:00
Xu Cheng
082ce482fc upgrade: use Formula#full_name 2015-05-29 17:02:23 +08:00
Xu Cheng
e744e8b0f9 upgrade: use ARGV.resolved_formulae 2015-05-27 13:53:42 +08:00
Mike McQuaid
c725059251 upgrade: announce usage of --all.
Tell users that we will soon be migrating `--all` so it is required if
you wish to upgrade all formulae.

Closes Homebrew/homebrew#38572.
2015-04-26 19:40:33 +01: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
4398660cdd Checkout outdatedness in brew upgrade <formula>
Fixes Homebrew/homebrew#35523.
2015-01-04 14:03:56 -05:00
Jack Nagel
9db8580414 Explicitly pass formulae to outdated_brews 2015-01-04 00:41:24 -05:00
Jack Nagel
e1bfbad810 Make quieter an installer mode 2014-11-03 21:43:11 -06:00
Jack Nagel
7266ecd4e3 Hide install receipt key names 2014-10-15 01:30:56 -05:00
Jack Nagel
f3b7c3236b Consistently call name on formula instead of relying on to_s 2014-09-14 11:19:30 -05:00
Larry Shaffer
b6cca78e05 Upgrade honors build_bottle? and built_as_bottle options
Closes Homebrew/homebrew#31628.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2014-08-17 15:36:24 -05:00
Jack Nagel
10a1952d2c Only "extend self" once on the Homebrew module 2014-06-19 13:10:36 -05:00
Adam Vandenberg
8d44db6b40 pluralize formulae in tap/untap
Closes Homebrew/homebrew#28560.
2014-05-26 18:33:31 -07: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
a72061c59a Check existence of target keg instead of hiding exceptions 2014-03-24 11:00:55 -05:00
Jack Nagel
3b68723fa8 Make FormulaInstaller setup more readable 2014-03-13 15:59:54 -05:00
Jack Nagel
ce5e2aa65c Make debug an installer mode 2014-03-13 15:59:54 -05:00
Jack Nagel
4d02849d43 Make verbose an installer mode 2014-03-13 15:59:54 -05:00
Jack Nagel
60caf14ce2 Don't set installer options to their default
ignore_deps and show_header default to false.
2014-03-13 15:59:53 -05:00
Jack Nagel
a911dd5066 Make build_from_source an explicit installer mode 2014-03-10 14:56:02 -05:00
Jack Nagel
17032a600c Teach commands to work with revisions 2014-03-05 20:12:51 -06:00
Jack Nagel
1ab5943fb2 Let commands decide what mode the installer should use 2014-03-04 14:06:25 -06:00
Jack Nagel
4c0db19538 Extract installer setup to prelude method 2014-03-04 14:06:25 -06:00
Jack Nagel
de254f6cd6 Stop mutating build options in upgrade 2014-03-02 14:02:18 -06:00
Jack Nagel
c534b1907d Revert "Let commands decide what mode the installer should use"
I'd still like to make this change, but at least for now the initializer
requires ignore_deps to be set correctly.

This reverts commit 881a8855b944fa9bd7dfd598bb9197f79f7a13f0.
2014-03-02 09:01:50 -06:00
Jack Nagel
47f22d20af Fix typo 2014-03-02 00:30:09 -06:00
Jack Nagel
ffbe5bf22c Let commands decide what mode the installer should use 2014-03-02 00:21:13 -06:00
Jack Nagel
ea85812c58 Reduce the number of ways options can be passed to the installer 2014-03-02 00:03:08 -06:00
Drew Rodman
d63ef14794 Add DownloadError to catch a broader range of resource download errors.
Adding a broader exception class allows for errors raised in Resource.fetch
to be caught in upgrade and prevent the process from being killed when
a download fails. This should resolve issue 18364.

Fixes Homebrew/homebrew#18364.
Closes Homebrew/homebrew#26618.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2014-02-18 15:08:03 -05:00
Frizlab
5de3686cd2 upgrade: fix output when no packages to upgrade.
When upgrading, if the only package to upgrade is a
pinned package, the output looked like that:
	==> Upgrading 0 packages, with result:

	==> Not upgrading 1 pinned package:
	<<package_name & version>>

The blank line is not beautiful. This commit fixes
the output and replaces with:
	==> No packages to upgrade
	==> Not upgrading 1 pinned package:
	<<package_name & version>>

Closes Homebrew/homebrew#26157.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2014-01-26 18:04:20 +01:00
Nikolaus Wittenstein
f17289f708 upgrade.rb: Fix plural_s when number = 0
Currently Upgrade prints out:
"Upgrading 0 outdated package, with result:"

This change makes it print:
"Upgrading 0 outdated packages, with result:"
correctly pluralizing "packages".

Closes Homebrew/homebrew#22854.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2013-09-26 22:54:51 -07:00
Adam Coffman
753adbb0ce upgrade: put exit statements in both conditional branches
This check was only occurring in one branch of the conditional.
As a result, if you ran `brew upgrade` with no args and there were no packages to upgrade,
the nonsensical message

"==> Upgrading 0 outdated package, with result:"

would be printed.

Closes Homebrew/homebrew#21316.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2013-07-18 15:35:17 -05:00
Jack Nagel
9fb163d34c upgrade: don't rely on return value of 'onoe' 2013-07-15 23:47:04 -05:00