--- /usr/sbin/etc-update 2003-06-21 22:13:31.000000000 +0200 +++ etc-update 2003-06-21 22:12:58.000000000 +0200 @@ -122,10 +122,8 @@ echo -n " (-5 to auto-merge AND not use 'mv -i'): " read input else - dialog --title "${title}" --menu "${my_title}" \ - 0 0 0 `echo "-1 Exit";cat ${TMP}/menuitems` \ - 2> ${TMP}/input - input=`cat ${TMP}/input` + input=`dialog --cancel-label "Exit" --title "${title}" --menu "${my_title}" 0 0 0 $(<${TMP}/menuitems) 2>&1 1>/dev/tty` + if (( $? == 1 )); then input=-1; fi fi if (( ${input} == -5 )); then input=-3 @@ -176,10 +174,8 @@ echo -n "Please select a file to process (-1 to exit this file): " read my_input else - dialog --title "${title}" --menu "${my_title}" \ - 0 0 0 `cat ${TMP}/menuitems;echo "${fcount} Exit"` \ - 2> ${TMP}/input - my_input=`cat ${TMP}/input` + my_input=`dialog --title "${title}" --menu "${my_title}" 0 0 0 $(<${TMP}/menuitems) 2>&1 1>/dev/tty` + if (( $? == 1 )); then my_input=-1; fi fi fi # OVERWRITE_ALL @@ -227,7 +223,8 @@ showdiffcmd=$(echo "${diff_command}" | sed -e "s:%file1:${ofile}:" -e "s:%file2:${file}:") - if [ "${using_editor}" == 0 ]; then + if (( ${mode} == 0 )); then + if (( ${using_editor} == 0 )); then ( echo "Showing differences between ${ofile} and ${file}" ${showdiffcmd} @@ -242,6 +239,16 @@ 4) Show differences again Please select from the menu above (-1 to ignore this update): " read my_input + else + ${showdiffcmd} > ${TMP}/diff + my_input=`dialog --title "${title}" --exit-label "Continue" --textbox ${TMP}/diff 0 0 --and-widget --no-shadow --begin $((size_y - 8)) $(((size_x - 30)/2)) --extra-button --extra-label "Diff" --cancel-label "Ignore" --menu "Use which Version?" 9 30 3 1 "Updated" 2 "Current" 3 "Combined" 2>&1 1>/dev/tty` + retval=$? + if (( retval == 1 )); then + my_input=-1 + elif (( retval == 3 )); then + my_input=4 + fi + fi fi case ${my_input} in @@ -354,6 +361,12 @@ declare -i mode=`get_config mode` [ -z ${mode} ] && mode=0 [ -z "${pager}" ] && pager="cat" +if (( ${mode} == 1 )); then + size="`dialog --print-maxsize 2>&1 1>/dev/tty`" + size_x="${size#*, }" + size_y="${size#* }" + size_y="${size_y%,*}" +fi #echo "rm_opts: $rm_opts, mv_opts: $mv_opts, cp_opts: $cp_opts" #echo "pager: $pager, diff_command: $diff_command, merge_command: $merge_command"