summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbdrewery <bdrewery@FreeBSD.org>2015-09-29 21:45:23 +0000
committerbdrewery <bdrewery@FreeBSD.org>2015-09-29 21:45:23 +0000
commit8808238003f034527c55b2885df5fabd123dd39d (patch)
tree57f23949081b51bc9fc4ebfb8e0649b2b20aa375
parentdef912bcea8838f725144d10af5c7d6df6162fe1 (diff)
downloadFreeBSD-src-8808238003f034527c55b2885df5fabd123dd39d.zip
FreeBSD-src-8808238003f034527c55b2885df5fabd123dd39d.tar.gz
MFC r287935:
Optimize makeman slightly by removing uneeded cat and extra test -s.
-rwxr-xr-xtools/build/options/makeman16
1 files changed, 9 insertions, 7 deletions
diff --git a/tools/build/options/makeman b/tools/build/options/makeman
index 00309d9..0491bed 100755
--- a/tools/build/options/makeman
+++ b/tools/build/options/makeman
@@ -59,7 +59,7 @@ show_options()
fi
done
- cat $t/settings | while read opt targets ; do
+ while read opt targets ; do
if [ "${targets}" = "${ALL_TARGETS}" ] ; then
echo "WITHOUT_${opt}"
elif [ -z "${targets}" ] ; then
@@ -68,7 +68,7 @@ show_options()
echo "WITHOUT_${opt}" $(no_targets "${ALL_TARGETS}" "${targets}")
echo "WITH_${opt} ${targets}"
fi
- done
+ done < $t/settings
}
#
@@ -250,31 +250,33 @@ EOF
:> $t/deps2
fi
+ havedeps=0
if [ -s $t/deps ] ; then
+ havedeps=1
echo 'When set, it also enforces the following options:'
echo '.Pp'
echo '.Bl -item -compact'
- cat $t/deps | while read opt2 ; do
+ while read opt2 ; do
echo '.It'
echo ".Va ${opt2}"
- done
+ done < $t/deps
echo '.El'
fi
if [ -s $t/deps2 ] ; then
- if [ -s $t/deps ] ; then
+ if [ ${havedeps} -eq 1 ] ; then
echo '.Pp'
fi
echo 'When set, the following options are also in effect:'
echo '.Pp'
echo '.Bl -inset -compact'
- cat $t/deps2 | while read opt2 ; do
+ while read opt2 ; do
echo ".It Va ${opt2}"
noopt=$(echo ${opt2} | sed -e's/WITH_/WITHOUT_/;t' -e's/WITHOUT_/WITH_/')
echo '(unless'
echo ".Va ${noopt}"
echo 'is set explicitly)'
- done
+ done < $t/deps2
echo '.El'
fi
twiddle >&2
OpenPOWER on IntegriCloud