mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-09-16 16:02:33 +03:00
shutil.move() in apk_strip_signature() to work across filesystems
os.rename() only works if source and destination are on the same file system, shutil.move() works across file systems. OSError: [Errno 18] Invalid cross-device link: '/builds/eighthave/fdroidclient/app/build/outputs/apk/app-debug.apk' -> '/tmp/tmp966vh75f/tmp.apk'
This commit is contained in:
parent
bf913703c5
commit
2983c35361
1 changed files with 1 additions and 1 deletions
|
@ -2368,7 +2368,7 @@ def apk_strip_signatures(signed_apk, strip_manifest=False):
|
||||||
"""
|
"""
|
||||||
with tempfile.TemporaryDirectory() as tmpdir:
|
with tempfile.TemporaryDirectory() as tmpdir:
|
||||||
tmp_apk = os.path.join(tmpdir, 'tmp.apk')
|
tmp_apk = os.path.join(tmpdir, 'tmp.apk')
|
||||||
os.rename(signed_apk, tmp_apk)
|
shutil.move(signed_apk, tmp_apk)
|
||||||
with ZipFile(tmp_apk, 'r') as in_apk:
|
with ZipFile(tmp_apk, 'r') as in_apk:
|
||||||
with ZipFile(signed_apk, 'w') as out_apk:
|
with ZipFile(signed_apk, 'w') as out_apk:
|
||||||
for info in in_apk.infolist():
|
for info in in_apk.infolist():
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue