As a conscientious user, I update, upgrade cleanup and doctor my homebrew on a daily basis, but I got more and more
Error: Formula XXX will not import.
on brew doctor.
It seems removed formulas are responsible of those messages but I would like to know if there is a way to clean this unstable state to avoid such frightening messages 😁
Can you please paste an example of this to gist.github.com?
Have you replaced your /usr/bin/ruby?
Shure, here it is.
No, I did not touch ruby, it's still at the right place in the state I found it ;)
It looks like those are all php formulae, which were recently moved to a dedicated repository. Do you have josegonzalez/homebrew-php tapped?
I do, but I used to use the "official" formulas before.
Do I have to report an issue at josegonzalez instead ?
That has happened to me, too, when I switched from php formulas to php54 formulas. I solved the problem by simply deleting (e.g. rm /usr/local/Library/formula/php-apc.rb) the old php formulas.
Problem is these formulae were removed, and calling brew update properly symlinks the new links, but it doesn't unlink removed - or, in this case, renamed - formulae.
This isn't a bug in homebrew-php, just something not considered when building brew tap.
@mistydemeo I don't think @mxcl responds to ICMP packets.
I may be wrong (then stop me), but maybe brew cleanup should remove those obsolete formulaes, don't you think so ?
Yeah, I know it does not (that's why I opened this issue) but in my opinion, it would/should.
But maybe that behaviour could create issues with custom personal formulaes ?
so what do we do? try to clean up brew manually or install it anew and not use tap anymore?
I'm stuck on this too? Anyone have a solution?
Untap the offending repository, or fix the offending formula.
@adamv since untapping and re-tapping doesnt help, how do I fix the offending formula?
rm the unlinked formula within your Formula folder.
I think that worked, thanks
So the problem is the tap renamed the formula and this was not cleaned up by brew update, right?
Correct. I don't get into the habit of renaming formulae, but it was necessary in this case to support multiple PHP versions.
Right, okay. Thanks.
Worth noting renaming formula in general breaks brew at this point. Since if a formula was installed under the old name it will not get upgrades. Though this will be fixed.
I will look into fixing the tap issue though as this is separate.
Closing since the issue here was discussed, and we have another open issue to support renames.