Update ffmpeg-mt (libav) submodule
[mplayer2-build.git] / disable-mt
blob9db95bef0a3b7bc61abbafa99faaa1a0e278ed1b
1 #!/usr/bin/env python
3 import os
4 import sys
5 from os import path
6 from subprocess import check_call
8 from script.helpers import GitWrapper
10 def main():
11 print "Currently only ffmpeg-mt is supported."
12 sys.exit(1)
13 git = GitWrapper()
14 open('ffmpeg-mt-disabled', 'w').close()
15 if path.exists('ffmpeg-mt-enabled'):
16 os.remove('ffmpeg-mt-enabled')
17 # Allow setups where both ffmpeg and ffmpeg-mt are checked out
18 # simultaneously, and leave the directories alone in that case.
19 if path.exists('ffmpeg-mt/.git') and not path.exists('ffmpeg/.git'):
20 # ffmpeg should be an empty directory if things are right
21 os.rmdir('ffmpeg')
22 os.rename('ffmpeg-mt', 'ffmpeg')
23 os.mkdir('ffmpeg-mt')
24 if git.supports_nofetch:
25 cmd = 'git submodule update --no-fetch'.split()
26 else:
27 cmd = 'git submodule update'.split()
28 check_call(cmd + ['ffmpeg'])
29 os.chdir('ffmpeg')
30 def func(cmd=cmd):
31 check_call(cmd)
32 git.foreach_module(func)
34 main()