aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2014-04-13 16:01:25 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2014-04-13 17:59:30 -0700
commitdeef895b91b8632033a1d1cd151c947f8b73a78a (patch)
treef2adf2800c9e235f6987f506985496b161d0688f
parentFix MDADM_CONFIG missing message. (diff)
downloadgenkernel-deef895b91b8632033a1d1cd151c947f8b73a78a.tar.gz
genkernel-deef895b91b8632033a1d1cd151c947f8b73a78a.tar.bz2
genkernel-deef895b91b8632033a1d1cd151c947f8b73a78a.zip
Make it possible to turn off all of the on-exit cleanup.
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
-rwxr-xr-xgen_cmdline.sh6
-rwxr-xr-xgen_determineargs.sh1
-rwxr-xr-xgenkernel37
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
diff --git a/genkernel b/genkernel
index b62c3f7..f10cd49 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