Don't source /etc/default/iodine in config script but read out the values
authorgregor herrmann <gregoa@debian.org>
Thu, 10 Feb 2011 15:01:12 +0000 (15:01 -0000)
committergregor herrmann <gregoa@debian.org>
Thu, 10 Feb 2011 15:01:12 +0000 (15:01 -0000)
with awk. This allows to use shell constructs like $() in the file and
preserve them during re-configuration (closes: #612723).
Thanks to "Debian bug at v.nix.is" for the bug report.

debian/changelog
debian/config

index 5df9a4747ce73f274f2bcf86c391234bf9784ca6..2ed3796ae604d23e9a52f8f1bd07e71b9ec7da54 100644 (file)
@@ -1,3 +1,12 @@
+iodine (0.6.0~rc1-5) UNRELEASED; urgency=low
+
+  * Don't source /etc/default/iodine in config script but read out the values
+    with awk. This allows to use shell constructs like $() in the file and
+    preserve them during re-configuration (closes: #612723).
+    Thanks to "Debian bug at v.nix.is" for the bug report.
+
+ -- gregor herrmann <gregoa@debian.org>  Thu, 10 Feb 2011 15:33:18 +0100
+
 iodine (0.6.0~rc1-4) unstable; urgency=low
 
   * Upload to unstable.
index 36e43452b69e985305724b8bc310db95bd40d3d0..9ee98564fb9579704cc8e72f728e3941fa416437 100644 (file)
@@ -4,14 +4,20 @@ set -e
 
 . /usr/share/debconf/confmodule
 
+getvalue() {
+       awk '/^'"$1"'=/ {gsub("\"", ""); sub("'"$1"'=", ""); value=$0;} END {print value}' /etc/default/iodine
+}
+
 if [ -s /etc/default/iodine ] ; then
-       . /etc/default/iodine
+       START_IODINED="$(getvalue START_IODINED)"
        if [ -n "$START_IODINED" ] ; then
                db_set iodine/start_daemon "$START_IODINED"
        fi
+       IODINED_ARGS="$(getvalue IODINED_ARGS)"
        if [ -n "$IODINED_ARGS" ] ; then
                db_set iodine/daemon_options "$IODINED_ARGS"
        fi
+       IODINED_PASSWORD="$(getvalue IODINED_PASSWORD)"
        if [ -n "$IODINED_PASSWORD" ] ; then
                db_set iodine/daemon_password "$IODINED_PASSWORD"
        fi