summaryrefslogtreecommitdiff
path: root/ucf
diff options
context:
space:
mode:
authorManoj Srivastava <srivasta@golden-gryphon.com>2013-04-24 01:42:31 -0700
committerManoj Srivastava <srivasta@golden-gryphon.com>2013-04-24 01:42:31 -0700
commitbeb2c4da0730889c06a31a4d3754a680440c48e6 (patch)
tree3f4972b85cc7ec0aede1d74b37fd62edb1544ab3 /ucf
parent89c47b102dd943b9814fa4ff3393487a95282e30 (diff)
[upstream]: ucf fails when VERBOSE is set to 1 in /etc/ucf.conf
ucf fails with error code 20 when VERBOSE is set to 1 in /etc/ucf.conf. Actually it is debconf's /usr/share/debconf/confmodule which fails and subsequently topples ucf. The problem seems to be, that some of the messages in ucf are written to stdout instead of stderr, which confuses confmodule's function _db_cmd when reading _db_internal_line. I believe the same is true when DEBUG is set > 0 in ucf.conf, but I had no time to test it in more detail. Fix thanks to Aljoscha Lautenbach <aljoscha.lautenbach@gmail.com> Signed-off-by: Manoj Srivastava <srivasta@golden-gryphon.com>
Diffstat (limited to 'ucf')
-rwxr-xr-xucf16
1 files changed, 8 insertions, 8 deletions
diff --git a/ucf b/ucf
index 01eea3b..9ae0429 100755
--- a/ucf
+++ b/ucf
@@ -159,8 +159,8 @@ purge_md5sum () {
if [ "X$docmd" = "XYES" ]; then
set +e
if [ "X$VERBOSE" != "X" ]; then
- echo "egrep -v [[:space:]]${safe_dest_file}$ $statedir/hashfile"
- egrep -v "[[:space:]]${safe_dest_file}$" "$statedir/hashfile" \
+ echo >&2 "egrep -v [[:space:]]${safe_dest_file}$ $statedir/hashfile"
+ egrep -v "[[:space:]]${safe_dest_file}$" "$statedir/hashfile" >&2 \
|| true;
fi
#echo "egrep -v [[:space:]]${safe_dest_file}$ $statedir/hashfile"
@@ -174,7 +174,7 @@ purge_md5sum () {
set -e
fi
fi
- test -n "$VERBOSE" && echo "The cache file is $cached_file"
+ test -n "$VERBOSE" && echo >&2 "The cache file is $cached_file"
if [ ! -z "$cached_file" -a -f "$statedir/cache/$cached_file" ]; then
$action rm -f "$statedir/cache/$cached_file"
fi
@@ -201,9 +201,9 @@ replace_md5sum () {
if [ "X$docmd" = "XYES" ]; then
set +e
if [ "X$VERBOSE" != "X" ]; then
- echo "(egrep -v \"[[:space:]]${safe_dest_file}$\" \"$statedir/hashfile\";"
- egrep -v "[[:space:]]${safe_dest_file}$" "$statedir/hashfile" || true;
- md5sum "$orig_new_file" | sed "s|$orig_new_file|$dest_file|" ;
+ echo >&2 "(egrep -v \"[[:space:]]${safe_dest_file}$\" \"$statedir/hashfile\";"
+ egrep -v "[[:space:]]${safe_dest_file}$" "$statedir/hashfile" >&2 || true;
+ md5sum "$orig_new_file" | sed "s|$orig_new_file|$dest_file|" >&2;
fi
egrep -v "[[:space:]]${safe_dest_file}$" "$statedir/hashfile" > \
"$statedir/hashfile.tmp" || true;
@@ -517,8 +517,8 @@ fi
if [ -e "$statedir/hashfile" ]; then
if [ "X$VERBOSE" != "X" ]; then
echo >&2 "The hash file exists"
- echo egrep "[[:space:]]${safe_dest_file}$" "$statedir/hashfile"
- egrep "[[:space:]]${safe_dest_file}$" "$statedir/hashfile" || true
+ echo >&2 egrep "[[:space:]]${safe_dest_file}$" "$statedir/hashfile"
+ egrep "[[:space:]]${safe_dest_file}$" "$statedir/hashfile" >&2 || true
fi
lastsum=$(egrep "[[:space:]]${safe_dest_file}$" "$statedir/hashfile" | \
awk '{print $1;}' )