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

Ensure creation of ~/.osc_cookiejar adheres to XDG Base Directory Specification #940

Merged
merged 1 commit into from Aug 16, 2021
Merged

Ensure creation of ~/.osc_cookiejar adheres to XDG Base Directory Specification #940

merged 1 commit into from Aug 16, 2021

Conversation

hyperupcall
Copy link
Contributor

In a similar theme to #349, this ensures the file is created according to the XDG Base Directory specification. Just like that change, it uses the XDG Base Directly specification on windows (usually I prefer to use the spec only on Unix-like platlforms). In this case, XDG_CACHE_HOME seemed to be a better fit compared to XDG_STATE_HOME

A subtle difference compared to #349 is that XDG_STATE_HOME is not used if it is defined, but empty (in the other change, the variable is used if it is empty). This is more correct, according to the spec.

Test suite results (passes)
➤ python suite.py
..................................................................................................................................................................................................
----------------------------------------------------------------------
Ran 194 tests in 1.253s

OK

@marcus-h
Copy link
Member

marcus-h commented Aug 12, 2021 via email

@hyperupcall
Copy link
Contributor Author

Why?:)
Naively, I would say that we should store it in $XDG_STATE_HOME
because:

  • it should persist between (application) restarts
  • it is not important enough to store it in $XDG_DATA_HOME

Ahhh yeah, let's do $XDG_STATE_HOME

What are your arguments for $XDG_CACHE_HOME?

I originally went with it because I second guessed myself with $XDG_STATE_HOME (which is why that typo exists in the second paragraph :P)

Good catch! (You are talking about $XDG_CACHE_HOME, right?)

Yeah

Are you in the mood to create a new PR that fixes this for
$XDG_CONFIG_HOME?:)

Yup!

I'll soon update my branch with the code improvements you mentioned :)

@marcus-h
Copy link
Member

marcus-h commented Aug 14, 2021 via email

@hyperupcall
Copy link
Contributor Author

Awesome! - now squashed into a single commit

@marcus-h
Copy link
Member

marcus-h commented Aug 15, 2021 via email

…ation

The order is now:
- ~/.osc_cookiejar, if it exists
- $XDG_STATE_HOME/osc/cookiejar if XDG_STATE_HOME neither null nor empty
- ~/.local/state/osc/cookiejar
@hyperupcall
Copy link
Contributor Author

Oops! Sorry about that

@marcus-h marcus-h merged commit ebcf3de into openSUSE:master Aug 16, 2021
@marcus-h
Copy link
Member

marcus-h commented Aug 16, 2021 via email

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.

None yet

2 participants