Remove doc fragments with sed oneliner
This commit is contained in:
parent
7d7acf657f
commit
df519d40e3
@ -388,27 +388,19 @@ for module in "${!module_map[@]}"; do
|
|||||||
if [ ! -f $moduledir/$module ]; then
|
if [ ! -f $moduledir/$module ]; then
|
||||||
moduledir=.external/community/general/plugins/modules/files
|
moduledir=.external/community/general/plugins/modules/files
|
||||||
fi
|
fi
|
||||||
module_target=$role/library/$module
|
cp -pL $moduledir/$module $role/library/$module
|
||||||
cp -pL $moduledir/$module $module_target
|
ls -alrtF $role/library/$module
|
||||||
ls -alrtF $module_target
|
|
||||||
sed -i -e ':a;N;$!ba;s/description:\n\( *\)/description:\n\1- WARNING: Do not use this module directly! It is only for role internal use.\n\1/' $role/library/$module
|
sed -i -e ':a;N;$!ba;s/description:\n\( *\)/description:\n\1- WARNING: Do not use this module directly! It is only for role internal use.\n\1/' $role/library/$module
|
||||||
|
|
||||||
# Remove doc_fragments from vendored modules
|
# Remove doc_fragments
|
||||||
if grep -q extends_documentation_fragment $module_target; then
|
sed -i '/^extends_documentation_fragment:/,/^[^ -]/{/^extends/d;/^[ -]/d}' $role/library/$module
|
||||||
top_line=$(grep extends_documentation_fragment $module_target -n | cut -d":" -f1)
|
|
||||||
bottom_line=$((top_line+1))
|
|
||||||
# While $bottom_line is still in the extends_documentation_fragment yaml list
|
|
||||||
while sed -n ${bottom_line}p $module_target | grep '\-\s' > /dev/null; do
|
|
||||||
rm_lines="$top_line,$bottom_line"
|
|
||||||
bottom_line=$((bottom_line+1))
|
|
||||||
done
|
|
||||||
sed -i "${rm_lines}d" $module_target
|
|
||||||
fi
|
|
||||||
done
|
done
|
||||||
|
|
||||||
# Fix until the updated redhat_subscription.py is in community.general
|
# Fix until the updated redhat_subscription.py is in community.general
|
||||||
cp %{SOURCE2301} rhc/library/redhat_subscription.py
|
cp %{SOURCE2301} rhc/library/redhat_subscription.py
|
||||||
sed -i -e ':a;N;$!ba;s/description:\n\( *\)/description:\n\1- WARNING: Do not use this module directly! It is only for role internal use.\n\1/' rhc/library/redhat_subscription.py
|
sed -i -e ':a;N;$!ba;s/description:\n\( *\)/description:\n\1- WARNING: Do not use this module directly! It is only for role internal use.\n\1/' rhc/library/redhat_subscription.py
|
||||||
|
# Remove doc_fragments
|
||||||
|
sed -i '/^extends_documentation_fragment:/,/^[^ -]/{/^extends/d;/^[ -]/d}' rhc/library/redhat_subscription.py
|
||||||
|
|
||||||
# containers.podman:
|
# containers.podman:
|
||||||
# - library:
|
# - library:
|
||||||
|
Loading…
Reference in New Issue
Block a user