updatecheck: support XDG-based token location
Have updatecheck look in $XDG_DATA_HOME/zcash/updatecheck/token for the GH token. Having one in the repo will still take precedence (for pre-existing users, as well as if you want to override the token used in a particular case). The new location is standardized, exists at the user level (as the token logically does), and means that you don't need to copy files around if you get a new clone or worktree to do a release.
This commit is contained in:
parent
4c21d6f444
commit
8e333b3f49
|
@ -28,9 +28,9 @@ Check that dependencies are up-to-date or have been postponed:
|
||||||
$ ./qa/zcash/updatecheck.py
|
$ ./qa/zcash/updatecheck.py
|
||||||
```
|
```
|
||||||
|
|
||||||
You can optionally create an `.updatecheck-token` file in the root of the
|
You can optionally create an `$XDG_DATA_HOME/zcash/updatecheck/token` file to
|
||||||
repository to avoid running into GitHub rate limiting. Create an unprivileged
|
avoid running into GitHub rate limiting. Create an unprivileged personal access
|
||||||
personal access token on GitHub and copy the value into the file.
|
token on GitHub and copy the value into the file.
|
||||||
|
|
||||||
If there are updates that have not been postponed, review their changelogs
|
If there are updates that have not been postponed, review their changelogs
|
||||||
for urgent security fixes, and if there aren't any, postpone the update by
|
for urgent security fixes, and if there aren't any, postpone the update by
|
||||||
|
@ -58,9 +58,8 @@ The release script has the following dependencies:
|
||||||
|
|
||||||
- `help2man`
|
- `help2man`
|
||||||
- `debchange` (part of the devscripts Debian package)
|
- `debchange` (part of the devscripts Debian package)
|
||||||
|
- the python modules `progressbar2` (optional - displays a progress bar),
|
||||||
You can optionally install the `progressbar2` Python module with pip to have a
|
`requests` and `xdg`
|
||||||
progress bar displayed during the build process.
|
|
||||||
|
|
||||||
## Versioning
|
## Versioning
|
||||||
|
|
||||||
|
|
|
@ -35,6 +35,7 @@ import requests
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
|
import xdg
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
SOURCE_ROOT = os.path.join(os.path.dirname(os.path.realpath(__file__)), "..", "..")
|
SOURCE_ROOT = os.path.join(os.path.dirname(os.path.realpath(__file__)), "..", "..")
|
||||||
|
@ -113,6 +114,8 @@ def get_dependency_list():
|
||||||
|
|
||||||
def parse_token():
|
def parse_token():
|
||||||
token_path = os.path.realpath(os.path.join(SOURCE_ROOT, ".updatecheck-token"))
|
token_path = os.path.realpath(os.path.join(SOURCE_ROOT, ".updatecheck-token"))
|
||||||
|
if not os.path.exists(token_path):
|
||||||
|
token_path = os.path.join(xdg.xdg_data_home(), "zcash/updatecheck/token")
|
||||||
try:
|
try:
|
||||||
with open(token_path, encoding='utf8') as f:
|
with open(token_path, encoding='utf8') as f:
|
||||||
token = f.read().strip()
|
token = f.read().strip()
|
||||||
|
|
Loading…
Reference in New Issue