diff options
author | 2014-04-13 16:01:25 -0700 | |
---|---|---|
committer | 2014-04-13 16:01:25 -0700 | |
commit | 5b079a52bf439ee9af3edd25e6d0229fa97ce17d (patch) | |
tree | 4982c999e49f8eb45780a3d5ad913d2779d4ba6c | |
parent | Fix MDADM_CONFIG missing message. (diff) | |
download | genkernel-5b079a52bf439ee9af3edd25e6d0229fa97ce17d.tar.gz genkernel-5b079a52bf439ee9af3edd25e6d0229fa97ce17d.tar.bz2 genkernel-5b079a52bf439ee9af3edd25e6d0229fa97ce17d.zip |
Make it possible to turn off all of the on-exit cleanup.
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
-rwxr-xr-x | gen_cmdline.sh | 6 | ||||
-rwxr-xr-x | gen_determineargs.sh | 1 | ||||
-rwxr-xr-x | genkernel | 37 |
3 files changed, 29 insertions, 15 deletions
diff --git a/gen_cmdline.sh b/gen_cmdline.sh index 715ad49..7bee618 100755 --- a/gen_cmdline.sh +++ b/gen_cmdline.sh @@ -22,6 +22,8 @@ longusage() { echo " --logfile=<outfile> Output file for debug info" echo " --color Output debug in color" echo " --no-color Do not output debug in color" + echo " --debug-cleanup Clean up temporary build directories on exit" + echo " --no-debug-cleanup Do not remove any temporary directories on exit" echo " Kernel Configuration settings" echo " --menuconfig Run menuconfig after oldconfig" echo " --no-menuconfig Do not run menuconfig after oldconfig" @@ -471,6 +473,10 @@ parse_cmdline() { print_info 2 "USECOLOR: ${USECOLOR}" setColorVars ;; + --debug-cleanup|--no-debug-cleanup) + CMD_DEBUGCLEANUP=`parse_optbool "$*"` + print_info 2 "DEBUGCLEANUP: ${DEBUGCLEANUP}" + ;; --logfile=*) CMD_LOGFILE=`parse_opt "$*"` LOGFILE=`parse_opt "$*"` diff --git a/gen_determineargs.sh b/gen_determineargs.sh index e0c9984..615f274 100755 --- a/gen_determineargs.sh +++ b/gen_determineargs.sh @@ -136,6 +136,7 @@ determine_real_args() { set_config_with_override BOOL DOKEYMAPAUTO CMD_DOKEYMAPAUTO set_config_with_override STRING BUSYBOX_CONFIG CMD_BUSYBOX_CONFIG set_config_with_override BOOL INSTALL CMD_INSTALL "yes" + set_config_with_override BOOL DEBUGCLEANUP CMD_DEBUGCLEANUP "yes" BOOTDIR=`arch_replace "${BOOTDIR}"` BOOTDIR=${BOOTDIR%/} # Remove any trailing slash @@ -61,21 +61,28 @@ trap_cleanup(){ } cleanup(){ - if [ -n "$TEMP" -a -d "$TEMP" ]; then - rm -rf "$TEMP" - fi - - if isTrue ${POSTCLEAR} - then - echo - print_info 1 'RUNNING FINAL CACHE/TMP CLEANUP' - print_info 1 "CACHE_DIR: ${CACHE_DIR}" - CLEAR_CACHE_DIR='yes' - setup_cache_dir - echo - print_info 1 "TMPDIR: ${TMPDIR}" - clear_tmpdir - fi + if [ "${CMD_DEBUGCLEANUP}" == "no" ]; then + print_info 1 "Not running any cleanup per DEBUGCLEANUP" + print_info 1 "TEMP: ${TEMP}" + print_info 1 "CACHE_DIR: ${CACHE_DIR}" + print_info 1 "TMPDIR: ${TMPDIR}" + else + if [ -n "$TEMP" -a -d "$TEMP" ]; then + rm -rf "$TEMP" + fi + + if isTrue ${POSTCLEAR} + then + echo + print_info 1 'RUNNING FINAL CACHE/TMP CLEANUP' + print_info 1 "CACHE_DIR: ${CACHE_DIR}" + CLEAR_CACHE_DIR='yes' + setup_cache_dir + echo + print_info 1 "TMPDIR: ${TMPDIR}" + clear_tmpdir + fi + fi } trap trap_cleanup SIGHUP SIGQUIT SIGINT SIGTERM SIGKILL |