264 Commits

Author SHA1 Message Date
Markus Reiter
6d8ee395fa Refactor Tty. 2016-10-01 20:00:49 +02:00
Markus Reiter
58e36c7319 Fix Style/GuardClause. 2016-09-24 12:24:35 +02:00
Mike McQuaid
6ff7fed070 update-report: link new completion/docs locations. 2016-09-20 10:41:42 +01:00
Mike McQuaid
2ecd73bca4 update-report: migrate on newer auto-update.
If we have a `brew.sh` which has set
`HOMEBREW_ENABLE_AUTO_UPDATE_MIGRATION` then let's allow an auto-update
migration. That's because it contains the fix below it _before_ the
update happened which means the auto-update won't fail in the same way
as if updating from an old version.
2016-09-20 09:07:02 +01:00
Mike McQuaid
8bf405e5f7 update-report: print message on completion link failure. 2016-09-20 08:03:06 +01:00
Mike McQuaid
1f128331b6 update-report: don't migrate on auto-update. 2016-09-20 08:02:52 +01:00
Markus Reiter
c0cc703516 update-report: Do not migrate Caskroom to HOMEBREW_REPOSITORY. 2016-09-19 17:49:40 +02:00
Mike McQuaid
b0f3e38ff9 update-report: tweak migration failure message. 2016-09-19 14:32:56 +01:00
Mike McQuaid
13f08a2bd4 update-report: add missing comma. 2016-09-19 11:51:17 +01:00
Mike McQuaid
a212340cc1 update-report: also migrate Caskroom. 2016-09-19 11:43:11 +01:00
Mike McQuaid
a2f19f0a67 update-report: tweak migration messaging
References #1023.
2016-09-19 09:52:13 +01:00
Mike McQuaid
6e1312d4a1 Merge pull request #1011 from MikeMcQuaid/migrate-legacy-repository-everyone
update-report: migrate everyone to new repository.
2016-09-19 09:05:14 +01:00
Mike McQuaid
d0204207ed update-report: remove cask dir after migration.
This will hang around otherwise due to e.g. running `bundle install` in
here once.
2016-09-18 21:42:44 +01:00
Mike McQuaid
42e9782dd6 update-report: cleanup git harder in migration.
Before stashing also try to cancel any current merge, rebase and
reset. This will prevent any data loss but also make the stash more
likely to succeed.
2016-09-18 20:25:18 +01:00
Mike McQuaid
027d8923f2 Merge pull request #1018 from MikeMcQuaid/update-migration-create-cellar
update-report: also create Cellar on migration.
2016-09-18 20:18:53 +01:00
Mike McQuaid
fc04d8f4f6 update-report: also create Cellar on migration.
Just on the off chance it doesn't exist (i.e. no-one has installed
anything yet or you're a `test-bot` that's run `git clean -xdf`
recently)
2016-09-18 19:32:29 +01:00
Mike McQuaid
ee0fb3e999 update-report: handle directory not existing.
This shouldn't be possible to occur after #1013 but it makes sense to
add it anyway.
2016-09-18 16:55:59 +01:00
Mike McQuaid
89ebffadec update-report: create top-level directories later.
Otherwise if they are created and empty they may be removed again
before we try to create the `/usr/local/bin/brew` symlink.
2016-09-18 16:06:49 +01:00
Mike McQuaid
72d0154454 update-report: migrate everyone to new repository.
Also migrate people without `HOMEBREW_DEVELOPER` set to the new
location.
2016-09-18 15:44:06 +01:00
Mike McQuaid
0a09ae30f8 update-report: migrate /usr/local repository.
Migrate a HOMEBREW_REPOSITORY and HOMEBREW_PREFIX of `/usr/local` so
that the HOMEBREW_REPOSITORY is now in `/usr/local/Homebrew`. This gives
us more flexibility on changing the repository layout in future and
avoids putting junk in `/usr/local` when not necessary (e.g. our
`README.md`).
2016-09-18 13:49:02 +01:00
Mike McQuaid
3982950e61 rubocop --auto-correct all hash-rocket usage. 2016-09-17 16:14:13 +01:00
Mike McQuaid
8f1ae3b28b Move LinkedKegs migration.
Move the `LinkedKegs` migration into `utils.rb` so it can also be called
from `brew.rb` on startup.
2016-09-17 15:00:46 +01:00
Mike McQuaid
8aa18510c4 Always run LinkedKegs migration (if needed).
Ensure that `brew update` always runs the LinkedKegs migration if needed
as it may not have been run by `brew update` if it was using `--preinstall` or
a `git pull` etc.

Also, if the old paths still exist: just use them instead.

Finally, always try to unlink/unpin before link/pin.

Fixes https://github.com/Homebrew/homebrew-core/issues/4918.
2016-09-17 13:25:32 +01:00
Mike McQuaid
e3609b6fd4 Move LinkedKegs/PinnedKegs/Locks from Library.
These don't make sense to be tied to the `HOMEBREW_REPOSITORY` but
instead should live in the `HOMEBREW_PREFIX` as they all relate to its
state.
2016-09-16 13:51:56 +01:00
Mike McQuaid
cc526601cf cmd/update-report: fix Rubocop warnings. 2016-09-11 17:59:01 +01:00
Mike McQuaid
ebdb879fe4 Add --help to all developer commands.
Also, flag those that we never want to be in a manpage.
2016-09-08 09:05:00 +01:00
Mike McQuaid
1160d0e347 update-report: also link docs, completions.
These are more files in the HOMEBREW_REPOSITORY that we want to link to
the HOMEBREW_PREFIX.
2016-09-06 09:04:51 +01:00
Mike McQuaid
2682b59b7f update-report: add newline if preinstall updated.
Fixes #858.
2016-09-03 19:36:34 +01:00
Mike McQuaid
3df7daa5bf update-report: also link brew*.1 manpages.
Otherwise if your `HOMEBREW_PREFIX` and `HOMEBREW_REPOSITORY` are not
equal then your tap manpages will be linked but your `brew*` ones will
not.
2016-08-24 11:06:58 +01:00
Mike McQuaid
66d564d885 update-report: tweak Cask migration output.
No longer output every cask under the list of changed formulae but
instead create a dedicated, unprinted report section for casks and then
iterate through that instead.
2016-08-05 16:34:56 +01:00
Mike McQuaid
3f505fe642 update-report: print developer exception backtraces. 2016-08-05 16:34:56 +01:00
Mike McQuaid
a9ab066654 Revert "Partially reverts 4338f35b848ad61462fc4f73e1365e6c002201a2"
This reverts commit b33b1af073979c8a699ed9688dba37fb7e74f0b5.
2016-08-05 15:28:20 +01:00
Xu Cheng
b33b1af073
Partially reverts 4338f35b848ad61462fc4f73e1365e6c002201a2 2016-08-05 22:16:19 +08:00
Anastasia Sulyagina
4338f35b84 tap: add cask methods. 2016-08-04 11:37:37 +01:00
Mike McQuaid
ebe8b8d328 update-report: use --overwrite to migrate Casks.
`--force` isn't quite what we want here as it'll just allow keg-only
linkage whereas we want to ensure we overwrite anything the Cask
installed.
2016-08-02 11:48:11 +01:00
AnastasiaSulyagina
be5484da8c update-report: allow Casks migration to formulae.
Closes #588.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2016-08-02 11:45:47 +01:00
Mike McQuaid
2bd5e0e5ad update-report: tweak cask migration text. 2016-08-02 11:45:32 +01:00
Josh Hagins
4abdeb7b5e update: Don't report formulae that are moved within a tap but not renamed (#480) 2016-07-16 07:18:30 +02:00
Mike McQuaid
0478c2fc0f update-report: prune on cask migration. (#428)
Do this to ensure that any symlinks in the Homebrew prefix and/or in
Applications are removed to stop issues with stale symlinks causing
Casks from being installed correctly.
2016-07-03 14:34:38 -05:00
Mike McQuaid
915eed4c64 update-report: remove unconditional cask/formula uninstall. 2016-06-22 13:50:39 +01:00
Anastasia Sulyagina
2d8b4376df update-report: migrate formulae to casks. (#375) 2016-06-22 13:36:17 +01:00
Mike McQuaid
4a8fcae3cc update-report: improve cache migration messaging. 2016-06-01 13:03:03 +01:00
Mike McQuaid
8108106cf9 update-report: recreate migration_attempted_file.
If the deletion of `HOMEBREW_CACHE` fails then the
`.migration_attempted` file will have still been deleted so ensure it is
recreated.
2016-06-01 12:47:56 +01:00
Mike McQuaid
52ee7bf9e3 update-report: fix Mavericks check. 2016-06-01 09:49:50 +01:00
Mike McQuaid
a9abbab917 Move HOMEBREW_CACHE to ~/Library/Caches (#292)
* cleanup: accept cache as an argument.

* config: move default HOMEBREW_CACHE to ~/Library.

* brew.1: document new default Homebrew cache.

* update-report: migrate legacy Homebrew cache.
2016-06-01 08:46:33 +01:00
Mike McQuaid
60e3737f17 update: improve some edge cases.
- When running `brew update` and there’s been no changes from upstream
on any repositories there’s no need to call the (relatively) slow `brew
update-report` when we already know what it will say (“Already up-to
date.”).
- When any`git fetch`es fail then throw out an error at the end of the
output and produce a failing exit code (closes #65).
2016-05-03 14:24:41 +01:00
Xu Cheng
98aff27317 add brew analytics command (#173) 2016-05-01 22:04:46 +08:00
Andrew Janke
05efd70dc3 Analytics: Separate user-supplied and internal-use DISABLE_ANALYTICS (#155)
This prevents `brew` self-calls from interacting with the stickiness of
HOMEBREW_NO_ANALYTICS being persisted to the brew repo and accidentally
disabling analytics permanently when it should have been for just one run,
while restoring the stickiness of an explicit user-supplied
HOMEBREW_NO_ANALYTICS.
2016-04-26 04:28:38 -04:00
Mike McQuaid
df489cfde2 More analytics tweaks.
Provide a single command that can be run to disable analytics, run it if
`HOMEBREW_NO_ANALYTICS` is ever set and remove the user UUID file in
that case too.

References https://github.com/Homebrew/brew/issues/142.
2016-04-25 18:51:00 -05:00
Mike McQuaid
421cd5365f Point to analytics documentation on brew update.
Make sure that users are notified on the first run of `brew update`
after we enabled analytics about how it works and how to opt-out. This
will be shown to all users who have not already seen this message from
`brew update` or through a new Homebrew installation.

References https://github.com/Homebrew/install/pull/42
References https://github.com/Homebrew/brew/issues/142
2016-04-25 18:05:30 -05:00