summaryrefslogtreecommitdiff
path: root/debian
diff options
context:
space:
mode:
authorJulien Valroff <julien@kirya.net>2010-09-04 15:03:32 +0200
committerJulien Valroff <julien@kirya.net>2010-09-04 15:03:32 +0200
commit614f647b71d2b2003e828c78f562ce7d13675b37 (patch)
tree9ccfea7d9483450e91fc383ff7ea8e72dd9a1949 /debian
parentd3d83113455f2bb70159191965b9858b58945a0d (diff)
Don't use any temporary file for ucf
Diffstat (limited to 'debian')
-rw-r--r--debian/mailgraph.config7
-rw-r--r--debian/mailgraph.postinst10
2 files changed, 8 insertions, 9 deletions
diff --git a/debian/mailgraph.config b/debian/mailgraph.config
index 81a5977..84c101a 100644
--- a/debian/mailgraph.config
+++ b/debian/mailgraph.config
@@ -6,6 +6,7 @@ set -e
db_title "mailgraph" || true
+# Sync debconf values with the local configuration
if [ -r /etc/default/mailgraph ]; then
. /etc/default/mailgraph
db_set mailgraph/start_on_boot "$BOOT_START"
@@ -14,8 +15,8 @@ if [ -r /etc/default/mailgraph ]; then
fi
db_input medium mailgraph/start_on_boot || true
-db_go
+db_go || true
db_input medium mailgraph/mail_log || true
-db_go
+db_go || true
db_input medium mailgraph/ignore_localhost || true
-db_go
+db_go || true
diff --git a/debian/mailgraph.postinst b/debian/mailgraph.postinst
index 2cbe1bd..fa10193 100644
--- a/debian/mailgraph.postinst
+++ b/debian/mailgraph.postinst
@@ -19,20 +19,18 @@ set -e
. /usr/share/debconf/confmodule
+DEFAULT="/usr/share/mailgraph/mailgraph.default"
+
case "$1" in
configure)
- TEMPFILE=`tempfile`
- cp -p /usr/share/mailgraph/mailgraph.default ${TEMPFILE}
-
# Merge debconf values into the configuration
for foo in BOOT_START=start_on_boot MAIL_LOG=mail_log IGNORE_LOCALHOST=ignore_localhost; do
db_get mailgraph/${foo#*=}
- sed -i -re "s@^(${foo%=*}=).*@\1\"${RET}\"@" "$TEMPFILE"
+ sed -i -re "s@^(${foo%=*}=).*@\1\"${RET}\"@" "$DEFAULT"
done
- ucf --three-way --debconf-ok ${TEMPFILE} /etc/default/mailgraph
+ ucf --three-way --debconf-ok ${DEFAULT} /etc/default/mailgraph
ucfr mailgraph /etc/default/mailgraph
- rm -f ${TEMPFILE}
;;
abort-upgrade|abort-remove|abort-deconfigure)