diff options
author | Lucio Andrés Illanes Albornoz (arab, vxp) <lucio@lucioillanes.de> | 2017-11-21 17:06:36 +0000 |
---|---|---|
committer | Lucio Andrés Illanes Albornoz (arab, vxp) <lucio@lucioillanes.de> | 2017-11-21 17:09:19 +0000 |
commit | a44f58f1c69eb041700f650583d74b0a4d5337ef (patch) | |
tree | 2e8131c93fab755762ec3fe42be6288ce1731857 /subr | |
parent | 6b949487e9c2ff495666094a3df6a0b51fe5ac2f (diff) | |
download | midipix_build-a44f58f1c69eb041700f650583d74b0a4d5337ef.tar.bz2 midipix_build-a44f58f1c69eb041700f650583d74b0a4d5337ef.tar.xz |
subr/pkg_setup_distclean.subr: rm(1) ${PKG_BASE_DIR} on-demand.
etc/build.usage: updated.
subr/pkg_setup_{env,subdirs}.subr: split {cd,mkdir}(1) sequence into setup_env_subdirs.
vars/env.vars: adds setup_distclean:variant & setup_subdirs:invariant build steps.
Diffstat (limited to 'subr')
-rw-r--r-- | subr/pkg_setup_distclean.subr | 12 | ||||
-rw-r--r-- | subr/pkg_setup_env.subr | 2 | ||||
-rw-r--r-- | subr/pkg_setup_subdirs.subr | 10 |
3 files changed, 22 insertions, 2 deletions
diff --git a/subr/pkg_setup_distclean.subr b/subr/pkg_setup_distclean.subr new file mode 100644 index 00000000..fc5999c8 --- /dev/null +++ b/subr/pkg_setup_distclean.subr @@ -0,0 +1,12 @@ +# +# set -o errexit -o noglob are assumed. +# + +pkg_setup_distclean() { + if [ "$(stat -c %i "${PKG_BASE_DIR}")" \ + != "$(stat -c %i "${WORKDIR}")" ]; then + build_fileop rm "${PKG_BASE_DIR}"; + fi; +}; + +# vim:filetype=sh diff --git a/subr/pkg_setup_env.subr b/subr/pkg_setup_env.subr index a02b1a60..f6d6118a 100644 --- a/subr/pkg_setup_env.subr +++ b/subr/pkg_setup_env.subr @@ -53,8 +53,6 @@ pkg_setup_env() { PKG_ENV_VARS="$(echo "${PKG_ENV_VARS}" | tr " " "\n" | sort | tr "\n" " ")"; log_env_vars "build" ${PKG_ENV_VARS}; fi; - build_fileop mkdir "${PKG_BASE_DIR}"; - build_fileop cd "${PKG_BASE_DIR}"; }; # vim:filetype=sh diff --git a/subr/pkg_setup_subdirs.subr b/subr/pkg_setup_subdirs.subr new file mode 100644 index 00000000..1fc279cb --- /dev/null +++ b/subr/pkg_setup_subdirs.subr @@ -0,0 +1,10 @@ +# +# set -o errexit -o noglob are assumed. +# + +pkg_setup_subdirs() { + build_fileop mkdir "${PKG_BASE_DIR}"; + build_fileop cd "${PKG_BASE_DIR}"; +}; + +# vim:filetype=sh |