$(EXTRA_ENV) $(DL_WRAPPER) -b git \
-o $(DL_DIR)/$($(PKG)_SOURCE) \
-H $(PKGDIR)/$($(PKG)_RAWNAME).hash \
+ $(QUIET) \
-- \
$($(PKG)_SITE) \
$($(PKG)_DL_VERSION) \
$(EXTRA_ENV) $(DL_WRAPPER) -b bzr \
-o $(DL_DIR)/$($(PKG)_SOURCE) \
-H $(PKGDIR)/$($(PKG)_RAWNAME).hash \
+ $(QUIET) \
-- \
$($(PKG)_SITE) \
$($(PKG)_DL_VERSION) \
$(EXTRA_ENV) $(DL_WRAPPER) -b cvs \
-o $(DL_DIR)/$($(PKG)_SOURCE) \
-H $(PKGDIR)/$($(PKG)_RAWNAME).hash \
+ $(QUIET) \
-- \
$(call stripurischeme,$(call qstrip,$($(PKG)_SITE))) \
$($(PKG)_DL_VERSION) \
$(EXTRA_ENV) $(DL_WRAPPER) -b svn \
-o $(DL_DIR)/$($(PKG)_SOURCE) \
-H $(PKGDIR)/$($(PKG)_RAWNAME).hash \
+ $(QUIET) \
-- \
$($(PKG)_SITE) \
$($(PKG)_DL_VERSION) \
$(EXTRA_ENV) $(DL_WRAPPER) -b scp \
-o $(DL_DIR)/$(2) \
-H $(PKGDIR)/$($(PKG)_RAWNAME).hash \
+ $(QUIET) \
-- \
'$(call stripurischeme,$(call qstrip,$(1)))'
endef
$(EXTRA_ENV) $(DL_WRAPPER) -b hg \
-o $(DL_DIR)/$($(PKG)_SOURCE) \
-H $(PKGDIR)/$($(PKG)_RAWNAME).hash \
+ $(QUIET) \
-- \
$($(PKG)_SITE) \
$($(PKG)_DL_VERSION) \
$(EXTRA_ENV) $(DL_WRAPPER) -b wget \
-o $(DL_DIR)/$(2) \
-H $(PKGDIR)/$($(PKG)_RAWNAME).hash \
+ $(QUIET) \
-- \
'$(call qstrip,$(1))'
endef
$(EXTRA_ENV) $(DL_WRAPPER) -b cp \
-o $(DL_DIR)/$(2) \
-H $(PKGDIR)/$($(PKG)_RAWNAME).hash \
+ $(QUIET) \
-- \
$(call stripurischeme,$(call qstrip,$(1)))
endef
main() {
local OPT OPTARG
- local backend output hfile
+ local backend output hfile quiet
# Parse our options; anything after '--' is for the backend
- while getopts :hb:o:H: OPT; do
+ while getopts :hb:o:H:q OPT; do
case "${OPT}" in
h) help; exit 0;;
b) backend="${OPTARG}";;
o) output="${OPTARG}";;
H) hfile="${OPTARG}";;
+ q) quiet="-q";;
:) error "option '%s' expects a mandatory argument\n" "${OPTARG}";;
\?) error "unknown option '%s'\n" "${OPTARG}";;
esac
# If the output file already exists, do not download it again
if [ -e "${output}" ]; then
- if support/download/check-hash "${hfile}" "${output}" "${output##*/}"; then
+ if support/download/check-hash ${quiet} "${hfile}" "${output}" "${output##*/}"; then
exit 0
fi
rm -f "${output}"
- printf "Re-downloading '%s'...\n" "${output##*/}"
+ warn "Re-downloading '%s'...\n" "${output##*/}"
fi
# tmpd is a temporary directory in which backends may store intermediate
# 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}" "${tmpf}" "${@}"; then
+ if ! "${OLDPWD}/support/download/${backend}" ${quiet} "${tmpf}" "${@}"; then
rm -rf "${tmpd}"
exit 1
fi
# Check if the downloaded file is sane, and matches the stored hashes
# for that file
- if ! support/download/check-hash "${hfile}" "${tmpf}" "${output##*/}"; then
+ if ! support/download/check-hash ${quiet} "${hfile}" "${tmpf}" "${output##*/}"; then
rm -rf "${tmpd}"
exit 1
fi