diff options
author | Lucio Andrés Illanes Albornoz <lucio@lucioillanes.de> | 2021-04-06 11:26:11 +0100 |
---|---|---|
committer | Lucio Andrés Illanes Albornoz <lucio@lucioillanes.de> | 2021-04-06 11:26:11 +0100 |
commit | 2c5ce2e826a8af69d14429ea4da158bf94d31ca7 (patch) | |
tree | 97c90e082a90c8c617960cdae71a6e3dffbdfc97 /subr/pkg_configure_patch.subr | |
parent | 360eb692689993886cc8c5e471e73c76dcfaa123 (diff) | |
download | midipix_build-2c5ce2e826a8af69d14429ea4da158bf94d31ca7.tar.bz2 midipix_build-2c5ce2e826a8af69d14429ea4da158bf94d31ca7.tar.xz |
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.
Diffstat (limited to 'subr/pkg_configure_patch.subr')
-rw-r--r-- | subr/pkg_configure_patch.subr | 11 |
1 files changed, 9 insertions, 2 deletions
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}")"; |