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