summaryrefslogtreecommitdiff
path: root/ucf
diff options
context:
space:
mode:
authorManoj Srivastava <srivasta@debian.org>2008-09-02 21:14:46 -0500
committerManoj Srivastava <srivasta@debian.org>2008-09-02 21:14:46 -0500
commit64eccdd475d87c662368d2dc4969851f721621cd (patch)
treee1a4996d1ac99d1bf8e6b8ba6edc4bee9971ec31 /ucf
parent99216017cb7d7305fa5bdf5099ccf2dd5c513b52 (diff)
Handle exceptional sizes of diff output
With large output of diff or sdiff, the pipe buffers used to communicate with debconf fill up. So now we limit the maximu size to jusr under 100k. Also, we were unable to handle whitespace only differences (which show up empty); this change fixes that too. Signed-off-by: Manoj Srivastava <srivasta@debian.org>
Diffstat (limited to 'ucf')
-rwxr-xr-xucf10
1 files changed, 7 insertions, 3 deletions
diff --git a/ucf b/ucf
index 22ffb7d..a20f3c0 100755
--- a/ucf
+++ b/ucf
@@ -60,10 +60,14 @@ setq() {
# Use debconf to show the differences
show_diff() {
if [ -z "$1" ]; then
- echo >&2 "need a diff as argument"
- exit 1;
+ DIFF="There are no non-white space differences in the files."
+ else
+ if [ 99999 -lt $(echo $l | wc -c | awk '{print $1; }') ]; then
+ DIFF="The differences between the files are too large to display."
+ else
+ DIFF="$1"
+ fi
fi
- DIFF="$1"
if [ "$DEBCONF_OK" = "YES" ] && [ "$DEBIAN_HAS_FRONTEND" ]; then
templ=ucf/show_diff
db_capb escape