Package: ucf
Version: 3.0014
Tags: patch

The 'show differences between two files' option doesn't work on the
first try, because the 'seen' flag on ucf/show_diff is initially true.

Until 3.0012, ucf/show_diff was reset just before showing
it to the user. This would unset the 'seen' flag properly.

However, moving the db_reset call after db_input made the
latter skip the note on the first time if the 'seen' flag
was already set.

To make things worse, Debconf::ConfModule::finish()
sets the 'seen' flag for all the questions it has handled
before exiting, so the flag was always true afterwards.

Simply unsetting the flag before db_input fixes this.

Proposed patch attached.
-- 
Niko Tyni   nt...@debian.org
>From 6f4fef4598a87493224ec2b4336c750377e37a2f Mon Sep 17 00:00:00 2001
From: Niko Tyni <nt...@debian.org>
Date: Wed, 4 Feb 2009 00:42:49 +0200
Subject: [PATCH] Show the differences on the first try

Until 3.0012, ucf/show_diff was reset just before showing
it to the user. This would unset the 'seen' flag properly.

However, moving the db_reset call after db_input made the
latter skip the note on the first time if the 'seen' flag
was already set.

To make things worse, Debconf::ConfModule::finish()
sets the 'seen' flag for all the questions it has handled
before exiting, so the flag was always true after debconf
exited.

Simply unsetting the flag before db_input fixes this.
---
 ucf |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/ucf b/ucf
index b2f60da..b679e8b 100755
--- a/ucf
+++ b/ucf
@@ -72,6 +72,7 @@ show_diff() {
 	templ=ucf/show_diff
 	db_capb escape
 	db_subst $templ DIFF "$(printf %s "$DIFF" | debconf-escape -e)"
+	db_fset $templ seen false
 	db_input critical $templ || true
 	db_go || true
 	db_get $templ
-- 
1.5.6.5

Reply via email to