Update mplayer and libass submodules
[mplayer-build.git] / init
blob575605fb2c65a00dad1620a841fc766b28d3b0cb
1 #!/bin/sh
2 set -e
4 # Use a depth greater than 1 for shallow clones to reduce the chance that
5 # required submodule versions are not fetched when all branch heads in the
6 # corresponding repo have moved ahead.
8 for ac_option do
9 case "$ac_option" in
10 --shallow)
11 clone_flags="--depth 100"
14 echo "Unknown parameter: $ac_option"
15 exit 1
18 esac
19 done
21 # Do things manually instead of using "git submodule update --init",
22 # because git's sucky submodule support has no way of giving options to
23 # the "git clone" command that would be needed for shallow clones.
25 git submodule init
27 submodule_clone() {
28 if test ! -e $1/.git ; then
29 git clone $clone_flags `git config --get submodule.$1.url` $1
30 git submodule update --no-fetch $1
31 else
32 git submodule sync $1
33 git submodule update $1
37 submodule_clone mplayer
39 if test -e ffmpeg-mt-enabled ; then
40 submodule_clone ffmpeg-mt
41 else
42 submodule_clone ffmpeg
45 submodule_clone libass
47 # Ensure sync, needed at least if both ffmpeg and ffmpeg-mt exist separately
48 MPBUILD_COMMAND='git submodule sync' "`pwd`"/script/foreach_submodule
50 # Init recursive submodules (libswscale under ffmpeg) - not trying to
51 # make this support shallow clones for now
52 MPBUILD_COMMAND='git submodule update --init' "`pwd`"/script/foreach_submodule nottop