summaryrefslogtreecommitdiffhomepage
path: root/subr.rtl
diff options
context:
space:
mode:
authorLucio Andrés Illanes Albornoz <lucio@lucioillanes.de>2021-01-23 18:52:28 +0000
committerLucio Andrés Illanes Albornoz <lucio@lucioillanes.de>2021-01-23 18:52:28 +0000
commit6e41e8fbfcbce3d7d747a73916bb15d92fd9fe83 (patch)
tree61dfaf42c7a14a15cd547ecfe4998ffc6e6c727f /subr.rtl
parentb63b9baad8f41274e844c11bceb38efd20dfb3fe (diff)
downloadmidipix_build-6e41e8fbfcbce3d7d747a73916bb15d92fd9fe83.tar.bz2
midipix_build-6e41e8fbfcbce3d7d747a73916bb15d92fd9fe83.tar.xz
subr.rtl/rtl_fetch.subr:{rtlp_fetch_url_git,rtl_fetch_urls_git}(): {receive,pass} ${_pkg_name}.
subr.rtl/rtl_fetch.subr:rtl_fetch_urls_git(): return 1 on failure from rtlp_fetch_url_git(). subr/pkg_fetch_download.subr: pass ${PKG_NAME} to rtl_fetch_urls_git(). etc/README.md: updated.
Diffstat (limited to 'subr.rtl')
-rw-r--r--subr.rtl/rtl_fetch.subr10
1 files changed, 6 insertions, 4 deletions
diff --git a/subr.rtl/rtl_fetch.subr b/subr.rtl/rtl_fetch.subr
index 7f44346c..5d21820f 100644
--- a/subr.rtl/rtl_fetch.subr
+++ b/subr.rtl/rtl_fetch.subr
@@ -3,7 +3,7 @@
#
rtlp_fetch_url_git() {
- local _cache_dname="${1}" _git_branch="${2}" _mirrors="${3}" _subdir="${4}" _tgtdir="${5}" _url="${6}"\
+ local _cache_dname="${1}" _git_branch="${2}" _mirrors="${3}" _pkg_name="${4}" _subdir="${5}" _tgtdir="${6}" _url="${7}"\
_clonefl=0 _oldpwd="" _url_base="";
(set -o errexit -o noglob -o nounset;
rtl_flock_acquire 4 || exit "${?}";
@@ -15,7 +15,7 @@ rtlp_fetch_url_git() {
git submodule update);
else
for _url_base in ${_url%/*} ${_mirrors}; do
- if git clone ${DEFAULT_GIT_ARGS} "${_url_base}/${_url##*/}" "${_cache_dname}/${_subdir}"; then
+ if git clone ${DEFAULT_GIT_ARGS} "${_url_base}/${_pkg_name}/${_url##*/}" "${_cache_dname}/${_subdir}"; then
_clonefl=1; break;
fi;
done;
@@ -43,13 +43,15 @@ rtlp_fetch_url_git() {
};
rtl_fetch_urls_git() {
- local _cache_dname="${1}" _tgtdir="${2}" _mirrors="${3}" _git_branch="" _subdir="" _url="" _url_spec=""; shift 3;
+ local _cache_dname="${1}" _tgtdir="${2}" _pkg_name="${3}" _mirrors="${4}" _git_branch="" _subdir="" _url="" _url_spec=""; shift 4;
for _url_spec in "${@}"; do
_subdir="${_url_spec%=*}"; _url="${_url_spec#*=}"; _url="${_url%@*}";
if [ "${_url_spec#*@}" != "${_url_spec}" ]; then
_git_branch=${_url_spec#*@};
fi;
- rtlp_fetch_url_git "${_cache_dname}" "${_git_branch}" "${_mirrors}" "${_subdir}" "${_tgtdir}" "${_url}";
+ if ! rtlp_fetch_url_git "${_cache_dname}" "${_git_branch}" "${_mirrors}" "${_pkg_name}" "${_subdir}" "${_tgtdir}" "${_url}"; then
+ return 1;
+ fi;
done;
};