Fix for ARM
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
import os
|
import os
|
||||||
import platform
|
import platform
|
||||||
|
import shutil
|
||||||
|
import sys
|
||||||
|
|
||||||
|
|
||||||
def dir_size(start_path):
|
def dir_size(start_path):
|
||||||
@@ -19,18 +21,29 @@ def get_resource_path(filename):
|
|||||||
|
|
||||||
|
|
||||||
def get_tor_paths():
|
def get_tor_paths():
|
||||||
from ..onion.tor_downloader import download_tor
|
if (platform.system() != "Darwin" and
|
||||||
if platform.system() in ["Linux", "Darwin"]:
|
platform.machine().lower() in ['aarch64', 'arm64']):
|
||||||
tor_path = os.path.join(build_data_dir(), 'tor/tor')
|
if shutil.which('tor'):
|
||||||
elif platform.system() == "Windows":
|
return 'tor'
|
||||||
tor_path = os.path.join(build_data_dir(), 'tor/tor.exe')
|
else:
|
||||||
|
print('Detected ARM system and tor is not installed or added to PATH. '
|
||||||
|
'Please, consider reading documentation and installing application '
|
||||||
|
'properly')
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
raise "Platform not supported"
|
from ..onion.tor_downloader import download_tor
|
||||||
|
if platform.system() in ["Linux", "Darwin"]:
|
||||||
|
tor_path = os.path.join(build_data_dir(), 'tor/tor')
|
||||||
|
elif platform.system() == "Windows":
|
||||||
|
tor_path = os.path.join(build_data_dir(), 'tor/tor.exe')
|
||||||
|
else:
|
||||||
|
raise Exception("Platform not supported")
|
||||||
|
|
||||||
if not os.path.isfile(tor_path):
|
if not os.path.isfile(tor_path):
|
||||||
download_tor(dist=build_data_dir())
|
download_tor(dist=build_data_dir())
|
||||||
|
|
||||||
return tor_path
|
return tor_path
|
||||||
|
|
||||||
|
|
||||||
def build_data_dir():
|
def build_data_dir():
|
||||||
|
|||||||
Reference in New Issue
Block a user