summaryrefslogtreecommitdiffhomepage
path: root/subr/pkg_fetch_download.subr
diff options
context:
space:
mode:
authorLucía Andrea Illanes Albornoz <lucia@luciaillanes.de>2023-02-17 19:29:28 +0100
committerLucía Andrea Illanes Albornoz <lucia@luciaillanes.de>2023-02-17 19:29:28 +0100
commite9fa0774ed2e7e030a68f5b0ae51fe6dd69fe492 (patch)
tree37e46c2578bd8f4f435073db01abc514976da8a8 /subr/pkg_fetch_download.subr
parent56495632fc8bf612766a9c431e37ff27a903e8c6 (diff)
downloadmidipix_build-e9fa0774ed2e7e030a68f5b0ae51fe6dd69fe492.tar.bz2
midipix_build-e9fa0774ed2e7e030a68f5b0ae51fe6dd69fe492.tar.xz
Make everything a bit faster.
0) Issues several prayers and sacrifices to Enki under threat of a terrible deluge sent down by Ellil 1) Convert fork-write/read exprs to be non-forking 2) Pass mostly everything by reference 3) Don't bother cleaning the variable namespace because Bourne shell is an abomination 4) Removes broken ./pkgtool.sh -s, --restart-at, --update-diff & ./build.sh --dump-{in,on-abort} 5) Cleanup
Diffstat (limited to 'subr/pkg_fetch_download.subr')
-rw-r--r--subr/pkg_fetch_download.subr67
1 files changed, 0 insertions, 67 deletions
diff --git a/subr/pkg_fetch_download.subr b/subr/pkg_fetch_download.subr
deleted file mode 100644
index 7a333947..00000000
--- a/subr/pkg_fetch_download.subr
+++ /dev/null
@@ -1,67 +0,0 @@
-#
-# set +o errexit -o noglob -o nounset is assumed.
-#
-
-pkg_fetch_download_clean_dlcache() {
- local _dlcachedir="${1}" _pkg_name="${2}" _pkg_fname="${3}" _pkg_urls_git="${4}"\
- _fname="" _skipfl=0 _url_spec="" _url_subdir="";
-
- for _fname in $(cd "${_dlcachedir}/${_pkg_name}" 2>/dev/null && find \
- -maxdepth 1 \
- -mindepth 1 \
- ${_pkg_fname:+-not -name "${_pkg_fname}"} \
- ${_pkg_fname:+-not -name "${_pkg_fname}.fetched"}); do
- _fname="${_fname#./}"; _skipfl=0;
- for _url_spec in ${_pkg_urls_git}; do
- _url_subdir="${_url_spec%%=*}"; _url_subdir="${_url_subdir##*/}";
- if [ "${_fname%.git}" = "${_url_subdir}" ]; then
- _skipfl=1; break;
- fi;
- done;
- if [ "${_skipfl}" -eq 0 ]; then
- _fname="${_dlcachedir}/${_pkg_name}/${_fname}";
- rtl_log_msg "verbose" "${MSG_rtl_fetch_rm_redundant}" "${_fname}" "${_pkg_name}";
- rtl_fileop rm "${_fname}";
- fi;
- done;
-};
-
-pkg_fetch_download_dlcache_subdir() {
- if [ -n "${PKG_INHERIT_FROM:-}" ]\
- && ! [ -e "${BUILD_DLCACHEDIR}/${PKG_NAME}" ]\
- && ! rtl_fileop ln_symbolic "${PKG_INHERIT_FROM}" "${BUILD_DLCACHEDIR}/${PKG_NAME}"; then
- return 1;
- elif [ -z "${PKG_INHERIT_FROM:-}" ]\
- && ! [ -e "${BUILD_DLCACHEDIR}/${PKG_NAME}" ]\
- && ! rtl_fileop mkdir "${BUILD_DLCACHEDIR}/${PKG_NAME}"; then
- return 1;
- else
- return 0;
- fi;
-};
-
-pkg_fetch_download() {
- if [ "${ARG_FETCH_FORCE:-}" != "offline" ]; then
- if [ -n "${PKG_URL:-}" ]; then
- if ! pkg_fetch_download_dlcache_subdir; then
- return 1;
- elif ! rtl_fetch_url_wget \
- "${PKG_URL}" "${PKG_SHA256SUM}" "${BUILD_DLCACHEDIR}/${PKG_NAME}"\
- "${PKG_FNAME}" "${PKG_NAME}" "${PKG_MIRRORS:-}"; then
- return 1;
- fi;
- fi;
- if [ -n "${PKG_URLS_GIT:-}" ]; then
- if ! pkg_fetch_download_dlcache_subdir; then
- return 1;
- elif ! rtl_fetch_urls_git \
- "${BUILD_DLCACHEDIR}/${PKG_NAME}" "${DEFAULT_GIT_ARGS}" "${PKG_BASE_DIR}"\
- "${PKG_NAME}" "${PKG_MIRRORS_GIT:-}" ${PKG_URLS_GIT}; then
- return 1;
- fi;
- fi;
- pkg_fetch_download_clean_dlcache "${BUILD_DLCACHEDIR}" "${PKG_NAME}" "${PKG_FNAME:-}" "${PKG_URLS_GIT:-}";
- fi;
-};
-
-# vim:filetype=sh