mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-11-04 14:30:11 +01: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
|
# find root install prefix
|
||||||
tmp = os.path.dirname(sys.argv[0])
|
tmp = os.path.dirname(sys.argv[0])
|
||||||
if os.path.basename(tmp) == 'bin':
|
if os.path.basename(tmp) == 'bin':
|
||||||
prefix = os.path.dirname(os.path.dirname(__file__)) # use .egg layout
|
prefix = None
|
||||||
if not prefix.endswith('.egg'): # use UNIX layout
|
egg_link = os.path.join(tmp, '..', 'local/lib/python2.7/site-packages/fdroidserver.egg-link')
|
||||||
prefix = os.path.dirname(tmp)
|
if os.path.exists(egg_link):
|
||||||
examplesdir = prefix + '/share/doc/fdroidserver/examples'
|
# 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:
|
else:
|
||||||
# we're running straight out of the git repo
|
# we're running straight out of the git repo
|
||||||
prefix = os.path.normpath(os.path.join(os.path.dirname(__file__), '..'))
|
prefix = os.path.normpath(os.path.join(os.path.dirname(__file__), '..'))
|
||||||
|
Loading…
Reference in New Issue
Block a user