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

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



From: frank@kuesterei.ch (Frank Küster)
Subject: Bug#208408: tetex-bin: No hyphenation patterns were loaded
Date: Wed, 22 Oct 2003 11:02:31 +0200

> When I first was pointed to the idea of introducing a new flag, I also
> was inclined to find it difficult and "fiddling". However, once I looked
> into the documentation and tried it out, finding that one can just set
> and ask for any flag he likes, I now think that in fact it's easy. All
> you get is one more entry in the Flags: line in config.dat - e.g. here's
> my test config.dat:

Thanks for elaboration.  I guess your spacing is too wild(?)
so I changed (only spacing or tabbing) your patch as follows.

And I have a question.

+    # This time it's not necessary. But if we ever add
+    # defaults again, we have to fish out double occurences

Is this really true?  I suspect there might be a user who 
already did "dpkg-reconfigure tetex-bin" and setted french 
and/or ngerman and so double occurence could be there.

--- 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,47 @@
 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



Reply to: