diff options
author | Lucio Andrés Illanes Albornoz (arab, vxp) <l.illanes@gmx.de> | 2016-09-10 15:04:42 +0200 |
---|---|---|
committer | Lucio Andrés Illanes Albornoz (arab, vxp) <l.illanes@gmx.de> | 2016-09-10 15:04:42 +0200 |
commit | 319df8440fd47a4fbd5e51a90a6b69d6dd28593d (patch) | |
tree | f4dacca4bffb94f6c1968ebfbdf9c5b66a5ca784 | |
parent | 66ef28e66aafe319ef6fe5e85cc03ee00762d142 (diff) | |
download | midipix_build-319df8440fd47a4fbd5e51a90a6b69d6dd28593d.tar.bz2 midipix_build-319df8440fd47a4fbd5e51a90a6b69d6dd28593d.tar.xz |
Adds -d (disable script) and -e (disable script.)
-rwxr-xr-x | build.sh | 2 | ||||
-rw-r--r-- | build.subr | 20 | ||||
-rw-r--r-- | build.usage | 4 |
3 files changed, 25 insertions, 1 deletions
@@ -10,6 +10,8 @@ VALID_BUILD_LEVELS="fetch,extract,build_dir,autoconf,patch,configure,clean,build while [ ${#} -gt 0 ]; do case ${1} in -c) ARG_CLEAN=1; ;; +-d) disable_build_script_link "${2}"; exit; ;; +-e) enable_build_script_link "${2}"; exit; ;; -t*) export ARG_TARBALL=1; [ "${1#-t.}" != "${1}" ] && TARBALL_SUFFIX=${1#-t.}; ;; -v) export ARG_VERBOSE=1; ;; -x) ARG_XTRACE=1; set -o xtrace; ;; @@ -60,6 +60,26 @@ get_vars_unsafe() { unset _gvu_vval _gvu_vval_; }; +disable_build_script_link() { + if [ -e ${1%.disabled}.disabled ]; then + log_msg failexit "Error: build script already disabled."; + elif [ ! -e ${1} ]; then + log_msg failexit "Error: invalid or non-existent build script filename/level/name."; + else + echo mv -- ${1} ${1}.disabled; + mv -- ${1} ${1}.disabled; + fi; +} +enable_build_script_link() { + if [ -e ${1%.disabled} ]; then + log_msg failexit "Error: build script already enabled."; + elif [ ! -e ${1%.disabled}.disabled ]; then + log_msg failexit "Error: invalid or non-existent build script filename/level/name."; + else + echo mv -- ${1%.disabled}.disabled ${1%.disabled}; + mv -- ${1%.disabled}.disabled ${1%.disabled}; + fi; +} insert_build_script_link() { _ibsl_fname=${1}; _ibsl_level=${_ibsl_fname%%.*}; diff --git a/build.usage b/build.usage index 5a105c00..d11b3915 100644 --- a/build.usage +++ b/build.usage @@ -1,10 +1,12 @@ -usage: ./build.sh [-a nt32|nt64] [-b debug|release] [-c] [-h] [-pi level.name.build] +usage: ./build.sh [-a nt32|nt64] [-b debug|release] [-c] [-d] [-e] [-h] [-pi level.name.build] [-pr level.name.build] [-r ALL|level.name.build[:diff|:step[,...]]] [-t[.gz|.bz2|.xz] [-x] -a nt32|nt64 Selects 32-bit or 64-bit architecture; defaults to nt64. -b debug|release Selects debug or release build; defaults to debug. This currently only controls CFLAGS. -c Clean ${PREFIX} before processing build scripts. + -d level.name.build Disables the specified build script. + -e level.name.build Enables the specified build script. -h Show this screen. -pi level.name.build Insert link to pkg.build for the specified build script. All consecutive scripts with higher build levels will |