Skip to content

use custom prefix when elevating privilages with check_priv() #42

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 1 commit into
base: master
Choose a base branch
from

Conversation

alex-free
Copy link

@alex-free alex-free commented Apr 30, 2025

When check_priv() re-executes the script with sudo using the arguments given to build-xenon-toolchain, it looses any custom set $PREFIX given to it originally. I.e., if you do PREFIX=/usr/local/custom build-xenon-toolchain toolchain, it will prompt for root privileges to be able to install into /usr/local/custom and then execute sudo build-xenon-toolchain toolchain automatically. This looses the given $PREFIX value and it will end up still installing to the default /usr/local/xenon because env vars are lost in in the sudo context. This specifies the $PREFIX variable during the sudo command as to not loose it and work as intended.

Edit: Also removed a redundant deletion of the priv_check file since it is known to not exist.

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.

1 participant