Skip to content
This repository has been archived by the owner on Jan 16, 2025. It is now read-only.

brew upgrade doesn't preserve brews options #11086

Closed
yacoob opened this issue Mar 20, 2012 · 12 comments
Closed

brew upgrade doesn't preserve brews options #11086

yacoob opened this issue Mar 20, 2012 · 12 comments
Labels

Comments

@yacoob
Copy link
Contributor

yacoob commented Mar 20, 2012

I've installed mtr with --no-gtk to prevent downloading whole bunch of libraries, as I don't really need graphical version of mtr. Some time later, a cronjob I'm running consisting of brew update && brew upgrade decided to update mtr - but it forgot my flag, and grabbed gtk+ plus all deps.

This shouldn't happen.

@jacknagel
Copy link
Contributor

Can you gist INSTALL_RECEIPT.json from the current mtr keg, and the old one?

@adamv
Copy link
Contributor

adamv commented Mar 20, 2012

I'm not sure but the issue may be that getting a Tab for a formula that has a newer version that what you have installed does not bring up the installed receipt; getting it for a keg seems to, though.

Though I may be misdiagnosing some behavior I'm seeing in a branch of mine.

@jacknagel
Copy link
Contributor

Tab.for_formula retrieves the tab using the LinkedKegs symlink, so as long as the keg was linked it *should* retrieve the right receipt.

@jacknagel
Copy link
Contributor

How old was the original mtr installation?

If it predates 9e773c3 (committed on Nov 13, 2011), it won't have an install receipt to pull options from.

@jacknagel
Copy link
Contributor

Figured it out.

upgrade is unlinking the existing keg before invoking the installer, so Tab.for_formula can't find the install receipt anymore.

@jacknagel
Copy link
Contributor

@mxcl can you think of a good solution here?

@mxcl
Copy link
Contributor

mxcl commented Mar 20, 2012

I apologise that I broke this feature.

I think we need to pass the tab to the formula_installer or whatever component uses the tab.

The unlink is a safety step that will prevent issues in the future, so it should stay, unless it fucks everything up.

@jacknagel
Copy link
Contributor

I think passing the tab to the installer makes sense.

@yacoob
Copy link
Contributor Author

yacoob commented Mar 22, 2012

Yes, that previous mtr installation was definitely order than Nov 13th. So I should take it that this was expected behavior, and it should work for any package installed like that past that date?

@jacknagel
Copy link
Contributor

That's how it should work, however it actually is broken atm for the reason I stated above (just tested it).

@jacknagel
Copy link
Contributor

Pushed a fix for this; we now load the tab before unlinking the keg and then pass it to the installer.

staticfloat pushed a commit to staticfloat/homebrew that referenced this issue Mar 26, 2012
Callers of FormulaInstaller now usually unlink the existing keg prior to
running the installer. However, Tab.for_formula uses the LinkedKeg
record to obtain the tab.

Since we need the tab to persist install options across upgrades, we
must start creating the Tab object before unlinking the old keg and
passing it to the FormulaInstaller.

Fixes Homebrew#11086.

Signed-off-by: Jack Nagel <[email protected]>
Sharpie pushed a commit to Sharpie/homebrew that referenced this issue Jun 18, 2012
Callers of FormulaInstaller now usually unlink the existing keg prior to
running the installer. However, Tab.for_formula uses the LinkedKeg
record to obtain the tab.

Since we need the tab to persist install options across upgrades, we
must start creating the Tab object before unlinking the old keg and
passing it to the FormulaInstaller.

Fixes Homebrew#11086.

Signed-off-by: Jack Nagel <[email protected]>
snakeyroc3 pushed a commit to snakeyroc3/homebrew that referenced this issue Dec 17, 2012
Callers of FormulaInstaller now usually unlink the existing keg prior to
running the installer. However, Tab.for_formula uses the LinkedKeg
record to obtain the tab.

Since we need the tab to persist install options across upgrades, we
must start creating the Tab object before unlinking the old keg and
passing it to the FormulaInstaller.

Fixes Homebrew#11086.

Signed-off-by: Jack Nagel <[email protected]>
@alexchandel
Copy link
Contributor

This issue should be reopened. I installed wine, so I had to manually install jpeg and libtiff with --universal (the wine keg is broken, and doesn't do this). Whenever I upgrade these libraries, they are invariably upgraded to a non-universal version.
Related issues, wrt "brew upgrade" on options:
#13197 for broken "upgrade" ignoring previously passed --HEAD option
#14694 for broken "upgrade" ignoring previously passed --devel option

@Homebrew Homebrew locked and limited conversation to collaborators Feb 16, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants