]> git.donarmstrong.com Git - roundcube.git/commitdiff
Avoid to pop language question at every upgrade. Thanks to Ivan Vucica
authorVincent Bernat <bernat@debian.org>
Thu, 8 May 2008 07:51:32 +0000 (07:51 +0000)
committerJérémy Bobbio <lunar@debian.org>
Sat, 18 Jun 2011 17:27:14 +0000 (19:27 +0200)
for spotting this. The problem lied in the use of db_metaget to get
the value of a key set by db_subst in a previous invocation. It seems
this is not possible any more (Closes: #480043). The fix implies that
we won't ask the question again if more languages are available since
last upgrade.

debian/changelog
debian/roundcube-core.config

index 32e983d4b943af9608d559e1db671d6e665e0e8c..c2f5c1455e9c60233b5d3d4f63f200aca7b77c0f 100644 (file)
@@ -2,8 +2,14 @@ roundcube (0.1.1-3) unstable; urgency=low
 
   * Fix an error introduced when fixing bug #476803. Thanks to Micah
     Anderson for spotting it (Closes: #479775).
-
- -- Vincent Bernat <bernat@debian.org>  Tue, 06 May 2008 18:46:52 +0200
+  * Avoid to pop language question at every upgrade. Thanks to Ivan Vucica
+    for spotting this. The problem lied in the use of db_metaget to get
+    the value of a key set by db_subst in a previous invocation. It seems
+    this is not possible any more (Closes: #480043). The fix implies that
+    we won't ask the question again if more languages are available since
+    last upgrade.
+
+ -- Vincent Bernat <bernat@debian.org>  Thu, 08 May 2008 09:50:24 +0200
 
 roundcube (0.1.1-2) unstable; urgency=low
 
index 65b65a43f99594eea4c7585b27c83d49cc748c04..4914ae781e81e2b8bce6a49acb88796fa1eb20e3 100644 (file)
@@ -10,30 +10,31 @@ db_go || true
 # Retrieve all available languages
 instd_langs=$(echo /usr/share/roundcube/program/localization/*/messages.inc | \
     sed 's+[^ ]*/\([^ ]*\)/messages.inc+\1,+g' | sed 's+,$++')
-# Retrieve the old list
-db_metaget roundcube/language languages && oldchoices="$RET"
-if [ ! "$oldchoices" ] || [ "$instd_langs" != "$oldchoices" ]; then
-       db_subst roundcube/language languages $instd_langs
-       db_fset roundcube/language seen false
-       # Firs try to get the current choice in case of preseeding
-       db_get roundcube/language || true
-       locale="$RET"
-       if [ -n "$locale" -a -d "/usr/share/roundcube/program/localization/$locale" ]; then
-          db_set roundcube/language $locale
-       else
-              # Try to guess the locale
-              locale=$(echo $LANG | sed 's/[@\.].*//')
-              if [ -d /usr/share/roundcube/program/localization/$locale ]; then
-                             db_set roundcube/language $locale
-             else
-                     locale=$(echo $locale | sed 's/_.*//')
-                     if [ -d /usr/share/roundcube/program/localization/$locale ]; then
-                             db_set roundcube/language $locale
-                     else
-                             db_set roundcube/language en_US
-                     fi
-             fi
-       fi
+db_subst roundcube/language languages $instd_langs
+# First try to get the current choice in case of preseeding or if the
+# question has already been asked
+db_get roundcube/language || true
+locale="$RET"
+if [ -n "$locale" -a -d "/usr/share/roundcube/program/localization/$locale" ]; then
+    # We get our answer (db_set should be useless in fact)
+    db_set roundcube/language $locale
+else 
+    # Either we never answered the question or the locale does not
+    # exist any more. In both cases, we do as if we never seen the
+    # question.
+    db_fset roundcube/language seen false
+    # Try to guess the locale
+    locale=$(echo $LANG | sed 's/[@\.].*//')
+    if [ -d /usr/share/roundcube/program/localization/$locale ]; then
+               db_set roundcube/language $locale
+    else
+       locale=$(echo $locale | sed 's/_.*//')
+       if [ -d /usr/share/roundcube/program/localization/$locale ]; then
+           db_set roundcube/language $locale
+       else
+           db_set roundcube/language en_US
+       fi
+    fi
 fi
 # Ask the question
 db_input medium roundcube/language || true