|
|
@ -7,6 +7,7 @@ import os |
|
|
|
import sys |
|
|
|
import platform |
|
|
|
import imp |
|
|
|
import argparse |
|
|
|
|
|
|
|
version = imp.load_source('version', 'lib/version.py') |
|
|
|
|
|
|
@ -16,8 +17,12 @@ if sys.version_info[:3] < (2, 7, 0): |
|
|
|
data_files = [] |
|
|
|
|
|
|
|
if platform.system() in ['Linux', 'FreeBSD', 'DragonFly']: |
|
|
|
parser = argparse.ArgumentParser() |
|
|
|
parser.add_argument('--root=', dest='root_path', metavar='dir', default='/') |
|
|
|
opts, _ = parser.parse_known_args(sys.argv[1:]) |
|
|
|
usr_share = os.path.join(sys.prefix, "share") |
|
|
|
if not os.access(usr_share, os.W_OK): |
|
|
|
if not os.access(opts.root_path + usr_share, os.W_OK) and \ |
|
|
|
not os.access(opts.root_path, os.W_OK): |
|
|
|
if 'XDG_DATA_HOME' in os.environ.keys(): |
|
|
|
usr_share = os.environ['$XDG_DATA_HOME'] |
|
|
|
else: |
|
|
|