diff -Nru /tmp/S5olktKNFM/ucf-2.0017/debian/changelog /tmp/S7pjiJe3t4/ucf-2.0017ubuntu1/debian/changelog --- /tmp/S5olktKNFM/ucf-2.0017/debian/changelog 2006-11-16 20:35:59.000000000 +0100 +++ /tmp/S7pjiJe3t4/ucf-2.0017ubuntu1/debian/changelog 2007-02-09 19:57:27.000000000 +0100 @@ -1,3 +1,11 @@ +ucf (2.0017ubuntu1) feisty; urgency=low + + * use a debconf note for the diff + * updated dependency of debconf to 1.4.72 (this is the version that + supports the "escape" capability) + + -- Michael Vogt Fri, 9 Feb 2007 18:49:12 +0100 + ucf (2.0017) unstable; urgency=low * Bug fix: "ucf: spelling errors", thanks to Matt Taggart (Closes: #395444). diff -Nru /tmp/S5olktKNFM/ucf-2.0017/debian/control /tmp/S7pjiJe3t4/ucf-2.0017ubuntu1/debian/control --- /tmp/S5olktKNFM/ucf-2.0017/debian/control 2006-11-16 20:35:59.000000000 +0100 +++ /tmp/S7pjiJe3t4/ucf-2.0017ubuntu1/debian/control 2007-02-09 19:56:42.000000000 +0100 @@ -7,7 +7,7 @@ Package: ucf Architecture: all -Depends: debconf (>= 1.2.0) | debconf-2.0, coreutils (>= 5.91) +Depends: debconf (>= 1.4.72) | debconf-2.0, coreutils (>= 5.91) Recommends: debconf-utils Description: Update Configuration File: preserves user changes to config files. Debian policy states that configuration files must preserve user diff -Nru /tmp/S5olktKNFM/ucf-2.0017/debian/templates /tmp/S7pjiJe3t4/ucf-2.0017ubuntu1/debian/templates --- /tmp/S5olktKNFM/ucf-2.0017/debian/templates 2006-11-16 23:15:39.000000000 +0100 +++ /tmp/S7pjiJe3t4/ucf-2.0017ubuntu1/debian/templates 2007-02-09 21:11:12.000000000 +0100 @@ -106,3 +106,8 @@ En ny version av konfigurationsfilen ${FILE} finns tillgänglig men din version har modifierats lokalt. Description-vi.UTF-8: Đối với ${BASENAME}?, bạn muốn làm gì vậy? Có một phiên bản mới của tập tin cấu hình ${FILE}, nhưng phiên bản bạn đã được sửa đổi một cách địa phương. + +Template: ucf/show_diff +Type: note +Description: Showing the differences + ${DIFF} diff -Nru /tmp/S5olktKNFM/ucf-2.0017/debian/templates.master /tmp/S7pjiJe3t4/ucf-2.0017ubuntu1/debian/templates.master --- /tmp/S5olktKNFM/ucf-2.0017/debian/templates.master 2006-11-16 20:35:59.000000000 +0100 +++ /tmp/S7pjiJe3t4/ucf-2.0017ubuntu1/debian/templates.master 2007-02-09 19:59:28.000000000 +0100 @@ -18,3 +18,8 @@ _Description: What would you like to do about ${BASENAME}? A new version of configuration file ${FILE} is available, but your version has been locally modified. + +Template: ucf/show_diff +Type: note +_Description: Showing the differences + ${DIFF} diff -Nru /tmp/S5olktKNFM/ucf-2.0017/ucf /tmp/S7pjiJe3t4/ucf-2.0017ubuntu1/ucf --- /tmp/S5olktKNFM/ucf-2.0017/ucf 2006-11-16 20:35:57.000000000 +0100 +++ /tmp/S7pjiJe3t4/ucf-2.0017ubuntu1/ucf 2007-02-09 21:09:57.000000000 +0100 @@ -57,6 +57,26 @@ fi } +show_diff() { + if [ -z "$1" ]; then + echo >&2 "$progname: need a diff as argument" + exit 1; + fi + DIFF="$1" + if [ "$DEBCONF_OK" = "YES" ] && [ "$DEBIAN_HAS_FRONTEND" ]; then + templ=ucf/show_diff + db_capb escape + db_fset $templ seen false + db_reset $templ + db_subst $templ DIFF $(echo -e "$DIFF" | debconf-escape -e) + db_input critical $templ || true + db_go + db_get $templ + else + echo "$DIFF" | sensible-pager + fi +} + withecho () { echo " $@" >&2 "$@" @@ -870,59 +890,40 @@ ;; "$choice_diff"|D|d) if [ -e "$dest_file" ]; then - ( diff -uBbw "$dest_file" "$new_file" | \ - sensible-pager ) /dev/tty + DIFF=$(diff -uBbw "$dest_file" "$new_file") || true else - ( diff -uBbw /dev/null "$new_file" | \ - sensible-pager ) /dev/tty - fi - if [ "X$STOP" != "X" ]; then - echo >&2 "Please hit enter to continue"; - read -e ANSWER /dev/tty + DIFF=$( sdiff -BbW "$dest_file" "$new_file") || true else - ( sdiff -BbW /dev/null "$new_file" | \ - sensible-pager ) /dev/tty - fi - if [ "X$STOP" != "X" ]; then - echo >&2 "Please hit enter to continue"; - read -e ANSWER /dev/tty /dev/tty &2 "Please hit enter to continue"; - read -e ANSWER /dev/tty + DIFF=$(diff -uBbw "$dest_file" "$new_file") || true else - ( diff -uBbw /dev/null "$new_file" | \ - sensible-pager ) /dev/tty - fi - - if [ "X$STOP" != "X" ]; then - echo >&2 "Please hit enter to continue"; - read -e ANSWER