diff options
author | Lucio Andrés Illanes Albornoz <lucio@lucioillanes.de> | 2021-04-05 08:52:51 +0100 |
---|---|---|
committer | Lucio Andrés Illanes Albornoz <lucio@lucioillanes.de> | 2021-04-05 08:52:51 +0100 |
commit | fe3fd14d682f63dbf40f282d7f381600f528dbaf (patch) | |
tree | 8537035db9e61b74a93edff904bfa4dac16515bc | |
parent | c43501983c1f7446045ae54cea2141316a3c6b63 (diff) | |
download | midipix_build-fe3fd14d682f63dbf40f282d7f381600f528dbaf.tar.bz2 midipix_build-fe3fd14d682f63dbf40f282d7f381600f528dbaf.tar.xz |
pkgtool.sh:pkgtoolp_mirror_fetch(): honour and pass ${PKG_FNAME}, if present.
-rwxr-xr-x | pkgtool.sh | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -76,7 +76,7 @@ pkgtoolp_mirror() { pkgtoolp_mirror_fetch() { local _mirror_dname="${1}" _mirror_dname_git="${2}" _pkg_name="${3}" _pkg_name_real="${4}"\ - _pkg_disabled=0 _pkg_sha256sum="" _pkg_url="" _rc=0; + _pkg_disabled=0 _pkg_fname="" _pkg_sha256sum="" _pkg_url="" _rc=0; if _pkg_disabled="$(rtl_get_var_unsafe -u "PKG_${_pkg_name_real}_DISABLED")"\ && [ "${_pkg_disabled:-0}" -eq 1 ]; then @@ -90,9 +90,12 @@ pkgtoolp_mirror_fetch() { "${_mirror_dname}/${_pkg_name}" "${_pkg_name}" "${_pkg_name_real}"; fi; else + if ! _pkg_fname="$(rtl_get_var_unsafe -u "PKG_${_pkg_name_real}_FNAME")"; then + _pkg_fname="${_pkg_url##*/}"; + fi; rtl_log_msg info "Mirroring package \`%s', archive URL(s): \`%s'..." "${_pkg_name}" "${_pkg_url}"; if ! rtl_fileop mkdir "${_mirror_dname}/${_pkg_name}"\ - || ! rtl_fetch_url_wget "${_pkg_url}" "${_pkg_sha256sum}" "${_mirror_dname}/${_pkg_name}" "${_pkg_url##*/}" "${_pkg_name_real}" ""; then + || ! rtl_fetch_url_wget "${_pkg_url}" "${_pkg_sha256sum}" "${_mirror_dname}/${_pkg_name}" "${_pkg_fname}" "${_pkg_name_real}" ""; then _rc=1; rtl_log_msg warning "Failed to mirror package \`%s', skipping." "${_pkg_name}"; fi; fi; |