summaryrefslogtreecommitdiff
path: root/ucf
diff options
context:
space:
mode:
authorManoj Srivastava <srivasta@debian.org>2007-11-30 09:16:13 +0000
committerManoj Srivastava <srivasta@debian.org>2007-11-30 09:16:13 +0000
commit55320eb615843a7c26ca9737cac9cb56dc8078c5 (patch)
tree88f657a2ba366c148d27111d3c7503c789004422 /ucf
parent936c9d1629c6dc736bae88896e66009ce3c3fa35 (diff)
Use Choices-C in changeprompt templates
For "keep current" and "threeway merge", ucf expects answers from debconf which differ from what is specified in the template master. Frans Pop suggested using the Choices-C feature of debconf, which is relatively new, but defines a fixed alias for each option which Debconf will then use in db_get and db_set operations -- so no more matching the template in the code. closes: #443179, #449274, #453084 git-archimport-id: srivasta@debian.org--lenny/ucf--devel--3.0--patch-2
Diffstat (limited to 'ucf')
-rwxr-xr-xucf25
1 files changed, 7 insertions, 18 deletions
diff --git a/ucf b/ucf
index d5df08e..a974f55 100755
--- a/ucf
+++ b/ucf
@@ -192,17 +192,6 @@ END
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 @@ EOPEND
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 @@ EOPEND
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 @@ EOPEND
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 @@ EOPEND
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 @@ EOPEND
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}"