From ad5ea27f67fba6b7eca2953fc8cc72043f10369a Mon Sep 17 00:00:00 2001 From: Achim Date: Thu, 27 Oct 2016 10:02:12 -0700 Subject: [PATCH] Pmodules/libpbuild.bash - find_tarball() download if not locally available and SOURCE_URL is set --- Pmodules/libpbuild.bash | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Pmodules/libpbuild.bash b/Pmodules/libpbuild.bash index ca5f98e..9644aff 100644 --- a/Pmodules/libpbuild.bash +++ b/Pmodules/libpbuild.bash @@ -217,8 +217,16 @@ find_tarball() { done done done - std::error "${name}/${version}: source not found." - exit 43 + if [[ -z "${SOURCE_URL}" ]]; then + std::error "${name}/${version}: source not found." + exit 43 + fi + wget --directory-prefix="${PMODULES_DISTFILESDIR}" "${SOURCE_URL}" + if (( $? != 0 )); then + std::error "${name}/${version}: cannot download source." + exit 43 + fi + echo "${PMODULES_DISTFILESDIR}/${SOURCE_URL##*/}" } ###############################################################################