etc-update: add clear_term config for bug #142508
authorZac Medico <zmedico@gentoo.org>
Tue, 31 May 2011 21:48:55 +0000 (14:48 -0700)
committerZac Medico <zmedico@gentoo.org>
Tue, 31 May 2011 21:48:55 +0000 (14:48 -0700)
bin/etc-update
cnf/etc-update.conf

index 2369f04f49bb7d26f95bf76a990b509037a2ff1e..42518adc64d7b15dbb8b49c48f0d08c06052583e 100755 (executable)
@@ -149,7 +149,7 @@ sel_file() {
                elif [ "${DELETE_ALL}" == "yes" ]; then
                        input=0
                else
-                       clear
+                       [[ $CLEAR_TERM == yes ]] && clear
                        if [[ ${mode} == 0 ]] ; then
                                echo "The following is the list of files which need updating, each
 configuration file is followed by a list of possible replacement files."
@@ -317,7 +317,7 @@ do_cfg() {
                elif [[ "${DELETE_ALL}" == "yes" ]] && ! user_special "${ofile}"; then
                        my_input=2
                else
-                       clear
+                       [[ $CLEAR_TERM == yes ]] && clear
                        if [ "${using_editor}" == 0 ]; then
                                (
                                        echo "Showing differences between ${ofile} and ${file}"
@@ -421,7 +421,7 @@ Please select from the menu above (-1 to exit, losing this merge): "
                                   return 255
                                   ;;
                                2)
-                                       clear
+                                       [[ $CLEAR_TERM == yes ]] && clear
                                        if [ "${using_editor}" == 0 ]; then
                                                (
                                                        echo "Showing differences between ${ofile} and ${mfile}"
@@ -555,6 +555,7 @@ chown ${UID:-0}:${GID:-0} "${TMP}" || die "failed to set ownership on temp dir"
 #CONFIG_PROTECT_MASK=$(/usr/lib/portage/bin/portageq envvar CONFIG_PROTECT_MASK)
 
 # load etc-config's configuration
+CLEAR_TERM=$(get_config clear_term)
 EU_AUTOMERGE=$(get_config eu_automerge)
 rm_opts=$(get_config rm_opts)
 mv_opts=$(get_config mv_opts)
index 8157c3dc77066402aa7a2406dbd6b80e88581577..6f69dee6148e8ad176a20c541f0180557e4a8574 100644 (file)
@@ -5,6 +5,9 @@
 # note that you need dev-util/dialog installed
 mode="0"
 
+# Whether to clear the term prior to each display
+clear_term="yes"
+
 # Whether trivial/comment changes should be automerged
 eu_automerge="yes"