From 2c5ce2e826a8af69d14429ea4da158bf94d31ca7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Tue, 6 Apr 2021 11:26:11 +0100 Subject: pkgtool.sh:pkgtoolp_mirror_fetch(): call pkg_fetch_download_clean_dlcache() post-{archive,Git} mirroring. pkgtool.sh:pkgtoolp_mirror_fetch(): mirror both archive as well as Git URL(s). subr/pkg_configure_patch.subr:pkg_configure_patch(): apply patches from within ${PKG_BASE_DIR} given both ${PKG_FNAME} and ${PKG_URLS_GIT}. subr.rtl/rtl_fetch.subr:rtl_fetch_mirror_urls_git(): ignore all but last component in ${_subdir}. subr.rtl/rtl_fetch.subr:rtl_fetch_mirror_urls_git(): create prerequisite directories. subr.rtl/rtl_fetch.subr:rtlp_fetch_url_git(): ignore all but last component in ${_subdir} wrt. ${_cache_dlname}. subr.rtl/rtl_fetch.subr:rtlp_fetch_url_git(): create prerequisite directories wrt. ${_tgtdir}. subr/ex_pkg_env.subr:exp_pkg_env_defaults(): reject absence of ${PKG_SUBDIR} given both ${PKG_FNAME} and ${PKG_URLS_GIT}. subr/pkg_fetch_download.subr:pkg_fetch_download_clean_dlcache(): initial implementation. subr/pkg_fetch_download.subr:pkg_fetch_download(): call pkg_fetch_download_clean_dlcache() post-{archive,Git} download. --- subr/pkg_configure_patch.subr | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'subr/pkg_configure_patch.subr') diff --git a/subr/pkg_configure_patch.subr b/subr/pkg_configure_patch.subr index 6b4bcdd3..b789a80e 100644 --- a/subr/pkg_configure_patch.subr +++ b/subr/pkg_configure_patch.subr @@ -3,8 +3,15 @@ # pkg_configure_patch() { - local _patch_dir="${MIDIPIX_BUILD_PWD}/patches" _patch_fname="" \ + local _patch_cwd="" _patch_dir="${MIDIPIX_BUILD_PWD}/patches" _patch_fname=""\ _patches_done="" _pkg_name_full="${PKG_NAME}${PKG_VERSION:+-${PKG_VERSION}}"; + + if [ -n "${PKG_FNAME}" ]\ + && [ -n "${PKG_URLS_GIT}" ]; then + _patch_cwd="${PKG_BASE_DIR}"; + else + _patch_cwd="${PKG_BASE_DIR}/${PKG_SUBDIR}"; + fi; set +o noglob; for _patch_fname in \ "${_patch_dir}/${_pkg_name}/"*.patch \ @@ -13,7 +20,7 @@ pkg_configure_patch() { ${PKG_PATCHES_EXTRA:-}; do if [ -r "${_patch_fname}" ]\ && ! rtl_lmatch "${_patches_done}" "${_patch_fname}"; then - if ! patch -b -d "${PKG_BASE_DIR}/${PKG_SUBDIR}" -p1 < "${_patch_fname}"; then + if ! patch -b -d "${_patch_cwd}" -p1 < "${_patch_fname}"; then set -o noglob; return 1; else _patches_done="$(rtl_lconcat "${_patches_done}" "${_patch_fname}")"; -- cgit v1.2.3