diff options
author | Lucio Andrés Illanes Albornoz <lucio@lucioillanes.de> | 2021-08-19 21:04:15 +0200 |
---|---|---|
committer | Lucio Andrés Illanes Albornoz <lucio@lucioillanes.de> | 2021-08-19 21:04:15 +0200 |
commit | 986162fb1883cce2ef3692c19272974e4bb28f1c (patch) | |
tree | c79cf09c10e619ffffd000b23631d8289f4fd7ff /subr.rtl/rtl_fetch_git.subr | |
parent | bca26dc0cf3771fb4da26b570f66ab1ac46bd25d (diff) | |
download | midipix_build-986162fb1883cce2ef3692c19272974e4bb28f1c.tar.bz2 midipix_build-986162fb1883cce2ef3692c19272974e4bb28f1c.tar.xz |
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.
Diffstat (limited to 'subr.rtl/rtl_fetch_git.subr')
-rw-r--r-- | subr.rtl/rtl_fetch_git.subr | 6 |
1 files changed, 3 insertions, 3 deletions
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; |