# Messages for the type of clone used are provided to ease debugging in case of
# problems
define DOWNLOAD_GIT
- test -e $(DL_DIR)/$($(PKG)_SOURCE) || \
$(EXTRA_ENV) $(DL_WRAPPER) -b git \
-o $(DL_DIR)/$($(PKG)_SOURCE) \
-- \
define DOWNLOAD_BZR
- test -e $(DL_DIR)/$($(PKG)_SOURCE) || \
$(EXTRA_ENV) $(DL_WRAPPER) -b bzr \
-o $(DL_DIR)/$($(PKG)_SOURCE) \
-- \
endef
define DOWNLOAD_CVS
- test -e $(DL_DIR)/$($(PKG)_SOURCE) || \
$(EXTRA_ENV) $(DL_WRAPPER) -b cvs \
-o $(DL_DIR)/$($(PKG)_SOURCE) \
-- \
endef
define DOWNLOAD_SVN
- test -e $(DL_DIR)/$($(PKG)_SOURCE) || \
$(EXTRA_ENV) $(DL_WRAPPER) -b svn \
-o $(DL_DIR)/$($(PKG)_SOURCE) \
-- \
# Note that filepath is relative to the user's home directory, so you may want
# to prepend the path with a slash: scp://[user@]host:/absolutepath
define DOWNLOAD_SCP
- test -e $(DL_DIR)/$(2) || \
$(EXTRA_ENV) $(DL_WRAPPER) -b scp \
-o $(DL_DIR)/$(2) \
-- \
define DOWNLOAD_HG
- test -e $(DL_DIR)/$($(PKG)_SOURCE) || \
$(EXTRA_ENV) $(DL_WRAPPER) -b hg \
-o $(DL_DIR)/$($(PKG)_SOURCE) \
-- \
define DOWNLOAD_WGET
- test -e $(DL_DIR)/$(2) || \
$(EXTRA_ENV) $(DL_WRAPPER) -b wget \
-o $(DL_DIR)/$(2) \
-- \
endef
define DOWNLOAD_LOCALFILES
- test -e $(DL_DIR)/$(2) || \
$(EXTRA_ENV) $(DL_WRAPPER) -b cp \
-o $(DL_DIR)/$(2) \
-- \
error "no output specified, use -o\n"
fi
+ # If the output file already exists, do not download it again
+ if [ -e "${output}" ]; then
+ exit 0
+ fi
+
# tmpd is a temporary directory in which backends may store intermediate
# by-products of the download.
# tmpf is the file in which the backends should put the downloaded content.