-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement the HOMEBREW_INSTALL_CLEANUP env to trigger cleanup on reinstall/install/upgrade #5165
Changes from 1 commit
18f8adb
51ca60d
452d1db
6c2f41b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ | |
expect(HOMEBREW_CELLAR/"testball/0.1").to be_a_directory | ||
end | ||
|
||
it "upgrades a Formula and cleans up old versions" do | ||
it "upgrades a Formula and cleans up old versions when `--cleanup` is passed" do | ||
setup_test_formula "testball" | ||
(HOMEBREW_CELLAR/"testball/0.0.1/foo").mkpath | ||
|
||
|
@@ -17,4 +17,17 @@ | |
expect(HOMEBREW_CELLAR/"testball/0.1").to be_a_directory | ||
expect(HOMEBREW_CELLAR/"testball/0.0.1").not_to exist | ||
end | ||
|
||
it "upgrades a Formula and cleans up old versions when `HOMEBREW_INSTALL_CLEANUP` is set" do | ||
setup_test_formula "testball" | ||
# allow(ENV).to receive(:[]).and_call_original | ||
# allow(ENV).to receive(:[]).with("HOMEBREW_INSTALL_CLEANUP").and_return("1") | ||
ENV["HOMEBREW_INSTALL_CLEANUP"] = "1" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've tried both manually setting into There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Wojonatior Ideally we wouldn't add another integration test for this (they are really slow). Either add a unit test or omit one entirely. |
||
(HOMEBREW_CELLAR/"testball/0.0.1/foo").mkpath | ||
|
||
expect { brew "upgrade" }.to be_a_success | ||
|
||
expect(HOMEBREW_CELLAR/"testball/0.1").to be_a_directory | ||
expect(HOMEBREW_CELLAR/"testball/0.0.1").not_to exist | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a clarification around the original feature, is the intent to keep both ENVs or to enhance what the old one did as well a rename it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Wojonatior Good question 👍 Let's remove the documentation for
HOMEBREW_UPGRADE_CLEANUP
in favour ofHOMEBREW_INSTALL_CLEANUP
but keep theHOMEBREW_UPGRADE_CLEANUP
variable functional for people who are still using it.