From 5b079a52bf439ee9af3edd25e6d0229fa97ce17d Mon Sep 17 00:00:00 2001 From: "Robin H. Johnson" Date: Sun, 13 Apr 2014 16:01:25 -0700 Subject: Make it possible to turn off all of the on-exit cleanup. Signed-off-by: Robin H. Johnson --- gen_cmdline.sh | 6 ++++++ gen_determineargs.sh | 1 + genkernel | 37 ++++++++++++++++++++++--------------- 3 files changed, 29 insertions(+), 15 deletions(-) diff --git a/gen_cmdline.sh b/gen_cmdline.sh index 715ad490..7bee618f 100755 --- a/gen_cmdline.sh +++ b/gen_cmdline.sh @@ -22,6 +22,8 @@ longusage() { echo " --logfile= 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 e0c99846..615f2741 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 diff --git a/genkernel b/genkernel index b62c3f7b..f10cd49f 100755 --- a/genkernel +++ b/genkernel @@ -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 -- cgit v1.2.3-65-gdbad