define DOWNLOAD_GIT
$(EXTRA_ENV) $(DL_WRAPPER) -b git \
-o $(DL_DIR)/$($(PKG)_SOURCE) \
+ $(if $($(PKG)_GIT_SUBMODULES),-r) \
$(QUIET) \
-- \
$($(PKG)_SITE) \
endif
endif
+# Do not accept to download git submodule if not using the git method
+ifneq ($$($(2)_GIT_SUBMODULES),)
+ ifneq ($$($(2)_SITE_METHOD),git)
+ $$(error $(2) declares having git sub-modules, but does not use the \
+ 'git' method (uses '$$($(2)_SITE_METHOD)' instead))
+ endif
+endif
+
ifeq ($$($(2)_SITE_METHOD),local)
ifeq ($$($(2)_OVERRIDE_SRCDIR),)
$(2)_OVERRIDE_SRCDIR = $$($(2)_SITE)
main() {
local OPT OPTARG
- local backend output hfile quiet
+ local backend output hfile recurse quiet
# Parse our options; anything after '--' is for the backend
- while getopts :hb:o:H:q OPT; do
+ while getopts :hb:o:H:rq OPT; do
case "${OPT}" in
h) help; exit 0;;
b) backend="${OPTARG}";;
o) output="${OPTARG}";;
H) hfile="${OPTARG}";;
+ r) recurse="-r";;
q) quiet="-q";;
:) error "option '%s' expects a mandatory argument\n" "${OPTARG}";;
\?) error "unknown option '%s'\n" "${OPTARG}";;
# If the backend fails, we can just remove the temporary directory to
# remove all the cruft it may have left behind. Then we just exit in
# error too.
- if ! "${OLDPWD}/support/download/${backend}" ${quiet} "${tmpf}" "${@}"; then
+ if ! "${OLDPWD}/support/download/${backend}" ${quiet} ${recurse} "${tmpf}" "${@}"; then
rm -rf "${tmpd}"
exit 1
fi