124 Commits

Author SHA1 Message Date
Mike McQuaid
e817bba18d upgrade: add HOMEBREW_UPGRADE_CLEANUP variable.
Allow users to specify they want `brew upgrade --cleanup` to always be
run when they run `brew upgrade`.
2018-03-12 11:05:06 +00:00
Peter Powell
e71b2d1737 upgrade: fix the man page wrongly saying that it will upgrade pins.
This is incorrect as in order to upgrade a pinned package it must
first be unpinned.
2018-03-10 12:07:13 +00:00
Mike McQuaid
e03f07f302 Rubocop 0.53.0 automatic fixes. 2018-03-08 14:10:02 +00:00
Teddy Wing
ee004cb9c7 cmd/upgrade: Change build.build_bottle? to build.bottle?
I received the following error when attempting to use the `upgrade`
command on a tap:

    $ brew tap teddywing/passextract https://github.com/teddywing/Passextract.git
    $ brew upgrade --verbose teddywing/passextract/passextract
    Updating Homebrew...

    ==> Upgrading 1 outdated package, with result:
    teddywing/passextract/passextract 0.4.0
    Error: Calling build.build_bottle? is disabled!
    Use build.bottle? instead.
    /usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:121:in `upgrade_formula'
    Or, even better, submit a PR to fix it!

Change the method call to use the (presumably) newer version.
2018-03-04 12:38:33 +01:00
Chayoung You
b05d69f600
Format identifiers in oh1 2018-02-09 18:00:29 +09:00
Mike McQuaid
3a2e6b82fd Make pinning more robust
Don’t autoremove pins on uninstall or upgrade and note this in the
manpage.
2018-02-05 10:59:11 +00:00
Mike McQuaid
de0fedeb09 upgrade --all: use odeprecated. 2018-01-21 13:39:14 +00:00
Mike McQuaid
838a3f1996 reinstall/upgrade: stop unlinked kegs being sticky
It's not possible to determine the difference between a non-keg-only
keg that failed to link and one that wasn't linked by us intentionally.

To avoid additional complexity of storing this logic in another place
let's back out this relatively new functionality; sticky keg-only links
is a better and more desirable behaviour anyway.
2018-01-10 16:43:21 +00:00
Mike McQuaid
9ed1ed3c05 upgrade: fix UnsatisfiedRequirements exit code. 2018-01-09 09:07:37 +00:00
Mike McQuaid
dbeebcaef5 upgrade: skip formula if upgrade fails.
Rather than blocking the rest of the formulae from being installed by
`brew upgrade` print the requirement failure messages (already done) and
an error stating requirements weren't satisfied and then continue to
upgrade the rest of the formulae.
2018-01-08 14:38:10 +00:00
Mike McQuaid
7eb1fd6671 reinstall/upgrade: document use of options.
To avoid user confusion e.g. #3606.
2017-12-30 21:23:33 +00:00
L. E. Segovia
9603e39f16 Rename whole build_options block (copypaste from reinstall) 2017-12-02 20:04:03 +00:00
L. E. Segovia
da764c6d6c Delete --ignore-dependencies additions 2017-12-02 20:03:38 +00:00
L. E. Segovia
4dfe6e32e4 Let the upgrade command add new build flags 2017-12-02 17:14:46 +00:00
L. E. Segovia
5f5e689752 Remember --ignore-dependencies when installing and upgrading 2017-12-02 13:41:11 +00:00
Markus Reiter
9bee9ca575 Use “squiggly” heredocs. 2017-10-18 14:39:09 +02:00
Markus Reiter
175ca909ee Clean up code style and remove .rubocop_todo.yml. 2017-10-08 16:10:37 +02:00
Mike McQuaid
044f4d947b Tweak preserve link status on reinstall/upgrade.
Treat a `brew install` command as normal i.e. link by default unless
keg-only and only specify whether a keg should be linked when upgrading
or reinstalling. Also, adjust the naming accordingly so it's more
obvious that this is the case.
2017-07-30 21:44:43 +01:00
Mike McQuaid
7ec0505200 Preserve link status on reinstall/upgrade.
This means if a user has manually `brew unlink` or `brew link --force`d
something then that status will be preserved after they `brew upgrade`
or `brew reinstall` that formula.

This generally should make things that are keg-only by default easier
to swallow.
2017-07-30 16:20:32 +01:00
Mike McQuaid
b8611bd988 formula_installer: simplify callers.
There's a bunch of duplication going on that's not really necessary.
2017-07-28 15:27:47 +01:00
Mike McQuaid
90c6d5f40a upgrade: perform rename migrations when needed. 2017-03-31 10:01:46 +01:00
ilovezfs
52d1d2cc3f upgrade: keg_only before non-keg_only formulae
Avoids unnecessary conflicts when a previously non-keg_only formula is
in the way by prioritizing keg_only before non-keg_only formulae.

This change is motivated by the upgrade of gnupg 2.0 to 2.1, since the
latter no longer depends on the gpg-agent formula, which, even if made
keg_only, still causes the link step to fail for 2.1, as gpg-agent's
non-keg version won't have been upgraded to the keg_only version at that
point (alphabetically gnupg precedes gpg-agent).
2017-03-17 12:39:43 -07:00
Markus Reiter
c594ffefbc Add Formatter::pluralize. 2017-03-11 21:12:51 +01:00
Mike McQuaid
f0249643d4 formula_installer: use attr_accessor for installed_* 2017-01-18 16:10:28 +00:00
Mike McQuaid
5424db1263 upgrade: temporarily comment out for fix. 2017-01-18 15:25:17 +00:00
Mike McQuaid
89d8864b6b upgrade: tab installed_{as_dependency,on_request} 2017-01-18 11:23:22 +00:00
Mike McQuaid
e347f7ade3 reinstall/upgrade/install: always output options.
This is both easier for debugging and to communicate with users what is
being done.
2016-12-10 13:07:03 +00:00
Mike McQuaid
56124f5963 Filter formula build options based on those that exist.
If `--with-foo` is provided to a formula through a tab or through
another formula depending on it and this option does not exist it
should be filtered. If it is not (the prior behaviour) then this can
prevent bottles being used unnecessarily.

Fixes #1399.
2016-11-12 12:11:55 +00:00
Markus Reiter
0ab750bf24 Use module_function for commands. 2016-10-02 00:24:47 +02:00
Mike McQuaid
f17a55b269 upgrade: tell people that --all is a no-op.
Apparently this is still run by people so let's tell them to save
some typing.
2016-10-01 15:11:52 +01:00
Mike McQuaid
c9d9e54de6 Fix brew style from #971. 2016-09-19 16:04:32 +01:00
Alyssa Ross
2a683f2569 upgrade, outdated: follow alias changes 2016-09-18 19:58:09 +01:00
Mike McQuaid
3982950e61 rubocop --auto-correct all hash-rocket usage. 2016-09-17 16:14:13 +01:00
Mike McQuaid
2c5beb0eff cmd/upgrade: fix Rubocop warnings. 2016-09-11 17:59:01 +01:00
Vlad Shablinsky
7fa9c0e977 Update --fetch-HEAD documentation 2016-08-11 09:30:59 +02:00
Uladzislau Shablinski
b8ce1fe1b2 Update upgrade/outdated documentation (#650) 2016-08-06 22:08:35 +08:00
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