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

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



From: Atsuhito Kohda <kohda@pm.tokushima-u.ac.jp>
Subject: Bug#208408: tetex-bin: No hyphenation patterns were loaded
Date: Wed, 03 Sep 2003 23:45:10 +0900 (JST)

> Yes, this is a bug ;)  Basically previous answers should be
> preserved and perhaps some mechanism using db_get and db_set 
> could do this trick.  But need more investigation...

> And, anyway, we should provide more refined mechanism in the
> next revision.

Well, I tested a bit and got the following patch.

But I didn't check every case so I'm willing to
get any advice or comment.  Especially, I'm not sure
that if-clause is sufficient or not.

--- debian/config.orig	2003-09-04 23:31:25.000000000 +0900
+++ debian/config	2003-09-04 17:59:03.000000000 +0900
@@ -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
@@ -47,11 +49,33 @@
     fi
 fi
 
+if [ "$1" != "reconfigure" -a -n "$2" ]; then
+# to preserve previous answers
+    if dpkg --compare-versions "$2" le 2.0.2-4.3.2; then
+	db_fset tetex-bin/hyphen seen false
+	db_get tetex-bin/hyphen
+	if [ -z "$RET" ]; then
+	    DEFAULT_ANS="$DEFAULTS"
+	else
+	    DEFAULT_ANS="$DEFAULTS, $RET"
+	fi
+	db_set tetex-bin/hyphen "$DEFAULT_ANS"
+    fi
+else
+# in case fresh install
+    db_fget tetex-bin/hyphen seen
+    if [ "$RET" = "false" ]; then
+	DEFAULT_ANS="$DEFAULTS"
+	db_set tetex-bin/hyphen "$DEFAULT_ANS"
+    fi
+fi
+
 # suggest a user to select extra hyphen patterns to load
 db_input medium tetex-bin/use_debconf || true
 db_go
 db_get tetex-bin/use_debconf || true
 if [ "$RET" = "true" ]; then
 db_input medium tetex-bin/hyphen || true
+db_fset tetex-bin/hyphen seen true
 db_go
 fi

Note: 
- "Default" entry in templates file seems to do nothing practically?
  It needed to do something like; db_set tetex-bin/hyphen "$DEFAULT_ANS"
- 2.0.2-4.3.2 is the version of a package I tested with.
  It should be 2.0.2-4.4 or 2.0.2-5 in released version, of course.
- once we did "db_fset tetex-bin/hyphen seen false" then
  "db_fset tetex-bin/hyphen seen true" seemed necessary
  but I'm not sure where is the best place to call it.
- in preinst, I misplaced the followings.  Please remove them.
  (I'll remove them in the next upload)

# Use debconf.                                                                  
. /usr/share/debconf/confmodule || exit
db_version 2.0

Regards,			2003-9-4(Thu)

-- 
 Debian Developer & Debian JP Developer - much more I18N of Debian
 Atsuhito Kohda <kohda@debian.org>
 Department of Math., Univ. of Tokushima



Reply to: