Skip to content
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

Add: always set PERSONAL_DIR "/content_download" in search path #8481

Merged
merged 1 commit into from Jan 3, 2021

Conversation

TrueBrain
Copy link
Member

Fixes #7311.

Motivation / Problem

I am often annoyed during development that the content_download folder is only on the search-path once, and this is for the location it found openttd.cfg (or with XDG, this can be ~/.local/share/openttd/content_download. This means that from time to time I get the popup it cannot find my OpenGFX, as I downloaded it via the content service. I have to move it to baseset folder in my PERSONAL_DIR to not have this happening.

When does this popup happen? When using -c or when running the regression, mostly. I can imagine server-owners have similar experience.

There have been bugs reported about this, in all forms. The one that I could find that was still open is #7311.

Description

This means that if you start OpenTTD with "-c" to indicate another
location to store files, it can still read the content you already
downloaded from your PERSONAL_DIR. This folder is, however,
read-only.

This is useful for situations where you downloaded OpenGFX via
the content-service, but want to run the regression or want to
run with a clean configuration. With this change, you no longer
need to download OpenGFX again.

Limitations

  • This is a bit of a dirty solution, just adding additional search-paths, but it appears to be the most clean. All other search-paths (shared, binary, installation, application-bundle) cannot contain content_download. So the PERSONAL_DIR really was the only one missing here.

Checklist for review

Some things are not automated, and forgotten often. This list is a reminder for the reviewers.

  • The bug fix is important enough to be backported? (label: 'backport requested')
  • This PR affects the save game format? (label 'savegame upgrade')
  • This PR affects the GS/AI API? (label 'needs review: Script API')
    • ai_changelog.hpp, gs_changelog.hpp need updating.
    • The compatibility wrappers (compat_*.nut) need updating.
  • This PR affects the NewGRF API? (label 'needs review: NewGRF')

This means that if you start OpenTTD with "-c" to indicate another
location to store files, it can still read the content you already
downloaded from your PERSONAL_DIR. This folder is, however,
read-only.

This is useful for situations where you downloaded OpenGFX via
the content-service, but want to run the regression or want to
run with a clean configuration. With this change, you no longer
need to download OpenGFX again.
Copy link
Member

@LordAro LordAro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure.

@TrueBrain TrueBrain merged commit ab7da11 into OpenTTD:master Jan 3, 2021
@TrueBrain TrueBrain deleted the autodownload_personal branch January 3, 2021 10:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wrong determination of personal directory
2 participants