migrator: allow new cellar to exist already#2359
Conversation
a4eb7c5 to
9f9a2de
Compare
|
CC @vladshablinsky for review and thoughts here. @ilovezfs in cases like this I'd have thought the best thing would be to create a new |
|
That's what we're doing. |
|
Ok, I reread and I think I understand now, thanks. |
|
@ilovezfs do we really need that Also, I hope we'll allow any types of renames and deletions sooner or later so we're able to rename anything to anything if that't name is free at specific moment of time. So probably we need to be careful with complicating renames logic. Now when versioned formulae have arrived it got really more complicated than it used to be. |
If we want to upgrade all gnupg 1.0.x and 2.0.x users to 2.1.x, then yes. Note that we also have been sitting on Homebrew/homebrew-core#8334 and not shipping it for three months for the same reason. |
I think if there are any known problems we should fix them but if there's none specifically known then it's fine to 🚢 this.
Not quite right; it's blocked on #1770. |
So does 1770 affect the gpg upgrades too then? Not sure I see a difference between the situations really. |
I have no idea. I've still not been able to debug that problem yet. |
vladshablinsky
left a comment
There was a problem hiding this comment.
The only concern I have is what if somehow we got a different formula installed under newname cellar? I think it can be possible if we allow multiple renames.
|
@vladshablinsky I think it's |
@ilovezfs Also, let's suppose we have a non-core tap formula installed under |
Check existing newname to be from the same tap as oldname renamed to newname
|
The tap migrations from homebrew/versions to homebrew/core all had a rename to the @ naming scheme, so I'm not sure we can require the source and destination taps to be the same. |
I might have confused you, what I meant were formula renames and migrations of renamed formula. Let's migrate |
|
Yes I think that makes sense. Even though there never was a formula named gcc48 in homebrew/core, I think a lookup of the tap of a not-yet-renamed-to-gcc@4.8 gcc48 keg originally installed from homebrew/versions would return homebrew/core. |
|
@vladshablinsky Yes, you are right. It looks like the |
When would that happen? |
Probably when user eventually uninstalls it.
@ilovezfs even though what you say is true, please notice that this is not the case we're discussing.
UPD: probably you meant same things I said, though. |
I'm wondering if we should uninstall it for the user in a case like this (or at least prompt them to do so before migration?). |
IMO, migration must be impossible unless 👍 for prompting. |
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.
9f9a2de to
845d083
Compare
|
PR refreshed. |
brew testswith your changes locally?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.
The other choice here would be to continue using the name "gnupg2" for
the 2.1 series, and not reclaim the name "gnupg" from 1.x, which,
incidentally, would open up the possibility of a gnupg -> gnupg@1.4
rename.