Show whether generated setup.h files changed or not

Don't output "ok" for all files when running update-setup-h, this was
not very informative and possibly misleading. Only show "ok" for the
actually updated files and "unchanged" otherwise.
This commit is contained in:
Vadim Zeitlin
2020-07-14 20:24:52 +02:00
parent e95ff829ef
commit 5bf7db419a

View File

@@ -65,15 +65,21 @@ update_single_setup_h()
tmp=$i.$$.tmp tmp=$i.$$.tmp
sed -e "/^\/\* --- start $section options --- \*\/\$/q" $1 > $tmp && sed -e "/^\/\* --- start $section options --- \*\/\$/q" $1 > $tmp &&
cat_common_options_for $setup_inc $1 >> $tmp && cat_common_options_for $setup_inc $1 >> $tmp &&
sed -n -e "/^\/\* --- end $section options --- \*\/\$/,\$p" $1 >> $tmp && sed -n -e "/^\/\* --- end $section options --- \*\/\$/,\$p" $1 >> $tmp
mv $tmp $1
if [ $? -ne 0 ]; then if cmp -s $1 $tmp; then
msg " FAILED" rm $tmp
error "$0: failed to update file $1" msg " unchanged"
rc=2
else else
msg " ok" mv $tmp $1
if [ $? -ne 0 ]; then
msg " FAILED"
error "$0: failed to update file $1"
rc=2
else
msg " ok"
fi
fi fi
} }