mirror of
https://github.com/f-droid/fdroidserver.git
synced 2026-01-31 02:31:41 -05: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:
@@ -4117,15 +4117,16 @@ def _install_ndk(ndk):
|
||||
zipfp.extract(info.filename, path=ndk_base)
|
||||
os.chmod(os.path.join(ndk_base, info.filename), 0o644) # nosec bandit B103
|
||||
os.remove(zipball)
|
||||
extracted = glob.glob(os.path.join(ndk_base, '*'))[0]
|
||||
version = get_ndk_version(extracted)
|
||||
ndk_dir = os.path.join(ndk_base, version)
|
||||
os.rename(extracted, ndk_dir)
|
||||
if 'ndk_paths' not in config:
|
||||
config['ndk_paths'] = dict()
|
||||
config['ndk_paths'][ndk] = ndk_dir
|
||||
logging.info(_('Set NDK {release} ({version}) up')
|
||||
.format(release=ndk, version=version))
|
||||
for extracted in glob.glob(os.path.join(ndk_base, '*')):
|
||||
version = get_ndk_version(extracted)
|
||||
if os.path.basename(extracted) != version:
|
||||
ndk_dir = os.path.join(ndk_base, version)
|
||||
os.rename(extracted, ndk_dir)
|
||||
if 'ndk_paths' not in config:
|
||||
config['ndk_paths'] = dict()
|
||||
config['ndk_paths'][ndk] = ndk_dir
|
||||
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"""
|
||||
|
||||
Reference in New Issue
Block a user