summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorLucio Andrés Illanes Albornoz (arab, vxp) <lucio@lucioillanes.de>2017-11-21 17:06:36 +0000
committerLucio Andrés Illanes Albornoz (arab, vxp) <lucio@lucioillanes.de>2017-11-21 17:09:19 +0000
commita44f58f1c69eb041700f650583d74b0a4d5337ef (patch)
tree2e8131c93fab755762ec3fe42be6288ce1731857
parent6b949487e9c2ff495666094a3df6a0b51fe5ac2f (diff)
downloadmidipix_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.
-rw-r--r--etc/build.usage25
-rw-r--r--subr/pkg_setup_distclean.subr12
-rw-r--r--subr/pkg_setup_env.subr2
-rw-r--r--subr/pkg_setup_subdirs.subr10
-rw-r--r--vars/env.vars3
5 files changed, 38 insertions, 14 deletions
diff --git a/etc/build.usage b/etc/build.usage
index 6993ed72..c68dc4c2 100644
--- a/etc/build.usage
+++ b/etc/build.usage
@@ -9,18 +9,21 @@ usage: ./build.sh [-x] [-4|6] [-a nt32|nt64] [-b debug|release] [-c] [-h]
-h Show this screen.
-i Ignore SHA256 hash mismatches when downloading files.
-N Offline mode: no {wget,git-{clone,pull}}(1) calls.
- -r package[,...][:step] Restart the specified comma-separated build(s) completely or at
- the optionally specified step. Currently defined steps are:
- fetch_wget, fetch_git, fetch_extract, configure_patch_pre,
- configure_autotools, configure_patch, configure, build_clean,
- build, install_subdirs, install_make, install_files, install_libs,
- install_pkgconfig, install_purge_la, install_strip, and install.
+ -r package[,...][:step] Restart the specified comma-separated build(s) completely
+ or at the optionally specified step. Currently defined
+ steps are:
+ setup_distclean, fetch_wget, fetch_git, fetch_extract,
+ configure_patch_pre, configure_autotools, configure_patch,
+ configure, build_clean, build, install_subdirs, install_make,
+ install_files, install_libs, install_pkgconfig, install_purge_la,
+ install_strip, and install.
-R Ignore build failures and continue building (relaxed mode.)
- -t[.gz|.bz2|.xz] Produce binary distribution and source tarballs containing ${PREFIX}
- sans ${WORKDIR} and ${PREFIX}/src/midipix_build and ${WORKDIR} sans top-
- level regular files at the end of a build with zero failures. The
- tarballs will be compressed with either gzip, bzip2, or xz and signed
- with GPG; the default compression is xz.
+ -t[.gz|.bz2|.xz] Produce binary distribution and source tarballs containing
+ ${PREFIX} sans ${WORKDIR} and ${PREFIX}/src/midipix_build
+ and ${WORKDIR} sans top-level regular files at the end of
+ a build with zero failures. The tarballs will be compressed
+ with either gzip, bzip2, or xz and signed with GPG; the
+ default compression is xz.
-v Be verbose.
--debug-minipix Don't strip(1) minipix binaries to facilitate debugging minipix.
<target>[ ...] One of:
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
diff --git a/vars/env.vars b/vars/env.vars
index afbff055..6f184cc4 100644
--- a/vars/env.vars
+++ b/vars/env.vars
@@ -16,7 +16,8 @@
: ${PREFIX_CROSS:=${PREFIX}/${TARGET}};
: ${DLCACHEDIR:=${PREFIX_ROOT}/dlcache};
: ${WORKDIR:=${PREFIX}/tmp};
-: ${BUILD_STEPS:="setup_vars:invariant setup_env:invariant all:all
+: ${BUILD_STEPS:="setup_vars:invariant setup_env:invariant setup_distclean:variant setup_subdirs:invariant
+ all:all
fetch_wget:dynamic fetch_git:dynamic fetch_extract:dynamic fetch_subdirs:invariant fetch:virtual
configure_patch_pre:dynamic configure_autotools:dynamic configure_patch:dynamic configure:dynamic
build_clean:variant build:dynamic