Skip to content

Add comments to autogen script #13961

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

Merged
merged 5 commits into from
Jul 23, 2025

Conversation

altxtech
Copy link
Contributor

@altxtech altxtech commented Jul 19, 2025

Context

Was trying to understand how the build process works and found the autogen script hard to interpret.

Changes

  • Added some explanatory comments
  • Some formatting adjustments

@nobu
Copy link
Member

nobu commented Jul 19, 2025

Could you tell what was hard to you?

necessary evil for bash scripts

This file is a plain shell script, not a bash script.

@altxtech
Copy link
Contributor Author

altxtech commented Jul 19, 2025

For example, in the first part

case "$0" in
*/*) srcdir=`dirname $0`;;
*) srcdir="";;
esac

$0 --> Name of the script being run. Something I knew, but needed a few seconds to remember
*/* --> Pattern matching looking for slash. Didn't know what that was. Had to google it.

From there I understood here we are checking whether the script was called from a path or not. But it was not obvious.

@nobu
Copy link
Member

nobu commented Jul 22, 2025

For example, in the first part

case "$0" in
*/*) srcdir=`dirname $0`;;
*) srcdir="";;
esac

$0 --> Name of the script being run. Something I knew, but needed a few seconds to remember / --> Pattern matching looking for slash. Didn't know what that was. Had to google it.

From there I understood here we are checking whether the script was called from a path or not. But it was not obvious.

I thought it was a very common idiom as sh scripts.
OK, it'd be good to add comments.

@altxtech
Copy link
Contributor Author

@nobu

Some comments already help a lot.
Removed the wrapper functions so the original script is not changed too radically.

@nobu nobu force-pushed the altxtech/make-autogen-readable branch from 599488e to f6d5034 Compare July 23, 2025 10:21
@nobu nobu changed the title Make autogen script more readable Add comments to autogen script Jul 23, 2025
@nobu nobu enabled auto-merge (squash) July 23, 2025 10:22
@nobu nobu merged commit 8522180 into ruby:master Jul 23, 2025
82 of 84 checks passed
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.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy