[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#208408: tetex-bin: No hyphenation patterns were loaded



Atsuhito Kohda <kohda@pm.tokushima-u.ac.jp> schrieb:

> From: frank@kuesterei.ch (Frank Küster)
> Subject: Bug#208408: tetex-bin: No hyphenation patterns were loaded
> Date: Sat, 06 Sep 2003 21:07:34 +0200
>
>> Of course. I
>> was fooled by the following:
>> 
>> >> > +else
>> >> > +# in case fresh install
>> 
>> If I install tetex for the first time, won't config be called with
>> "configure", so that we get into the if-branch? And the else branch is
>> used if called by dpkg-reconfigure? 
>
> I see, my if and else branches seemed broken.
> (and a comment was completely wrong ;)
>
> My intention is
>
> if; a case which needs to preserve previous answers
> else; a case which doesn't (fresh install?)

I have tried the following. Concerning defaults and preserving old
choices, it does what it was made for. However, there's one problem I
don't understand: The hyphen question is always shown twice. The second
time seems to be just before postinst is started, or at its very
beginning. 

It even doesn't matter whether I use the line

db_fset tetex-bin/hyphen seen true

or not. I have inserted 

db_fget tetex-bin/hyphen seen
echo "After set $RET" >> /tmp/seen

at different places, and the outcome is that the question is flagged
seen, even without explicitly setting this, after it has been
displayed. Could this be an artifact of my pbuilder environment?

Thanks, Frank

--- debian/config.orig	Wed Sep 10 19:42:28 2003
+++ debian/config	Wed Sep 10 19:44:37 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,38 @@
 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, even if he/she has
+    # yet answered the question in a previous upgrade
+ 		db_fset tetex-bin/hyphen seen false
+		db_input medium tetex-bin/hyphen || true
+# 		db_fset tetex-bin/hyphen seen true
+		db_go
 fi
+
+db_fget tetex-bin/hyphen seen
+echo "At end $RET" >> /tmp/seen
+


-- 
Frank Küster, Biozentrum der Univ. Basel
Abt. Biophysikalische Chemie




Reply to: