From fa1f0a5c44ae059d36fe8e0a384356131f51b9ec Mon Sep 17 00:00:00 2001
From: Lukas Fleischer <calcurse@cryptocrack.de>
Date: Fri, 1 Jun 2012 15:47:18 +0200
Subject: calcurse-upgrade: Display error if temp file exists

Instead of bailing out without any hint, show an error message if the
temporary file we use in calcurse-upgrade already exists.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
---
 scripts/calcurse-upgrade.sh.in | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

(limited to 'scripts')

diff --git a/scripts/calcurse-upgrade.sh.in b/scripts/calcurse-upgrade.sh.in
index c235874..959cd70 100644
--- a/scripts/calcurse-upgrade.sh.in
+++ b/scripts/calcurse-upgrade.sh.in
@@ -41,7 +41,13 @@ if grep -q -e '^auto_save=' -e '^auto_gc=' -e '^periodic_save=' \
   echo "$(gettext "Pre-3.0.0 configuration file format detected...")"
 
   tmpfile="$CONFFILE.calcurse-upgrade.tmp"
-  [ -e "$tmpfile" ] && exit 1
+  if [ -e "$tmpfile" ]; then
+    echo "$(gettext "Old temporary file found:") \"$tmpfile\"" >&2
+    echo "$(gettext "
+If a previous conversion did not complete, please try to remove this file and
+start over with a backup of your old configuration file.")" >&2
+    exit 1
+  fi
 
   echo -n "$(gettext "Upgrade configuration directives...")"
 
-- 
cgit v1.2.3-70-g09d2