35 Commits

Author SHA1 Message Date
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
Mike McQuaid
49dce3e7ae outdated: check if formula needs to be migrated.
Closes Homebrew/homebrew#42938.
2015-08-14 15:18:45 +01:00
Vlad Shablinsky
f88f2b7054 update tabs only if core formula installed
Closes Homebrew/homebrew#42745.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-08-10 16:09:26 +01:00
Vlad Shablinsky
832c5875b0 add migrator class for migrating renamed formulae 2015-08-10 13:57:59 +01:00