SCRIPT="`readlink -e $0`"
SCRIPTPATH=$(dirname ${SCRIPT})
-
-SUBREPOS_LIST=.gitsubrepos
-
-# Uncomment to have verbose debug output
-##debug=1
+source ${SCRIPTPATH}/hv-git-functions.sh
print_usage()
{
exit 1
fi
-if [ ! -f ${SUBREPOS_LIST} ]; then
- echo "Missing file for list of subrepos: ${SUBREPOS_LIST}"
- print_usage
- exit 1
-fi
+hv_git_validate_subrepos_list
remote_update_repo()
{
popd 1> /dev/null
}
-remote_update_repo ./
-
-# Read list of repositories from file named .gitsubrepos
-while IFS=$'\n' read r ; do
- [[ "${r}" =~ \#.* ]] && continue # Skip comment lines
- [ -z ${r} ] && continue # Skip enmpty lines
-
+for r in ./ $(hv_git_get_subrepos_list); do
# Make sure directory exists
if [ ! -d "${r}" ]; then
- echo "Missing repos ${r}"
- exit 1
- fi
-
- # Update only git repos
- if [ ! -d "${r}/.git" ]; then
- echo "Not a GIT repository"
- exit 1
+ echo "Missing repos ${r}, skipping"
+ continue
fi
remote_update_repo ${r}
-done < ${SUBREPOS_LIST}
+ rc=${?}
+done