-
Notifications
You must be signed in to change notification settings - Fork 671
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Integrate manpage with CMake better #10624
Conversation
Skipping CI for Draft Pull Request. |
CMakeLists.txt
Outdated
@@ -26,6 +26,7 @@ set(SSG_CONTENT_INSTALL_DIR "${CMAKE_INSTALL_DATADIR}/xml/scap/ssg/content") | |||
set(SSG_GUIDE_INSTALL_DIR "${CMAKE_INSTALL_DOCDIR}/guides") | |||
set(SSG_TABLE_INSTALL_DIR "${CMAKE_INSTALL_DOCDIR}/tables") | |||
set(SSG_ANSIBLE_ROLE_INSTALL_DIR "${CMAKE_INSTALL_DATADIR}/scap-security-guide/ansible") | |||
set(SSG_ANSIBLE_PER_RULE_PLAYBOOKS_ISNTALL_DIR "${SSG_ANSIBLE_ROLE_INSTALL_DIR}/rule_playbooks") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo
cmake/SSGCommon.cmake
Outdated
@@ -79,7 +79,7 @@ endmacro() | |||
macro(ssg_build_man_page) | |||
add_custom_command( | |||
OUTPUT "${CMAKE_BINARY_DIR}/scap-security-guide.8" | |||
COMMAND env "PYTHONPATH=$ENV{PYTHONPATH}" "${PYTHON_EXECUTABLE}" "${SSG_BUILD_SCRIPTS}/generate_man_page.py" --template "${CMAKE_SOURCE_DIR}/docs/man_page_template.jinja" --input_dir "${CMAKE_BINARY_DIR}" --output "${CMAKE_BINARY_DIR}/scap-security-guide.8" | |||
COMMAND env "PYTHONPATH=$ENV{PYTHONPATH}" "${PYTHON_EXECUTABLE}" "${SSG_BUILD_SCRIPTS}/generate_man_page.py" --template "${CMAKE_SOURCE_DIR}/docs/man_page_template.jinja" --input_dir "${CMAKE_BINARY_DIR}" --output "${CMAKE_BINARY_DIR}/scap-security-guide.8" --install-prefix "${CMAKE_INSTALL_PREFIX}" --separate-scap-files "${SSG_SEPARATE_SCAP_FILES_ENABLED}:${SSG_CONTENT_INSTALL_DIR}" --profile-bash "${SSG_BASH_SCRIPTS_ENABLED}:${SSG_BASH_ROLE_INSTALL_DIR}" --profile-ansible "${SSG_ANSIBLE_PLAYBOOKS_ENABLED}:${SSG_ANSIBLE_ROLE_INSTALL_DIR}" --ansible-per-rule "${SSG_ANSIBLE_PLAYBOOKS_PER_RULE_ENABLED}:${SSG_ANSIBLE_PER_RULE_PLAYBOOKS_ISNTALL_DIR}" --kickstarts "ON:${SSG_KICKSTART_INSTALL_DIR}" --tailoring "ON:${SSG_TAILORING_INSTALL_DIR}" --content-path "${SSG_CONTENT_INSTALL_DIR}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
inconsistent indentation
.RS | ||
Contains delta tailoring, whatever that means. | ||
.RE | ||
{{%- endif %}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you considered dropping the 2 sections about deployment below?
docs/man_page_template.jinja
Outdated
{{% if tailoring_path -%}} | ||
.I {{{ install_prefix }}}/{{{ tailoring_path }}}/ | ||
.RS | ||
Contains delta tailoring, whatever that means. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't a good text for a man page. The man page should provide specific information. I propose:
Contains tailoring files that enable rules that are not covered by third-party SCAP content and disables rules that are covered by the content shipped in scap-security-guide.
build-scripts/generate_man_page.py
Outdated
substitution_dicts = {"products": all_products} | ||
substitution_dicts = dict( | ||
products=all_products, | ||
content_path=args.content_path, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be possible to handle also these items by parse_arguments_into_dict
as well?
Pass the build information to the script that generates the manpage from the template to - use CMake paths, and to - leave out info about artifacts that are not built.
The text may make sense, but it should not be in an upstream project. Regulations like these should be maintained and supplied by institutions where the project is used, and should not be visible to the upstream general public.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have build and reviewed the generated manual page.
I like the proposed changes very much. It's a great improvement!
I have some fresh new ideas:
- You can modernize the example in the examples section by showcasing the usage of the
--results-arf
option instead of the--results
and--oval-results
. - you can link the project repo instead of the wiki
- we sometimes incorrectly use "datastream" or other misspelled variants, we should always use "data stream"
Feel free to apply the ideas or mark the PR as ready to review.
Code Climate has analyzed commit bc2a32a and detected 0 issues on this pull request. The test coverage on the diff in this pull request is 100.0% (50% is the threshold). This pull request will bring the total coverage in the repository to 52.8%. View more on Code Climate. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have seen the generated man page for rhel8.
Thank you.
Pass the build information to the script that generates the manpage from the template to
Left to do:
Rationale:
Review Hints: