diff options
Diffstat (limited to 'subr.pkg/pkg_configure_clean.subr')
-rw-r--r-- | subr.pkg/pkg_configure_clean.subr | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/subr.pkg/pkg_configure_clean.subr b/subr.pkg/pkg_configure_clean.subr new file mode 100644 index 00000000..3dba1036 --- /dev/null +++ b/subr.pkg/pkg_configure_clean.subr @@ -0,0 +1,22 @@ +# +# Copyright (c) 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023 LucĂa Andrea Illanes Albornoz <lucia@luciaillanes.de> +# set +o errexit -o noglob -o nounset is assumed. +# + +pkg_configure_clean() { + local _pcc_group_name="${1}" _pcc_pkg_name="${2}" _pcc_restart_at="${3}"; + + if ex_pkg_state_test \ + "${_pcc_pkg_name}" \ + "configure_patch_pre,configure_autotools,configure_patch,configure" \ + "${_pcc_restart_at}"\ + && [ "${PKG_BUILD_DIR:-}" != "${PKG_SUBDIR:-}" ]; + then + rtl_fileop rm "${PKG_BUILD_DIR}" || return 1; + rtl_fileop mkdir "${PKG_BUILD_DIR}" || return 1; + rtl_fileop cd "${PKG_BUILD_DIR}" || return 1; + fi; + return 0; +}; + +# vim:filetype=sh textwidth=0 |