mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-09-11 15:13:27 +02:00
support egg-link format when installed from git repo
If you run `python setup.py install` from the git repo, then it will be installed using the .egg-link format, which just points to the git repo. `fdroid init` needs to handle that when looking for example files to copy.
This commit is contained in:
parent
45ffaac3f2
commit
a020625462
@ -70,10 +70,16 @@ def main():
|
||||
# find root install prefix
|
||||
tmp = os.path.dirname(sys.argv[0])
|
||||
if os.path.basename(tmp) == 'bin':
|
||||
prefix = os.path.dirname(os.path.dirname(__file__)) # use .egg layout
|
||||
if not prefix.endswith('.egg'): # use UNIX layout
|
||||
prefix = os.path.dirname(tmp)
|
||||
examplesdir = prefix + '/share/doc/fdroidserver/examples'
|
||||
prefix = None
|
||||
egg_link = os.path.join(tmp, '..', 'local/lib/python2.7/site-packages/fdroidserver.egg-link')
|
||||
if os.path.exists(egg_link):
|
||||
# installed from local git repo
|
||||
examplesdir = os.path.join(open(egg_link).readline().rstrip(), 'examples')
|
||||
else:
|
||||
prefix = os.path.dirname(os.path.dirname(__file__)) # use .egg layout
|
||||
if not prefix.endswith('.egg'): # use UNIX layout
|
||||
prefix = os.path.dirname(tmp)
|
||||
examplesdir = prefix + '/share/doc/fdroidserver/examples'
|
||||
else:
|
||||
# we're running straight out of the git repo
|
||||
prefix = os.path.normpath(os.path.join(os.path.dirname(__file__), '..'))
|
||||
|
Loading…
Reference in New Issue
Block a user