mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-09-14 15:02:51 +03:00
fix broken NDK extraction routine to correctly name resulting dir
If there were other NDKs installed, this just tried to rename the first installed NDK. Now it tries to rename all NDKs that are not named after the NDK version. !926 !927
This commit is contained in:
parent
bf4feab877
commit
d6c8ecc3bc
1 changed files with 10 additions and 9 deletions
|
@ -4117,15 +4117,16 @@ def _install_ndk(ndk):
|
||||||
zipfp.extract(info.filename, path=ndk_base)
|
zipfp.extract(info.filename, path=ndk_base)
|
||||||
os.chmod(os.path.join(ndk_base, info.filename), 0o644) # nosec bandit B103
|
os.chmod(os.path.join(ndk_base, info.filename), 0o644) # nosec bandit B103
|
||||||
os.remove(zipball)
|
os.remove(zipball)
|
||||||
extracted = glob.glob(os.path.join(ndk_base, '*'))[0]
|
for extracted in glob.glob(os.path.join(ndk_base, '*')):
|
||||||
version = get_ndk_version(extracted)
|
version = get_ndk_version(extracted)
|
||||||
ndk_dir = os.path.join(ndk_base, version)
|
if os.path.basename(extracted) != version:
|
||||||
os.rename(extracted, ndk_dir)
|
ndk_dir = os.path.join(ndk_base, version)
|
||||||
if 'ndk_paths' not in config:
|
os.rename(extracted, ndk_dir)
|
||||||
config['ndk_paths'] = dict()
|
if 'ndk_paths' not in config:
|
||||||
config['ndk_paths'][ndk] = ndk_dir
|
config['ndk_paths'] = dict()
|
||||||
logging.info(_('Set NDK {release} ({version}) up')
|
config['ndk_paths'][ndk] = ndk_dir
|
||||||
.format(release=ndk, version=version))
|
logging.info(_('Set NDK {release} ({version}) up')
|
||||||
|
.format(release=ndk, version=version))
|
||||||
|
|
||||||
|
|
||||||
"""Derived from https://gitlab.com/fdroid/android-sdk-transparency-log/-/blob/master/checksums.json"""
|
"""Derived from https://gitlab.com/fdroid/android-sdk-transparency-log/-/blob/master/checksums.json"""
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue