use shutil.move instead of os.rename to support move across filesystems
fixes 'OSError: [Errno 18] Invalid cross-device link' in setup.py:82:
Traceback (most recent call last):
File "setup.py", line 93, in <module>
install_apache_lib('/kafka/0.10.0.1/kafka_2.11-0.10.0.1.tgz', 'vendor/kafka-0.10.0.1', name='kafka-0.10.0.1')
File "setup.py", line 82, in install_apache_lib
os.rename(folder, output)
OSError: [Errno 18] Invalid cross-device link
@@ -79,7 +79,7 @@ def install_apache_lib(path, output, name):
folder = untar(tardest, wdir)
shutil.rmtree(output, ignore_errors=True)
- os.rename(folder, output)
+ shutil.move(folder, output)
finally:
shutil.rmtree(wdir, ignore_errors=True)
