Bug#208408: tetex-bin: No hyphenation patterns were loaded
frank@kuesterei.ch (Frank Küster) wrote:
> This means the flag-fiddling will have to persist in future versions,
> but with an additional check if this has been done. We can easily
> achieve this in the same way how we prevent the question from being
> shown two times upon the same upgrade (see above).
So this is my new suggestion. By the way, I will be off for a meeting
from Thursday this week, and then on holiday. So don't expect too much
from me.
--- tetex-bin-2.0.2/debian/config.orig Tue Sep 16 11:33:22 2003
+++ tetex-bin-2.0.2/debian/config Tue Sep 16 11:15:59 2003
@@ -1,5 +1,7 @@
#!/bin/sh -e
+DEFAULTS="french[=patois], ngerman[=naustrian-neue_Rechtschreibung]"
+
# Use debconf.
. /usr/share/debconf/confmodule || exit
db_version 2.0
@@ -52,6 +54,49 @@
db_go
db_get tetex-bin/use_debconf || true
if [ "$RET" = "true" ]; then
-db_input medium tetex-bin/hyphen || true
-db_go
+ db_fget tetex-bin/hyphen seen
+ # has this question been seen? If yes, we want to make the
+ # values chosen part of the default
+ if [ "$RET" = "true" ]; then
+ # inform the user that defaults have changed, and he will
+ # have to manually choose (n)german and french
+ # db_input tetex-bin/hyphenhaschanged || true
+ db_get tetex-bin/hyphen
+ # there might still have been no extra pattern selected
+ if [ -z "$RET" ]; then
+ DEFAULT_ANS="$DEFAULTS"
+ else
+ DEFAULT_ANS="$DEFAULTS, $RET"
+ # This time it's not necessary. But if we ever add
+ # defaults again, we have to fish out double occurences
+ # DEFAULTS_MERGED="$DEFAULTS, $RET"
+ # DEFAULT_ANS=`echo -n $DEFAULTS_MERGED | tr -d ',' | tr ' ' '\n' | sort -u | tr '\n' ',' | sed 's/,$//'`
+ fi
+ else
+ # the question has never been seen (either fresh install
+ # or upgrading directly from woody), so there's nothing to keep:
+ DEFAULT_ANS="$DEFAULTS"
+ fi
+ db_set tetex-bin/hyphen "$DEFAULT_ANS"
+ # Every user has to see this question once again, even if he/she has
+ # yet answered the question in a previous upgrade. But this script
+ # is run again on every subsequent upgrade, and by postinst, we have
+ # to check for that.
+ db_fget tetex-bin/hyphen shown_again
+ if [ "$RET" = "false" ]; then
+ db_fset tetex-bin/hyphen seen false
+ db_fset tetex-bin/hyphen shown_again true
+ fi
+ db_input medium tetex-bin/hyphen || true
+ db_go
+ # after fiddling with the seen flag, it has to be set to true manually.
+ # We do this only if the debconf command succeeded.
+ RETVAL=$?
+ if [ "$RETVAL" -eq 0 ]; then
+ if [ "$RET" = "true" ]; then
+ db_fset tetex-bin/hyphen seen true
+ fi
+ fi
fi
+
+
--
Frank Küster, Biozentrum der Univ. Basel
Abt. Biophysikalische Chemie
Reply to: