mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-05 23:10:29 +03:00
init: check if examples/ exists in layout before using the path
There is definitely some odd stuff that happens in all these paths, so let's just check that examples/ exists, and move on from there.
This commit is contained in:
parent
c9394b1c99
commit
0bdbadabff
1 changed files with 5 additions and 5 deletions
|
|
@ -66,17 +66,17 @@ def main():
|
|||
|
||||
# find root install prefix
|
||||
tmp = os.path.dirname(sys.argv[0])
|
||||
examplesdir = None
|
||||
if os.path.basename(tmp) == 'bin':
|
||||
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'
|
||||
# try .egg layout
|
||||
examplesdir = os.path.dirname(os.path.dirname(__file__)) + '/share/doc/fdroidserver/examples'
|
||||
if not os.path.exists(examplesdir): # use UNIX layout
|
||||
examplesdir = os.path.dirname(tmp) + '/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…
Add table
Add a link
Reference in a new issue