calcurse-upgrade: Change location of temporary file

Instead of creating the temporary file in a central location, place it
in the same directory as the configuration file. Pros:

* No need to rely on the "$TMPDIR" environment variable.

* Multiple users can upgrade their configuration files at the same time,
  even if "$!" isn't set properly.

* One user can upgrade several configuration files (in different
  directories or with different file names) at once.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
This commit is contained in:
Lukas Fleischer 2012-06-01 14:31:18 +02:00
parent 1022781821
commit f44b307e22

View File

@ -40,7 +40,7 @@ if grep -q -e '^auto_save=' -e '^auto_gc=' -e '^periodic_save=' \
echo "$(gettext "Pre-3.0.0 configuration file format detected...")"
tmpfile="${TMPDIR:-/tmp}/calcurse-upgrade.$!"
tmpfile="$CONFFILE.calcurse-upgrade.tmp"
[ -e "$tmpfile" ] && exit 1
echo -n "$(gettext "Upgrade configuration directives...")"