From 9cf5cbb7d3ccd308e776684afb3db3511ccb048e Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Thu, 8 May 2008 07:51:32 +0000 Subject: [PATCH] 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. --- debian/changelog | 10 ++++++-- debian/roundcube-core.config | 49 ++++++++++++++++++------------------ 2 files changed, 33 insertions(+), 26 deletions(-) diff --git a/debian/changelog b/debian/changelog index 32e983d..c2f5c14 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 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 Thu, 08 May 2008 09:50:24 +0200 roundcube (0.1.1-2) unstable; urgency=low diff --git a/debian/roundcube-core.config b/debian/roundcube-core.config index 65b65a4..4914ae7 100644 --- a/debian/roundcube-core.config +++ b/debian/roundcube-core.config @@ -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 -- 2.39.2