Skip to content

Make autogen script more readable #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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

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.

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