Fix install-guides build in Mac OS X

In Mac OS X environment, the actual behavior of grep command
with "-m" option is different from the expected behavior.

Instead of using "-m 1" option, adding one pipeline
with "head -n 6" (since "-A 5" looks after 5 lines more)
makes the build compatible not only Linux but also
Mac OS X environment.

Change-Id: I63fc0fd0c8afde883ffaf69c9b674c88d8079014
Closes-Bug: #1619358
This commit is contained in:
Ian Y. Choi 2016-09-02 00:35:23 +09:00
parent c11731711f
commit 6cb3801396
1 changed files with 2 additions and 2 deletions

View File

@ -34,8 +34,8 @@ for tag in $TAGS; do
# only directive, replace title directive with the proper title
# for each distribution to set the title explicitly.
title=$(grep -m 1 -A 5 "^.. only:: ${tag}" ${INDEX} | \
sed -n 4p | sed -e 's/^ *//g')
title=$(grep -A 5 "^.. only:: ${tag}" ${INDEX} | \
head -n 6 | sed -n 4p | sed -e 's/^ *//g')
sed -i -e "s/\.\. title::.*/.. title:: ${title}/" ${INDEX}
# Build the guide