3 # This code is licensed under the GPL version 2 or later. See
4 # the COPYING file in the top-level directory.
6 substat=".git-submodule-status"
12 test -z "$GIT" && GIT=git
17 echo "Unable to automatically checkout GIT submodules '$modules'."
18 echo "If you require use of an alternative GIT binary (for example to"
19 echo "enable use of a transparent proxy), then please specify it by"
20 echo "running configure by with the '--with-git' argument. e.g."
22 echo " $ ./configure --with-git='tsocks git'"
29 test -e $substat || touch $substat
35 echo "$0: unexpectedly called with submodules but no git checkout exists"
41 test -f "$substat" || exit 1
42 trap "rm -f ${substat}.tmp" EXIT
43 $GIT submodule status $modules > "${substat}.tmp"
44 test $? -ne 0 && error "failed to query git submodule status"
45 diff "${substat}" "${substat}.tmp" >/dev/null
49 $GIT submodule update --init $modules 1>/dev/null
50 test $? -ne 0 && error "failed to update modules"
52 $GIT submodule status $modules > "${substat}"
53 test $? -ne 0 && error "failed to save git submodule status" >&2