Skip to content

Call temporary script with /bin/sh.#1203

Merged
gouttegd merged 1 commit intomasterfrom
fix-run-sh-update
Mar 28, 2025
Merged

Call temporary script with /bin/sh.#1203
gouttegd merged 1 commit intomasterfrom
fix-run-sh-update

Conversation

@gouttegd
Copy link
Contributor

The idea behind using $SHELL when calling the temporary run.sh script (when running an update_repo command) was to make sure the temporary script is executed using the same shell as the one that is currently running the original run.sh script.

But it turns out, that is not reliable. The $SHELL variable may be set to the full pathname of the currently running shell, but not always -- it may also be set to the login shell of the current user, which may very well be different from the shell used to call the run.sh script.

So let's always use /bin/sh instead. It is guaranteed to always be there, and that is already the shell that should be used to run the run.sh script (that's the shell set in the script's shebang line).

closes #1202

The idea behind using `$SHELL` when calling the temporary run.sh script
(when running an update_repo command) was to make sure the temporary
script is executed using the *same shell* as the one that is currently
running the original run.sh script.

But it turns out, that is not reliable. The `$SHELL` variable _may_ be
set to the full pathname of the currently running shell, but not always
-- it may also be set to the _login shell_ of the current user, which
may very well be different from the shell used to call the run.sh
script.

So let's always use `/bin/sh` instead. It is guaranteed to always be
there, and that is already the shell that should be used to run the
run.sh script (that's the shell set in the script's shebang line).

closes #1202
@gouttegd gouttegd self-assigned this Mar 28, 2025
@gouttegd gouttegd requested a review from matentzn March 28, 2025 11:13
Copy link
Contributor

@matentzn matentzn left a comment

Choose a reason for hiding this comment

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

I know this will work, I dont feel competent to judge any other potential consequences of this change.

@gouttegd gouttegd merged commit 4af4c9d into master Mar 28, 2025
1 check passed
@gouttegd gouttegd deleted the fix-run-sh-update branch March 28, 2025 12:37
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.

Problems with update_repo in 1.6 when using run.sh

2 participants