On Monday 01 October 2007, Frans Pop wrote:
> On Monday 01 October 2007, Frans Pop wrote:
> > Please consider the attached patch which uses the Choices-C feature of
> > debconf. With that you'll never have to worry about inconsistency with
> > actual strings.
>
> Oops. Noticed a small error in the patch that would have meant loosing
> the translator comment in the PO files. Fixed in attached version of the
> patch.

Meh. Brown paper bag day.
I'd forgotten to change the default and also not noticed that there were two 
templates (with/without threeway).

This patch really should be good, but please check.
Sorry for the messups.

diff -Nru /tmp/aDnWvBeLvy/ucf-3.003/debian/changelog /tmp/IA2Q6YkgyO/ucf-3.004~fjp/debian/changelog
--- /tmp/aDnWvBeLvy/ucf-3.003/debian/changelog	2007-09-19 17:01:04.000000000 +0200
+++ /tmp/IA2Q6YkgyO/ucf-3.004~fjp/debian/changelog	2007-10-01 17:57:48.000000000 +0200
@@ -1,3 +1,10 @@
+ucf (3.004~fjp) UNRELEASED; urgency=low
+
+  * Use Choices-C in changeprompt templates to simplify interaction with
+    debconf.
+
+ -- Frans Pop <[EMAIL PROTECTED]>  Mon, 01 Oct 2007 17:56:54 +0200
+
 ucf (3.003) unstable; urgency=low
 
   * Bug fix: "ucf: expects the wrong answers from debconf", thanks to
diff -Nru /tmp/aDnWvBeLvy/ucf-3.003/debian/control /tmp/IA2Q6YkgyO/ucf-3.004~fjp/debian/control
--- /tmp/aDnWvBeLvy/ucf-3.003/debian/control	2007-09-19 17:01:04.000000000 +0200
+++ /tmp/IA2Q6YkgyO/ucf-3.004~fjp/debian/control	2007-10-01 18:01:46.000000000 +0200
@@ -9,7 +9,7 @@
 
 Package: ucf
 Architecture: all
-Depends: debconf (>= 1.4.72) | debconf-2.0, coreutils (>= 5.91)
+Depends: debconf (>= 1.5.5) | debconf-2.0, coreutils (>= 5.91)
 Recommends: debconf-utils
 Description: Update Configuration File: preserve user changes to config files.
  Debian policy mandates that user changes to configuration files must be 
diff -Nru /tmp/aDnWvBeLvy/ucf-3.003/debian/templates.master /tmp/IA2Q6YkgyO/ucf-3.004~fjp/debian/templates.master
--- /tmp/aDnWvBeLvy/ucf-3.003/debian/templates.master	2007-09-19 17:01:04.000000000 +0200
+++ /tmp/IA2Q6YkgyO/ucf-3.004~fjp/debian/templates.master	2007-10-01 18:31:05.000000000 +0200
@@ -11,20 +11,21 @@
 Type: title
 _Description: Modified configuration file
 
-
 Template: ucf/changeprompt_threeway
 Type: select
 # Translators, please keep translations *short* (less than 65 columns)
 __Choices: install the package maintainer's version, keep the local version currently installed, show the differences between the versions, show a side-by-side difference between the versions, show a 3-way difference between available versions, do a 3-way merge between available versions (experimental), start a new shell to examine the situation
-Default: keep the local version currently installed
+Choices-C: install_new, keep_current, diff, sdiff, diff_threeway, merge_threeway, shell
+Default: keep_current
 _Description: What would you like to do about ${BASENAME}?
  A new version of configuration file ${FILE} is available, but the version installed
  currently has been locally modified.
 
 Template: ucf/changeprompt
 Type: select
 __Choices: install the package maintainer's version, keep the local version currently installed, show the differences between the versions, show a side-by-side difference between the versions, start a new shell to examine the situation
-Default: keep the local version currently installed
+Choices-C: install_new, keep_current, diff, sdiff, shell
+Default: keep_current
 _Description: What would you like to do about ${BASENAME}?
  A new version of configuration file ${FILE} is available, but the version installed
  currently has been locally modified.
diff -Nru /tmp/aDnWvBeLvy/ucf-3.003/ucf /tmp/IA2Q6YkgyO/ucf-3.004~fjp/ucf
--- /tmp/aDnWvBeLvy/ucf-3.003/ucf	2007-09-19 17:01:03.000000000 +0200
+++ /tmp/IA2Q6YkgyO/ucf-3.004~fjp/ucf	2007-10-01 18:05:26.000000000 +0200
@@ -192,17 +192,6 @@
 fi
 
 
-# These are strings that must match the untranslated choices
-# of the debconf question.
-choice_install_new="install the package maintainer's version"
-choice_keep_current="keep the local version currently installed"
-choice_diff="show the differences between the versions"
-choice_sdiff="show a side-by-side difference between the versions"
-choice_diff_threeway="show a 3 way difference between available versions of the file"
-choice_merge_threeway="do a 3 way merge between available versions (experimental)"
-choice_shell="start a new shell to examine the situation"
-
-
 purge_md5sum () {
     for i in $(/usr/bin/seq 6 -1 0); do
 	if [ -e "${statedir}/hashfile.${i}" ]; then
@@ -883,13 +872,13 @@
 	fi
 
 	case "$ANSWER" in
-	    "$choice_install_new"|y|Y|I|i)
+	    install_new|y|Y|I|i)
 		echo >&2 "Replacing config file $dest_file with new version"
 		RETAIN_OLD=YES
 		replace_conf_file;
 		exit 0;
 		;;
-	    "$choice_diff"|D|d)
+	    diff|D|d)
 		if [ -e "$dest_file" ]; then
 		    DIFF="$(diff -uBbw "$dest_file" "$new_file")" || true
 		else
@@ -897,7 +886,7 @@
 		fi
 		show_diff "$DIFF"
 		;;
-	    "$choice_sdiff"|S|s)
+	    sdiff|S|s)
 		if [ -e "$dest_file" ]; then
 		    DIFF="$( sdiff -BbW "$dest_file" "$new_file")"  || true
 		else
@@ -905,7 +894,7 @@
 		fi
 		show_diff "$DIFF"
 		;;
-	    "$choice_diff_threeway"|3|t|T)
+	    diff_threeway|3|t|T)
 		if [ -e "$statedir/cache/$cached_file" \
 		    -a "X$THREEWAY" != "X" ]; then
                     if [ -e "$dest_file" ]; then
@@ -927,7 +916,7 @@
 		    show_diff "$DIFF"
 		fi
 		;;
-	    "$choice_merge_threeway"|M|m)
+	    merge_threeway|M|m)
 		echo >&2 "Merging changes into the new version"
 		if [ -e "$statedir/cache/$cached_file" \
 		    -a "X$THREEWAY" != "X" ]; then
@@ -951,10 +940,10 @@
                 rm -f "$dest_file.${NEW_SUFFIX}" # don't need this around no mo'
                 exit 0
 		;;
-	    "$choice_shell"|Z|z)
+	    shell|Z|z)
 		bash >/dev/tty </dev/tty || true
 		;;
-	    $choice_keep_current|n|N|o|O|'')
+	    keep_current|n|N|o|O|'')
 		replace_md5sum;
 
 		cp -pf "$orig_new_file" "$dest_file.${DIST_SUFFIX}"

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

Reply via email to