summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rwxr-xr-xpkgtool.sh11
1 files changed, 10 insertions, 1 deletions
diff --git a/pkgtool.sh b/pkgtool.sh
index f1b742ff..dcfa3abc 100755
--- a/pkgtool.sh
+++ b/pkgtool.sh
@@ -79,7 +79,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_fname="" _pkg_sha256sum="" _pkg_url="" _rc=0;
+ _fname="" _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
@@ -102,6 +102,15 @@ pkgtoolp_mirror_fetch() {
if ! rtl_fileop mkdir "${_mirror_dname}/${_pkg_name}"\
|| ! 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}";
+ else
+ for _fname in $(find \
+ "${_mirror_dname}/${_pkg_name}" \
+ -type f \
+ -not -name "${_pkg_fname}" \
+ -not -name "${_pkg_fname}.fetch*"); do
+ rtl_log_msg info "Deleting redundant file \`%s' for package \`%s'." "${_fname}" "${_pkg_name}";
+ rtl_fileop rm "${_fname}";
+ done;
fi;
fi;
elif _pkg_url="$(rtl_get_var_unsafe -u "PKG_${_pkg_name_real}_URLS_GIT")"; then