3264 Commits

Author SHA1 Message Date
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
ee43c09f7a install: set installed_{as_dependency,on_request}. 2017-01-18 11:23:21 +00:00
Mike McQuaid
ffa5ebde53 Merge pull request #1863 from alyssais/uses_ignore_untapped
uses: properly handle untapped formulae in recursive dependency expansion (again!)
2017-01-17 19:58:52 +00:00
Mike McQuaid
1497dfaced Merge pull request #1862 from alyssais/uses_include_optional
uses: fix recursive requirement resolution
2017-01-17 19:58:30 +00:00
Alyssa Ross
9475622c07 uses: restore formula-level exception handler
This is a temporary measure until:

- #1862 is merged
- I can a test on `brew uses` against every formula in the official
  taps to verify that exceptions are no longer raised.
2017-01-16 23:28:26 +00:00
Alyssa Ross
0b216798bb Revert "Revert "uses: properly handle untapped fo…
…rmulae in recursive dependency expansion""

This reverts commit dc9819b86c60b5c6fd10373ff318d8ef60f97d52.
2017-01-16 23:28:26 +00:00
Alyssa Ross
36c1c8e9b0 uses: fix recursive requirement resolution
Fixes #1848 by sharing recursive dependency resolution between
dependencies and requirements.

Coincidentally, this also fixes the errors introduced by #1784 that
necessitated it being reverted in #1797.
2017-01-16 23:04:26 +00:00
Mike McQuaid
8f88b4c8e6 Merge pull request #1846 from MikeMcQuaid/fix-head-upgrade-man
Fix documentation for HEAD upgrades.
2017-01-15 20:42:23 +00:00
Mike McQuaid
7c15944991 Fix documentation for HEAD upgrades.
These can now be done with just `brew upgrade`, like other upgrades.

Fixes #1818.
2017-01-15 02:25:51 -08:00
Andrew Janke
62d48b4f9d brew deps --tree: fix gap in line between reqs and deps 2017-01-12 16:08:41 -05:00
Mike McQuaid
f5b63f4a8d Deprecate brew (un)linkapps.
Unfortunately `brew linkapps` cannot behave nicely with e.g. Spotlight
using either aliases or symlinks and Homebrew formulae do not build
"proper" `.app` bundles that can be relocated. Instead, please consider
using `brew cask` and migrate formulae using `.app`s to casks.
2017-01-09 14:10:26 +00:00
Mike McQuaid
dc9819b86c Revert "uses: properly handle untapped formulae in recursive dependency expansion" 2017-01-07 13:15:18 +00:00
Mike McQuaid
4f9c13926e Merge pull request #1784 from alyssais/uses_tap_exception
uses: properly handle untapped formulae in recursive dependency expansion
2017-01-07 12:50:45 +00:00
Alyssa Ross
536b6e2396 uses: properly handle recursive deps exceptions
Fixes #1776.

If any known formula had a dependency on an untapped tap,
Formula#recursive_dependencies would throw an exception, which would be
caught by the outer exception handler, causing the rest of the
dependencies for that formula to be skipped and incomplete output to be
generated.

To fix this, I added a check to avoid analysing the dependencies of
formulae from uninstalled taps.

Additionally, I removed the aforementioned outer exception handler added
in 5fdb89aed90f03413cdb21af430411c4a722876e, because the only other
place that should be capable of throwing such an exception is the
statement that was surrounded by another wider exception handler in
Homebrew/legacy-homebrew#40682.
2017-01-05 00:33:44 +00:00
Mike McQuaid
a3bffe70bc Use docs.brew.sh links. 2017-01-04 11:13:41 +00:00
Mike McQuaid
fc11f633b2 Merge pull request #1677 from MikeMcQuaid/formula-prefix-opt
formula: make prefix usually return opt_prefix.
2017-01-03 20:10:22 +00:00
Mike McQuaid
538028a735 Merge pull request #1766 from MikeMcQuaid/update-report-incoming-renames
update-report: handle homebrew/versions imports.
2017-01-02 20:42:57 +00:00
Mike McQuaid
ed66fa3ae5 update-report: handle homebrew/versions imports.
Imports from homebrew/versions are migrated from that tap and then
renamed immediately when they hit homebrew/core. This did not trigger
our previous rename detection so address these to improve the output and
handle migration correctly.
2017-01-02 17:24:52 +00:00
Mike McQuaid
79f9896d2f bottles: --force-bottle feigns or_later.
When reproducing issues with software that hasn’t been bottled yet on
your version of macOS it can sometimes be helpful to use `or_later`
bottle functionality i.e. just use the bottle for the latest version of
macOS available. This maps well to the existing `--force-bottle`
argument so it will now act as if the latest bottle has a `or_later`
ending.
2017-01-02 16:05:14 +00:00
Mike McQuaid
a571965df9 formula: make prefix usually return opt_prefix.
Return `opt_prefix` if it exists and `prefix` is not called from within
the same formula's `install` or `post_install` methods. Otherwise, fall
back to the existing functionality.

This avoids the need to use `opt_prefix` etc. everywhere and generally
means we don't expose an implementation detail (i.e. the full Cellar
path) to dependents that have a habit of hard-coding it.
2016-12-31 16:38:05 +00:00
Alyssa Ross
49310667b4 Revert "uninstall: remove nil requireds/dependents"
This reverts commit d7e72899e6f24dca5e02a734d5a4e64e39fc680e.
2016-12-31 12:23:53 +00:00
Alyssa Ross
bbf53ad4ab uninstall: don't comma-seperate kegs in example
The example command given in the dependency errors/warnings previously
comma-seperated the kegs, which was incorrect syntax. This fixes that.
2016-12-30 17:45:37 +00:00
Alyssa Ross
ea3a41e213 uninstall: better example in dependency warning
Previously, this only included a subset of all the kegs the user was
trying to uninstall. With this change, all named formulae/kegs will be
included in the example command.
2016-12-30 17:44:18 +00:00
Mike McQuaid
c3a2bf34a2 tap_migrations: support renaming to/from casks.
Allow `tap_migrations` entries to have a `user/repo/formula` or
`user/repo/cask` format for migration of formulae to/from casks.
2016-12-29 13:37:28 +00:00
Andrew Janke
6648ff1307 Merge pull request #1706 from apjanke/deps-all-full-name
brew deps: support --full-name in --installed, --all, and --tree modes
2016-12-28 00:05:33 -05:00
Andrew Janke
0097dbe4ee brew deps: support --full-name in --installed, --all, and --tree modes 2016-12-27 23:41:16 -05:00
Mike McQuaid
584fd64a9e Merge pull request #1684 from MikeMcQuaid/update-reset-command
update-reset: add new command.
2016-12-20 10:17:43 +00:00
Mike McQuaid
e3844719bc Merge pull request #1680 from MikeMcQuaid/post-install-sandbox-prefix
postinstall: don't allow writes to prefix itself.
2016-12-20 09:57:37 +00:00
Mike McQuaid
d21f6954b6 update-reset: add new command.
Add new `brew update-reset` command to provide a helpful troubleshooting
fallback to fetch and reset all repositories. This could have lived in
`brew update` but it makes sense to avoid the complexity of sharing
logic between these scripts and keeping this one simpler.
2016-12-18 15:25:18 -08:00
Mike McQuaid
2e15f713a0 prune: don't remove top-level directories.
Even if they're empty we want to keep these top-level directories around
as the installer has nicely created them with the correct permissions
and this avoids potentially having to use `sudo` to recreate them.
2016-12-13 01:05:11 +00:00
Mike McQuaid
2b547583a3 postinstall: don't allow writes to prefix itself.
Only the top-level directories inside it. We don't want formulae writing
random junk in e.g. `/usr/local` even in `postinstall`.
2016-12-13 00:13:20 +00:00
Uladzislau Shablinski
45ef7ea0b0 Merge pull request #1343 from vladshablinsky/explicit-specs
Allow to install any spec
2016-12-11 14:26:46 +03: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
Uladzislau Shablinski
73a1daa669 cmd/install: allow to install any spec
* installing HEAD keg_only should be possible only if:
  1.
    - Old version installed differs from new one and optlinked
    - `--force` flag is passed
    - HEAD is seriously outdated or outdated with `--fetch-HEAD`
  or 2.
    - Old version installed differs from new one and not optlinked
  or 3.
    - This formula is not installed

* installing keg_only should be possible only if:
  1.
    - Old version installed differs from new one and optlinked
    - `--force` flag is passed
  or 2.
    - Old version installed differs from new one and not optlinked
  or 3.
    - This formula is not installed

* installing HEAD should be possible only if:
  1.
    - Old HEAD is seriously outdated or outdated with `--fetch-HEAD`
  or 2.
    - HEAD is not installed

* installing stable or devel should be possible only if:
  - Old version installed differs from new one
2016-12-03 04:42:04 +03:00
Baptiste Fontaine
bff8e8440e update.sh: Use full path to pkill
Fixes #1600.
2016-12-01 20:59:42 +01:00
Mike McQuaid
d41e2ea5e8 update-report: allow skipping analytics message.
This is used by the install script so it can simplify it's logic and
make the analytics messaging more prominent.
2016-11-26 15:14:21 +00:00
Mike McQuaid
3469190c30 update-report: further tweak analytics output.
There were some bugs with the use of `HOMEBREW_NO_ANALYTICS_THIS_RUN`
and some output glitches I missed with the previous PR (#1575).
2016-11-26 13:58:41 +00:00
Mike McQuaid
7cd5ddfa65 update-report: further improve analytics messaging
- Don't output the analytics message and mark it as read if
`HOMEBREW_NO_ANALYTICS_THIS_RUN` is set. This mostly simplifies the
installer code where we can display the message ourselves there rather
than having `brew update` print it out sometimes and not others (i.e.
when there's no system Git installed).
- Use the shell's audible bell to nudge people to actually read this
message (and give them less excuse to complain when they don't).
- Add an extra newline and bold all the analytics messaging so it's
more visible in the output.
2016-11-26 12:56:02 +00:00
William Woodruff
d07b9ed7f2
Replace Utils::JSON with corelib JSON calls. 2016-11-20 20:06:25 -05:00
Mike McQuaid
39a0fec95d uninstall: ignore deprecations when uninstalling.
Handle `MethodDeprecatedError` because we want people to be able to
uninstall regardless of the content of their formula.
2016-11-18 09:34:58 +00:00
Mike McQuaid
649c7ab48a Merge pull request #1520 from vladshablinsky/list_follow_aliases
cmd/list: follow aliases
2016-11-17 15:58:25 +00:00
Uladzislau Shablinski
715caea79b cmd/list: follow aliases
Closes #1514
2016-11-16 02:08:38 +03:00
Mike McQuaid
d7e72899e6 uninstall: remove nil requireds/dependents
These shouldn’t get here in the first place so this is a bit of a hack
pending a better fix.
2016-11-15 14:34:49 +00:00
Mike McQuaid
484e3e0769 Merge pull request #1498 from alyssais/uninstall_developer_warning
Warn developers when uninstalling a dependency
2016-11-15 08:15:42 +00:00
Alyssa Ross
ca3562645c uninstall: style fixes
Works around Rubycop not liking method names that start with `is_`
by changing convention from singular to plural.

I think it's better that way anyway.
2016-11-14 13:39:17 +00:00
Alyssa Ross
c77040b346 uninstall: clean up warnings 2016-11-14 13:09:40 +00:00
Alyssa Ross
3c310b2e3d Warn developers when uninstalling a dependency
Suggested in #1084.

Made the existing warning output entirely to STDERR, because
previously the first line went to STDERR and subsequent ones went
to STDOUT.
2016-11-14 12:13:34 +00:00
Markus Reiter
353b67a6b2 No empty whens. 2016-11-14 09:45:44 +01:00