1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-07-04 16:30:12 +02: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:
Hans-Christoph Steiner 2016-09-26 07:17:31 -04:00
parent 97be5a1d00
commit a3d32c65a4

View File

@ -1,6 +1,7 @@
#!/usr/bin/env python3
import os
import pathlib
import requests
import stat
import sys
@ -52,9 +53,8 @@ options, args = parser.parse_args()
cachedir = os.path.join(os.getenv('HOME'), '.cache', 'fdroidserver')
config = {
'basebox': 'jessie64',
# TODO in py3, convert this to pathlib.Path(absolute_path_string).as_uri()
'baseboxurl': [
'file://' + os.path.join(cachedir, 'jessie64.box'),
pathlib.Path(os.path.join(cachedir, 'jessie64.box')).as_uri(),
'https://f-droid.org/jessie64.box',
],
'debian_mirror': 'http://http.debian.net/debian/',