From 986162fb1883cce2ef3692c19272974e4bb28f1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Thu, 19 Aug 2021 21:04:15 +0200 Subject: subr.rtl/rtl_fetch_git.subr:{rtlp_fetch_url_git,rtl_fetch_mirror_urls_git}(): correctly reference ${_subdir} when {fetching,mirroring}. subr/pkg_fetch_download.subr:pkg_fetch_download_clean_dlcache(): correctly cleanup dlcache wrt. Git repositories. --- subr.rtl/rtl_fetch_git.subr | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'subr.rtl') diff --git a/subr.rtl/rtl_fetch_git.subr b/subr.rtl/rtl_fetch_git.subr index 2d6ce8ab..9350b09c 100644 --- a/subr.rtl/rtl_fetch_git.subr +++ b/subr.rtl/rtl_fetch_git.subr @@ -20,7 +20,7 @@ rtlp_fetch_url_git() { elif [ "${_mirrors}" = "skip" ]; then return 1; else for _url_base in ${_mirrors}; do - if git clone ${_git_args} -b "${_git_branch:-main}" "${_url_base}/${_pkg_name}/${_url##*/}" "${_cache_dname_full}"; then + if git clone ${_git_args} -b "${_git_branch:-main}" "${_url_base}/${_pkg_name}/${_subdir}" "${_cache_dname_full}"; then _clonefl=1; break; fi; done; @@ -57,7 +57,7 @@ rtl_fetch_mirror_urls_git() { for _url_spec in "${@}"; do _subdir="${_url_spec%=*}"; _subdir="${_subdir##*/}"; _url="${_url_spec#*=}"; _url="${_url%@*}"; - _repo_dname="${_url##*/}"; [ "${_repo_dname%.git}" = "${_repo_dname}" ] && _repo_dname="${_repo_dname}.git"; + _repo_dname="${_subdir}"; [ "${_repo_dname%.git}" = "${_repo_dname}" ] && _repo_dname="${_repo_dname}.git"; if [ ! -e "$(rtl_dirname "${_tgtdir}")" ]; then rtl_fileop mkdir "$(rtl_dirname "${_tgtdir}")"; @@ -67,7 +67,7 @@ rtl_fetch_mirror_urls_git() { trap "rm -f \"${_tgtdir}/.fetching\"" EXIT; if [ -e "${_tgtdir}/${_repo_dname}" ]; then (rtl_fileop cd "${_tgtdir}/${_repo_dname}" && git fetch ${_git_args} --all) || return 1; - else (rtl_fileop cd "${_tgtdir}" && git clone ${_git_args} --mirror "${_url}") || return 1; + else (rtl_fileop cd "${_tgtdir}" && git clone ${_git_args} --mirror "${_url}" "${_repo_dname}") || return 1; fi) 4<>"${_tgtdir}/.fetching"; if [ "${?}" -ne 0 ]; then _rc=1; -- cgit v1.2.3