-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
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
Fix uninstall not working when version changes. #23328
Conversation
timestamped_versions.map(&:first) | ||
.reverse | ||
.uniq | ||
.reverse |
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.
Why reverse twice? Isn't .uniq.reverse
sufficient?
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.
Consider this:
timestamped_versions = [['a', '1'], ['b', '2'], ['a', '3']]
timestamped_versions.map(&:first) --> ['a', 'b', 'a']
.uniq --> ['a', 'b']
Now, .last
doesn't actually return the version which was installed last.
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.
Ah, gotcha.
I think a change of this magnitude warrants some new tests. Once those are added and the currently failing tests are fixed, I'm all for merging this 👍 |
@jawshooah, what exactly is According to |
@reitermarkus I'm not sure. Looks like it was added in #6117 "to provide persistent per-distribution locations to for GPG data". I'd be fine with moving the signature file to |
Ah, I had an error in thinking: I thought the But actually it's stored at Still, there's not much use keeping persistent data in a timestamped directory. |
@jawshooah, could you take a look at the test I have added (and the one I have altered)? Also, not sure what would be the best way to reuse the code from the Or should I simply add the test for the |
Ok, apparently |
@reitermarkus LGTM, merge when ready 👍 |
This pull request was merged in 36a98c5...1835d6d. |
Changes to the core
Todo
#2988
#14058