mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-09-13 22:42:29 +03:00
buildserver: use py3's pathlib to generate cache file URL
This should handle edge cases better, like odd characters in the path, etc.
This commit is contained in:
parent
97be5a1d00
commit
a3d32c65a4
1 changed files with 2 additions and 2 deletions
|
@ -1,6 +1,7 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
import pathlib
|
||||||
import requests
|
import requests
|
||||||
import stat
|
import stat
|
||||||
import sys
|
import sys
|
||||||
|
@ -52,9 +53,8 @@ options, args = parser.parse_args()
|
||||||
cachedir = os.path.join(os.getenv('HOME'), '.cache', 'fdroidserver')
|
cachedir = os.path.join(os.getenv('HOME'), '.cache', 'fdroidserver')
|
||||||
config = {
|
config = {
|
||||||
'basebox': 'jessie64',
|
'basebox': 'jessie64',
|
||||||
# TODO in py3, convert this to pathlib.Path(absolute_path_string).as_uri()
|
|
||||||
'baseboxurl': [
|
'baseboxurl': [
|
||||||
'file://' + os.path.join(cachedir, 'jessie64.box'),
|
pathlib.Path(os.path.join(cachedir, 'jessie64.box')).as_uri(),
|
||||||
'https://f-droid.org/jessie64.box',
|
'https://f-droid.org/jessie64.box',
|
||||||
],
|
],
|
||||||
'debian_mirror': 'http://http.debian.net/debian/',
|
'debian_mirror': 'http://http.debian.net/debian/',
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue