53 Commits

Author SHA1 Message Date
Mike McQuaid
bc27e38f18
Remove ARGV.debug?
Replace with `Homebrew.args.debug?`.

Part of #5730.
2020-05-23 14:38:58 +01:00
Gautham Goli
161c3fb6a4 ARGV: Replaces usages of ARGV.force? with Homebrew.args.force? 2020-01-15 21:09:31 +05:30
Mike McQuaid
36dbad3922
Add frozen_string_literal to all files. 2019-04-20 13:27:36 +09:00
EricFromCanada
89f0fcedbe whitespace fixes 2019-04-13 21:32:04 -04:00
EricFromCanada
15c38a2d8b formatting fixes 2019-04-13 21:29:32 -04:00
EricFromCanada
fa6404e0f5 grammar fixes 2019-04-13 21:29:32 -04:00
Mike McQuaid
d64429a736
rubocop: enable Style/IfUnlessModifier. 2019-02-21 12:55:49 +00:00
EricFromCanada
20167e5f1b Adjust comments to tidy API docs output. 2018-10-18 21:42:43 -04:00
Markus Reiter
e9b9ea49a1 Update to RuboCop 0.59.1. 2018-09-17 03:45:59 +02:00
Mike McQuaid
80d75bc0d8
Homebrew/.rubocop: tweak rules.
Adjust the rules based on the current codebase. Remove various enable,
disables and default values that are unnecessary. Add more comments
explaining why. Make minor changes needed to enable a few more rules.
2018-09-02 20:15:09 +01:00
Andrew Janke
e0a8a79921 Style fixes for Rubocop 0.57.1 2018-06-30 19:40:14 -04:00
Mike McQuaid
9fca172d03 Fix HOMEBREW_RUBY_WARNINGS="-w"
Fix various circular requirements, method redefinitions, etc.
2018-04-07 20:28:56 +01:00
Mike McQuaid
1a51d7fb44 migrator: tweak more messaging.
- Make it clearer what the migrator is doing and why
- Recommend an unconditional brew upgrade
2018-03-05 10:14:39 +00:00
ilovezfs
08f7e8c588
Merge pull request #3864 from MikeMcQuaid/migrator-upgrade
migrator: recommend upgrade.
2018-03-02 21:18:22 -08:00
Mike McQuaid
2f776ed523 migrator: recommend brew upgrade.
You’re in a weird middle state if you run `brew update` but haven’t
upgraded a migrated formula.
2018-03-02 21:23:07 +00:00
Mike McQuaid
b4c268e3c5 migrator: overwrite by default.
This avoids getting into an invalid state which will and does break
for users.
2018-03-02 17:21:17 +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
Markus Reiter
2d6ae61314 Re-revert "Fix operator spacing." 2017-06-02 19:22:05 +02:00
Markus Reiter
060af0a26a Rename FormulaLock to LockFile. 2017-05-25 06:18:52 +02:00
Mike McQuaid
9b4d57b6df migrator: don't uninstall new_cellar if it existed
Otherwise we could end up removing files unnecessarily.
2017-03-31 10:36:26 +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
dd7121dd7c migrator: relink linked new_cellar kegs. 2017-03-31 10:01:46 +01:00
Mike McQuaid
f3743e98b6 migrator: make headers more consistent.
Use `oh1` for moving kegs to a new directory.
2017-03-31 10:01:45 +01:00
Mike McQuaid
1606e5db6f migrator: move around some migration logic.
Move the checks for moving kegs to a new directory into the relevant
method (`move_to_new_directory`) instead. Also, delete duplicated
directories when we’ve confirmed they are definitely duplicated rather
than telling users to do so.
2017-03-31 10:01:45 +01:00
Mike McQuaid
5d1f4dd531 migrator: add more helper methods.
Add methods to determine if a migration is needed and perform it if so
(and no-op if not). Additionally, make `ARGV.force?` get passed as a
parameter so it can be overridden without requiring users to pass
`—force`.
2017-03-31 10:01:45 +01:00
Mike McQuaid
45357ef0dd Fix handling of tap migrations to new cask names.
Need to check for two `/`s rather than one.
2017-03-30 19:18:40 +01:00
ilovezfs
845d083464 migrator: allow new cellar to exist already
Lets us migrate a formula to a name that may have previously been used.

If gnupg 1.x is installed as "gnupg" and gnupg 2.x is installed as
"gnupg2," it's currently not possible to rename gnupg2 -> gnupg, since
the 1.4 keg will already be installed in the "gnupg" Cellar, so in order
to reclaim the name "gnupg" to be used for 2.1, either 1.x must be
manually uninstalled, or the new cellar needs to be allowed to exist
already.
2017-03-23 04:09:45 -07:00
Mandar Gokhale
0e15ffff62 Correct a few typos
...and update man pages where applicable
2016-11-03 12:09:44 +00:00
Markus Reiter
75e8b59aad Add Formatter module. 2016-10-01 20:00:49 +02:00
Markus Reiter
6d8ee395fa Refactor Tty. 2016-10-01 20:00:49 +02:00
Markus Reiter
6c6a4c9fa7 RuboCop: Style/AccessorMethodName 2016-09-24 19:28:26 +02:00
Markus Reiter
58e36c7319 Fix Style/GuardClause. 2016-09-24 12:24:35 +02:00
Markus Reiter
fe2d51e0b9 Fix Style/IfUnlessModifier. 2016-09-23 15:30:07 +02:00
Mike McQuaid
3982950e61 rubocop --auto-correct all hash-rocket usage. 2016-09-17 16:14:13 +01:00
Mike McQuaid
6693915399 rubocop --auto-correct all remaining files.
But remove some manual `.freeze`s on constants that shouldn't be
constants.
2016-09-17 16:14:13 +01:00
Mike McQuaid
72d10fff0b Use constants for LinkedKegs/PinnedKegs/Locks.
These definitions are scattered throughout the codebase which makes it
hard to refactor them later (my goal is to move them outside of
HOMEBREW_LIBRARY). Unify their definitions for clearer code and easier
movement later.
2016-09-15 18:28:42 +01:00
Xu Cheng
bfb44d9e67 migrator: use Tap#core_tap? 2016-03-08 21:55:09 +08:00
Xu Cheng
b52af53e71 various: use Tap abstraction
formula_rename and tap_migrations are now handled inside Tap.

Closes Homebrew/homebrew#49549.

Signed-off-by: Xu Cheng <xucheng@me.com>
2016-02-26 17:00:17 +08:00
Xu Cheng
571011ad59 migrator: tap is a Tap object now 2015-12-09 16:56:59 +08:00
Xu Cheng
48950f2cc0 centralize the logic of handling homebrew- in Tap.fetch
Closes Homebrew/homebrew#46537.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-12-03 13:46:59 +08:00
Mike McQuaid
be45e6a0c5 migrator: link Cellar and opt before the keg.
When there's absolute symlinks in a linked directory in the `keg`
(e.g. `bin`)that point to the `Cellar` or `opt` then linking the `keg`
will fail before the `Cellar` or `opt` has been linked.

Closes Homebrew/homebrew#44306.

Closes Homebrew/homebrew#44329.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-09-25 16:53:34 +01:00
Vlad Shablinsky
a29832484c fix style problems in migrator
Closes Homebrew/homebrew#43473.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-09-03 13:58:25 +08:00
Misty De Meo
cb154116c5 migrator: #each.map is redundant 2015-08-24 19:36:24 -07:00
Vlad Shablinsky
896848dd87 migrator: skip check for same taps if --force 2015-08-20 19:55:35 +08:00
Xu Cheng
a628c15afd lock keg during migration 2015-08-20 15:47:42 +08:00
Xu Cheng
48f260f674 migrator: better exception printing 2015-08-15 20:37:24 +08:00
Vlad Shablinsky
f83d418608 migrator: don't use installed_prefix
Link the keg that was linked before migration. Don't use
newformula.installed_prefix to detect keg to link, because it can break
things (i.e. if intalled formula is outdated, then
newformula.installed_prefix can be not the same as installed prefix
before update).

Closes Homebrew/homebrew#42857.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-08-15 20:16:32 +08:00
Vlad Shablinsky
9736159c03 migrator: don't link newname if oldname isn't linked
- link newname only if oldname used to be linked
- optlink newname only if oldname used to be optlinked.
2015-08-15 20:16:31 +08:00
Vlad Shablinsky
2c1d8bcf65 migrator: check if old_opt_record exist before using realpath
- check if old_opt_record exist before using realpath
- don’t check old_opt_record.exist? in link_old_opt
  because it doesn’t have to exist.
2015-08-15 20:16:31 +08:00