Fix #6377: two tarballs with the same folder in them were considered as one #11855
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation / Problem
When you have two tarballs, both with the same foldername in them, they are considered to be part of the same folder. This means they merged together.
This is especially tricky if they also contain the same files, but with different content. Which file is actually being seen by OpenTTD heavily depends on in which order the game loads the tarballs.
This was identified in #6377, but never resolved. Yes, I am solving 9 year old bugs that were marked "good first issues". Also, given nobody replied to the ticket in 7 years, it seems to not be that big of a problem. But okay.
Fixes #6377.
Description
Although #6377 makes it sound like it is trivial to fix, and that "It is now no longer needed, but noone removed it.", it doesn't actually say what to remove. Turns out, it is not removing anything, it is about adding stuff.
Prefix all files added to the tar-list with the tarname they came from. This means that even if two tarballs have the same folder in them, they are different from one another.
Limitations
This is really hard to test. Although this "should be fine", and initial testing shows that base graphics, NewGRFs and AIs work fine, it is very hard to say if not something made an assumption somewhere in how deep an
info.nut
or whatever has to be.Checklist for review
Some things are not automated, and forgotten often. This list is a reminder for the reviewers.