Package: geneweb
Version: 5.01-8
Severity: serious
Tags: patch

Hi Christian,

I've prepared a patch for you to remove the dependency on the iso_639.tab 
file. I've built the package successfully here, the language choices in the 
debconf frontend seem to be sane as well. However, I don't use the package 
geneweb myself, so it would be great if you could check for yourself if the 
patch is really complete.

Regards,
Tobias

-- 
Tobias Quathamer | Absolutely nothing should be concluded from these
Hamburg, Germany | figures except that no conclusion can be drawn from them.

diff --git a/debian/control b/debian/control
index ba70c50..d69da34 100644
--- a/debian/control
+++ b/debian/control
@@ -3,7 +3,7 @@ Section: misc
 Priority: optional
 Maintainer: Christian Perrier <bubu...@debian.org>
 Standards-Version: 3.8.0
-Build-Depends: debhelper (>= 5.0.0), ocaml-best-compilers, ocaml (>= 3.04), camlp5, doc-base, dh-buildinfo, iso-codes, po-debconf, quilt (>= 0.40)
+Build-Depends: debhelper (>= 5.0.0), ocaml-best-compilers, ocaml (>= 3.04), camlp5, doc-base, dh-buildinfo, iso-codes, isoquery, po-debconf, quilt (>= 0.40)
 Homepage: http://www.geneweb.org/
 
 
@@ -11,7 +11,7 @@ Package: geneweb
 Section: misc
 Architecture: any
 Depends: ${shlibs:Depends},perl5-base, lsb-base (>= 3.0-6)
-Pre-Depends: ${misc:Depends}, iso-codes, adduser
+Pre-Depends: ${misc:Depends}, iso-codes, isoquery, adduser
 Suggests: menu (>=2.1.35), gwtp, gwsetup, lynx | www-browser
 Priority: optional
 Description: genealogy software with web interface
diff --git a/debian/geneweb.config b/debian/geneweb.config
index cb2944e..1605264 100644
--- a/debian/geneweb.config
+++ b/debian/geneweb.config
@@ -8,9 +8,8 @@ db_version 2.0 || [ $? -lt 30 ]
 
 db_title "Geneweb genealogy software"
 
-# ISO 639 (language nales and codes) reference file
-# Needs Depends: iso-codes
-ISO639=/usr/share/iso-codes/iso_639.tab
+# Needs Depends: iso-codes, isoquery
+ISOQUERY=/usr/bin/isoquery
 
 # These will be used here and there below
 SERVICES=/etc/services
@@ -44,10 +43,9 @@ read_rcfile() {
 }
 
 translate_LNG() {
-    # Waiting for a more general script in the iso-codes package
-    # see debian-devel-french archives from April 2003
+    # Get the full language name from the two letter code
     if [ -n "$LNG" ] ; then
-       FULLLNG=`grep -E "^[a-z][a-z][a-z]	[a-z][a-z][a-z]	$LNG	" $ISO639 | awk '{print $4};'`
+       FULLLNG=`$ISOQUERY --iso=639 "$LNG" | cut -f4`
     fi
 }
 
@@ -76,8 +74,7 @@ get_debconf() {
     FULLLNG=$RET
 
     # Find the two letter code for language
-    # waiting for a more general script in the iso-codes package
-    LNG=`grep "	${FULLLNG}\$" $ISO639 | grep -v XX | awk '{print $3};'`
+    LNG=`$ISOQUERY --iso=639 | grep "${FULLLNG}\$" | cut -f3`
 
 
     db_get geneweb/run_mode
diff --git a/debian/geneweb.postinst b/debian/geneweb.postinst
index 17c6878..3169ac6 100644
--- a/debian/geneweb.postinst
+++ b/debian/geneweb.postinst
@@ -5,9 +5,8 @@
 
 set +e 
 
-# ISO 639 (language nales and codes) reference file
-# Needs Depends: iso-codes
-ISO639=/usr/share/iso-codes/iso_639.tab
+# Needs Depends: iso-codes, isoquery
+ISOQUERY=/usr/bin/isoquery
 
 # These will be used here and there below
 SERVICES=/etc/services
@@ -84,9 +83,8 @@ get_debconf() {
 	FULLLNG=$DEFAULTFULLLNG
     fi
     # Find the two letter code for language
-    # waiting for a more general script in the iso-codes package
     # LNG=`echo $FULLLNG | cut -f 2 -d "(" | cut -f 1 -d ")"`
-    LNG=`grep "	${FULLLNG}\$" $ISO639 | grep -v XX | awk '{print $3};'`
+    LNG=`$ISOQUERY --iso=639 | grep "${FULLLNG}\$" | cut -f3`
 
 
     db_get geneweb/run_mode
diff --git a/debian/mktemplates b/debian/mktemplates
index 1942392..9e21a97 100644
--- a/debian/mktemplates
+++ b/debian/mktemplates
@@ -8,23 +8,16 @@ set -e
 # iso-codes package
 #
 # Some variables
-# This one will be useless when iso-codes-utils will be available
-ISO639TAB=/usr/share/iso-codes/iso_639.tab
+ISOQUERY=/usr/bin/isoquery
 # Translations location (relative to the build root directory)
 ISO639TRANSLATIONS=debian/iso-codes
 #
 # This file will have all wanted languages, one ISO-639 code per line
 LANGUAGELIST=debian/languages
 
-# Be a bit more safe
-[ -r $ISO639TAB ] || exit 1
-
 # For each supported language, get the language name from ISO 639 list
 (for lang in `cat debian/languages | grep -v "^#"` ; do
-  echo `cat $ISO639TAB | grep -v "^#" | \
-  awk '{print $3 " " $4 " " $5}' | \
-  grep "^$lang " | \
-  awk '{print $2 " " $3}'`
+  $ISOQUERY --iso=639 $lang | cut -f4
 done) | \
 (read a; echo -n "$a"; while read b; do echo -n ", $b"; done; echo) \
 >debian/languagelist
diff --git a/debian/rules b/debian/rules
index cd3e3eb..64338c1 100755
--- a/debian/rules
+++ b/debian/rules
@@ -57,7 +57,7 @@ clean-patched:
 	debconf-updatepo
 
 	# Add here commands to clean up after the build process.
-	[ ! -f tools/Makefile.inc ] || [ ! -f Makefile] || $(MAKE) clean
+	[ ! -f tools/Makefile.inc ] || [ ! -f Makefile ] || $(MAKE) clean
 
 	# Clean out cruft left by former builds
 	rm -f tools/Makefile.inc

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to