if [ "${OVERWRITE_ALL}" == "yes" ]; then
input=0
+ elif [ "${DELETE_ALL}" == "yes" ]; then
+ input=0
else
if [[ ${mode} == 0 ]] ; then
echo "The following is the list of files which need updating, each
if [[ ${mode} == 0 ]] ; then
cat ${TMP}/menuitems
echo "Please select a file to edit by entering the corresponding number."
- echo " (don't use -3 or -5 if you're unsure what to do)"
+ echo " (don't use -3, -5, -7 or -9 if you're unsure what to do)"
echo " (-1 to exit) (-3 to auto merge all remaining files)"
- echo -n " (-5 to auto-merge AND not use 'mv -i'): "
+ echo " (-5 to auto-merge AND not use 'mv -i')"
+ echo " (-7 to discard all updates)"
+ echo -n " (-9 to discard all updates AND not use 'rm -i'):"
read input
else
dialog --title "${title}" --menu "${my_title}" \
2> ${TMP}/input || die "User termination!" 0
input=$(<${TMP}/input)
fi
+ if [[ ${input} == -9 ]]; then
+ read -p "Are you sure that you want to delete all updates (type YES):" reply
+ if [[ ${reply} != "YES" ]]; then
+ continue
+ else
+ input=-7
+ export rm_opts=""
+ fi
+ fi
+ if [[ ${input} == -7 ]]; then
+ input=0
+ export DELETE_ALL="yes"
+ fi
if [[ ${input} == -5 ]] ; then
input=-3
export mv_opts=""
if [ "${OVERWRITE_ALL}" == "yes" ]; then
my_input=0
+ elif [ "${DELETE_ALL}" == "yes" ]; then
+ my_input=0
else
for line in $(<${TMP}/files/${input}); do
if (( ${fcount} > 0 )); then
until (( ${my_input} == -1 )) || [ ! -f ${file} ]; do
if [ "${OVERWRITE_ALL}" == "yes" ]; then
my_input=1
+ elif [ "${DELETE_ALL}" == "yes" ]; then
+ my_input=2
else
showdiffcmd=$(echo "${diff_command}" |
sed -e "s:%file1:${ofile}:" -e "s:%file2:${file}:")
case ${my_input} in
1) echo "Replacing ${ofile} with ${file}"
mv ${mv_opts} ${file} ${ofile}
- my_input=-1
+ [ -n "${OVERWRITE_ALL}" ] && my_input=-1
continue
;;
2) echo "Deleting ${file}"
rm ${rm_opts} ${file}
+ [ -n "${DELETE_ALL}" ] && my_input=-1
continue
;;
3) do_merge "${file}" "${ofile}"