-
Notifications
You must be signed in to change notification settings - Fork 154
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: document kas-container command
The kas-container script is the last undocumented tool of the kas suite. To change this, we add a page in the html documentation and a manpage. As the kas-container script is written in bash, the sphinx-build automodule plugin cannot be used to extract the parameters. To work around this, we run the kas-container script during the docs build, extract the usage information and massage that a bit to be RST compliant (and look nice). Then, the generated files are included in the documentation templates. As the kas-container docs are generated on the fly, we also must ignore missing-files errors (D000 Problems with "include" directive path) when statically checking the doc tree with doc8. Signed-off-by: Felix Moessbauer <[email protected]> Signed-off-by: Jan Kiszka <[email protected]>
- Loading branch information
1 parent
f6ba12b
commit 12add6c
Showing
9 changed files
with
109 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
:orphan: | ||
|
||
kas-container manpage | ||
===================== | ||
|
||
.. include:: ../_build/kas-container-usage-synopsis.inc | ||
|
||
DESCRIPTION | ||
----------- | ||
|
||
.. include:: ../userguide/kas-container-description.inc | ||
|
||
.. include:: ../_build/kas-container-usage-options.inc | ||
|
||
SEE ALSO | ||
-------- | ||
|
||
:manpage:`kas(1)`, | ||
|
||
.. include:: _kas-man-footer.inc | ||
|
||
.. |SYNOPSIS| replace:: SYNOPSIS | ||
.. |OPTIONS| replace:: OPTIONS | ||
.. |KAS-COMMANDS| replace:: KAS-CONTAINER COMMANDS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
The ``kas-container`` script is a wrapper to run `kas` inside a build container. | ||
It gives fine grained control over the data that is mapped into the build and | ||
decouples the build environment from the host system. The wrapper also takes care of | ||
mounting the necessary directories and setting up the environment variables. | ||
|
||
As container backends, Docker and Podman are supported. | ||
To force the use of podman over docker, set ``KAS_CONTAINER_ENGINE=podman``. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
Building in a Container | ||
======================= | ||
|
||
.. include:: kas-container-description.inc | ||
|
||
.. include:: ../_build/kas-container-usage-synopsis.inc | ||
|
||
.. include:: ../_build/kas-container-usage-options.inc | ||
|
||
.. |SYNOPSIS| replace:: Synopsis | ||
.. |OPTIONS| replace:: Options | ||
.. |KAS-COMMANDS| replace:: kas-container Commands |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!/bin/sh | ||
# | ||
# kas - setup tool for bitbake based projects | ||
# | ||
# Copyright (c) Siemens AG, 2024 | ||
# | ||
# Authors: | ||
# Felix Moessbauer <[email protected]> | ||
# | ||
# Permission is hereby granted, free of charge, to any person obtaining a copy | ||
# of this software and associated documentation files (the "Software"), to deal | ||
# in the Software without restriction, including without limitation the rights | ||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
# copies of the Software, and to permit persons to whom the Software is | ||
# furnished to do so, subject to the following conditions: | ||
# | ||
# The above copyright notice and this permission notice shall be | ||
# included in all copies or substantial portions of the Software. | ||
# | ||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
# SOFTWARE. | ||
|
||
# Extract the usage information of kas-container and convert it to rst | ||
# to be included in the documentation. | ||
|
||
cat - | \ | ||
sed 's/^Usage:/|SYNOPSIS|\n----------\n/g' | \ | ||
sed -e 's/^\s*kas-container /| kas-container /g' | \ | ||
# unwrap long lines | ||
perl -0pe 's/\n\s\s+/ /g' | \ | ||
sed 's/^Positional arguments:/|KAS-COMMANDS|\n--------------/g' | \ | ||
# each commands starts with a new line | ||
sed -r 's/^(build|checkout|dump|shell|for-all-repos|clean|cleansstate|cleanall|menu)\t\t*(.*)$/:\1: \2/g' | \ | ||
sed 's/^Optional arguments:/|OPTIONS|\n---------/g' | \ | ||
sed '/^You can force/d' | \ | ||
cat |