mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
libmtp: make update script run on python3
Also make it not clone tons of useless history.
This commit is contained in:
parent
6aa1592052
commit
9ad1ebf487
8
src/calibre/devices/mtp/unix/upstream/update.py
Normal file → Executable file
8
src/calibre/devices/mtp/unix/upstream/update.py
Normal file → Executable file
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python2
|
||||
#!/usr/bin/env python3
|
||||
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:fdm=marker:ai
|
||||
from __future__ import (unicode_literals, division, absolute_import,
|
||||
print_function)
|
||||
@ -14,9 +14,7 @@ base = os.path.dirname(os.path.abspath(__file__))
|
||||
os.chdir('/tmp')
|
||||
if os.path.exists('libmtp'):
|
||||
shutil.rmtree('libmtp')
|
||||
subprocess.check_call(['git', 'clone', 'git://git.code.sf.net/p/libmtp/code',
|
||||
subprocess.check_call(['git', 'clone', '--depth=1', 'git://git.code.sf.net/p/libmtp/code',
|
||||
'libmtp'])
|
||||
for x in ('src/music-players.h', 'src/device-flags.h'):
|
||||
with open(os.path.join(base, os.path.basename(x)), 'wb') as f:
|
||||
shutil.copyfileobj(open('libmtp/'+x), f)
|
||||
|
||||
shutil.copyfile('libmtp/'+x, os.path.join(base, os.path.basename(x)))
|
||||
|
Loading…
x
Reference in New Issue
Block a user