From 319df8440fd47a4fbd5e51a90a6b69d6dd28593d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz=20=28arab=2C=20vx?= =?UTF-8?q?p=29?= Date: Sat, 10 Sep 2016 15:04:42 +0200 Subject: Adds -d (disable script) and -e (disable script.) --- build.sh | 2 ++ build.subr | 20 ++++++++++++++++++++ build.usage | 4 +++- 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/build.sh b/build.sh index a6977fa5..1b4e2b28 100755 --- a/build.sh +++ b/build.sh @@ -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; ;; diff --git a/build.subr b/build.subr index 237f48c3..c79872fe 100644 --- a/build.subr +++ b/build.subr @@ -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 -- cgit v1.2.3