290 Commits

Author SHA1 Message Date
Markus Reiter
3b4ee58c49 Refactor using Forwardable and DelegateClass. 2017-06-28 09:25:31 +02:00
Mike McQuaid
39b8f106d2 update-report: don't show new, installed formulae.
These were those migrated from other taps but if they are installed
already: they aren't new to that user.
2017-04-04 15:15:42 +01:00
Mike McQuaid
7d07d859ce migrator: check if taps are from same user instead
This avoids needing to use `force: true` and still let's Homebrew do
what we want with our own taps.
2017-03-31 10:28:45 +01:00
Mike McQuaid
ffd706d997 update-report: more forceful rename migration.
Migrate between different taps and delete relevant subdirectories if
they can be safely. Also, tweak some naming and use utility methods.
2017-03-31 10:01:45 +01:00
Mike McQuaid
b41a88eac4 update-report: check migration symlinks.
Check if `HOMEBREW_CELLAR/old_name` is a symlink. If so, it's already
been migrated so can be skipped.
2017-03-21 15:21:23 -07:00
Mike McQuaid
ec0737d71f Merge pull request #2370 from MikeMcQuaid/update-migrate-all-formula
update-report: migrate all formulae every time.
2017-03-21 14:40:07 +01:00
Mike McQuaid
4af8bdf111 update-report: migrate all formulae every time.
Unmigrated formulae cause hard-to-debug issues and relying on detection
on Git alone is faster but not comprehensive. Instead, iterate through
renamed, installed formulae every time and migrate them.

Closes #1770.
2017-03-20 18:10:28 +02:00
Mike McQuaid
ae43415fb4 update-report: migrated formulae were not deleted.
The taps they were migrated to are auto-tapped if not already tapped
anyway so don't show them as deleted to avoid confusion.
2017-03-20 15:28:24 +02:00
Markus Reiter
c594ffefbc Add Formatter::pluralize. 2017-03-11 21:12:51 +01:00
Mike McQuaid
0a8c8f90b6 Merge pull request #1708 from joshka/feature/install-tap-cmd-completions
install tap cmd completions
2017-02-27 08:42:17 +00:00
Joshua McKinney
25396d9c4d Install tap command completions and manpages
Taps can include completion scripts for external commands under
`completions/bash`, `completions/fish`, or `completions/zsh`. `brew tap`
will automatically install these into the correct directories during
install.
2017-02-26 15:40:52 -06:00
Zhiming Wang
95f9af24d3
update-report: unlink rather than uninstall --force formula when ...
migrating a formula to a cask.
2017-02-17 19:21:27 -05:00
Mike McQuaid
a3bffe70bc Use docs.brew.sh links. 2017-01-04 11:13:41 +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
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
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
Mike McQuaid
276864ebd1 update-report: default Caskroom moved to prefix.
Look at HOMEBREW_PREFIX rather than HOMEBREW_REPOSITORY for the default
Caskroom location.
2016-11-05 15:37:28 -04:00
Markus Reiter
198bf4d3bd Convert puts_columns to puts Formatter.columns. 2016-10-15 17:13:38 +02:00
Markus Reiter
9c2420a9ef “Homebrew Cask” -> “Homebrew-Cask” 2016-10-06 18:34:20 +02:00
Markus Reiter
cafe149780 Merge pull request #1145 from reitermarkus/module-function
Use `module_function` for `Homebrew` module.
2016-10-04 10:31:49 +02:00
Mike McQuaid
c6f5d24238 update-test: fix tag updating, skip core tap.
Fix updating the `stable` branch used for tagged updates and ensure
that the core tap isn’t retapped (the slowest part by far of this test).
2016-10-02 17:16:35 +01:00
Markus Reiter
c36f42ce95 Remove private_class_method from commands. 2016-10-02 00:24:47 +02:00
Markus Reiter
0ab750bf24 Use module_function for commands. 2016-10-02 00:24:47 +02:00
Markus Reiter
884b268506 Use Formatter for all URLs. 2016-10-01 20:00:49 +02:00
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