Skip to content
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

Add support for macOS #20

Merged
merged 2 commits into from
Nov 25, 2023
Merged

Add support for macOS #20

merged 2 commits into from
Nov 25, 2023

Conversation

nodeg
Copy link
Member

@nodeg nodeg commented Nov 17, 2023

This adds support for macOS by using gnu-getopt. Tested on macOS 14.1 (Sonoma). This requires the package gnu-getopt that can be installed via Homebrew with brew install gnu-getopt.

Fixes #8

When using this works. Since the default shell on macOS is zsh, this is fine for now. With the fish shell, there are still problems with regard to getopt.

❯ zsh
dom@mbook-dom uyuni-docs-helper % ./uyuni-docs-helper
[ERROR] Incorrect syntax: -c is mandatory (use uyuni-docs-helper -h for help)

dom@mbook-dom uyuni-docs-helper % ./uyuni-docs-helper -h

Build the Uyuni doc using a container and (optionally) serve it for verification via HTTP

Syntax:

uyuni-docs-helper <ARGUMENTS>

Mandatory arguments:

-p|--product <uyuni|suma>   Build the documentation for either Uyuni or SUSE Manager
-c|--command <make command> Use the desired command to build html/pdf, html&pdf, etc...
                            for example: 'all-uyuni'. You can use 'help' to list all
                            possible commands. Be aware you still need to specify
                            one source for this to work

uyuni-docs-helper can build documentation from two sources. Different parameters apply for each case.
If both a local git repository and a remote git repository are specified, the local git
repository is used

Remote Git repository:
-g|--gitrepo <REPOSITORY> A path to a HTTP git repository where the code for the
                          documentation is.
                          If the value does not start with 'https://'
                          then the value is considered as a GitHUb user/organization and
                          the URL in the form https://github.com/<REPOSITORY>/uyuni-docs.git
                          will be used
                          If not specified at all, the default value will be
                          https://github.com/uyuni-project/uyuni-docs.git
-r|--gitref <REFERENCE>   A git branch (master by default)
-o|--output <PATH>        An existing path to store the output of the build. A directory
                          'build' will be created inside. Optional

Local Git repository:
-l|--localclone <GIT_CLONE> A path to a local git repository. The output of the build will
                            be placed inside this path as a 'build' directory

Optional arguments:
-t|--tag                 Use a secific tag for the container image. Can be useful if you
                         want to build an old documentation using an old version of the
                         toolchain. (latest used by default)
-s|--serve               Start a HTTP server at the end of the build so the
                         documentation can be inspected (disabled by default)

dom@mbook-dom uyuni-docs-helper % ./uyuni-docs-helper --help

Build the Uyuni doc using a container and (optionally) serve it for verification via HTTP

Syntax:

uyuni-docs-helper <ARGUMENTS>

Mandatory arguments:

-p|--product <uyuni|suma>   Build the documentation for either Uyuni or SUSE Manager
-c|--command <make command> Use the desired command to build html/pdf, html&pdf, etc...
                            for example: 'all-uyuni'. You can use 'help' to list all
                            possible commands. Be aware you still need to specify
                            one source for this to work

uyuni-docs-helper can build documentation from two sources. Different parameters apply for each case.
If both a local git repository and a remote git repository are specified, the local git
repository is used

Remote Git repository:
-g|--gitrepo <REPOSITORY> A path to a HTTP git repository where the code for the
                          documentation is.
                          If the value does not start with 'https://'
                          then the value is considered as a GitHUb user/organization and
                          the URL in the form https://github.com/<REPOSITORY>/uyuni-docs.git
                          will be used
                          If not specified at all, the default value will be
                          https://github.com/uyuni-project/uyuni-docs.git
-r|--gitref <REFERENCE>   A git branch (master by default)
-o|--output <PATH>        An existing path to store the output of the build. A directory
                          'build' will be created inside. Optional

Local Git repository:
-l|--localclone <GIT_CLONE> A path to a local git repository. The output of the build will
                            be placed inside this path as a 'build' directory

Optional arguments:
-t|--tag                 Use a secific tag for the container image. Can be useful if you
                         want to build an old documentation using an old version of the
                         toolchain. (latest used by default)
-s|--serve               Start a HTTP server at the end of the build so the
                         documentation can be inspected (disabled by default)
dom@mbook-dom uyuni-docs-helper %

This adds support for macOS by using gnu-getopt. Tested on macOS 14.1
(Sonoma). This requires the package gnu-getopt that can be installed via
Homebrew with `brew install gnu-getopt`.

Fixes uyuni-project#8
@nodeg nodeg mentioned this pull request Nov 23, 2023
@juliogonzalez juliogonzalez self-requested a review November 23, 2023 16:29
Copy link
Member

@juliogonzalez juliogonzalez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some small fixes required, but in general LGTM :-)

Signed-off-by: Dominik Gedon <[email protected]>
@nodeg nodeg requested a review from juliogonzalez November 24, 2023 12:07
Copy link
Member

@juliogonzalez juliogonzalez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nodeg
Copy link
Member Author

nodeg commented Nov 24, 2023

Thank you, Julio. I do not have write access necessary for merging, so I rely on you here 😉

@juliogonzalez
Copy link
Member

Thank you, Julio. I do not have write access necessary for merging, so I rely on you here 😉

Seems the rights for the repository were not right, so I fixed them.

You should now be able to merge, can you try?

@nodeg nodeg merged commit f196364 into uyuni-project:main Nov 25, 2023
@nodeg nodeg deleted the support_macos branch November 25, 2023 10:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Does not work under macOS
2 participants