mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-10-08 18:31:07 +03:00
Don't use exists() on symlinks
If they are broken, exists() will return false. islink() will return true in both cases.
This commit is contained in:
parent
1ed33bfa96
commit
712deb4396
1 changed files with 2 additions and 2 deletions
|
@ -911,7 +911,7 @@ def make_index(apps, sortedids, apks, repodir, archive, categories):
|
||||||
app[config['current_version_name_source']])
|
app[config['current_version_name_source']])
|
||||||
apklinkname = sanitized_name + '.apk'
|
apklinkname = sanitized_name + '.apk'
|
||||||
current_version_path = os.path.join(repodir, current_version_file)
|
current_version_path = os.path.join(repodir, current_version_file)
|
||||||
if os.path.exists(apklinkname):
|
if os.path.islink(apklinkname):
|
||||||
os.remove(apklinkname)
|
os.remove(apklinkname)
|
||||||
os.symlink(current_version_path, apklinkname)
|
os.symlink(current_version_path, apklinkname)
|
||||||
# also symlink gpg signature, if it exists
|
# also symlink gpg signature, if it exists
|
||||||
|
@ -919,7 +919,7 @@ def make_index(apps, sortedids, apks, repodir, archive, categories):
|
||||||
sigfile_path = current_version_path + extension
|
sigfile_path = current_version_path + extension
|
||||||
if os.path.exists(sigfile_path):
|
if os.path.exists(sigfile_path):
|
||||||
siglinkname = apklinkname + extension
|
siglinkname = apklinkname + extension
|
||||||
if os.path.exists(siglinkname):
|
if os.path.islink(siglinkname):
|
||||||
os.remove(siglinkname)
|
os.remove(siglinkname)
|
||||||
os.symlink(sigfile_path, siglinkname)
|
os.symlink(sigfile_path, siglinkname)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue