tools: fix comparison to see if sudo test is needed in install-*.sh#6771
tools: fix comparison to see if sudo test is needed in install-*.sh#6771TravisEz13 merged 4 commits intoPowerShell:masterfrom
Conversation
tools/installpsh-debian.sh
Outdated
|
|
||
| #Check that sudo is available | ||
| if [[ "$SUDO" -eq "sudo" && ! ("'$*'" =~ skip-sudo-check) ]]; then | ||
| if [[ $EUID != 0 && "$SUDO" -eq "sudo" && ! ("'$*'" =~ skip-sudo-check) ]]; then |
There was a problem hiding this comment.
Should we use the same pattern as in installpsh-redhat.sh?
There was a problem hiding this comment.
The sudo check should be equivalent because we only set $SUDO to sudo if $EUID != 0
There was a problem hiding this comment.
verified... there is an error in the conditional... change "$SUDO" -eq "sudo" to "$SUDO" == "sudo" and remove your change
tools/installpsh-debian.sh
Outdated
|
|
||
| #Check that sudo is available | ||
| if [[ "$SUDO" -eq "sudo" && ! ("'$*'" =~ skip-sudo-check) ]]; then | ||
| if [[ $EUID != 0 && "$SUDO" -eq "sudo" && ! ("'$*'" =~ skip-sudo-check) ]]; then |
There was a problem hiding this comment.
The sudo check should be equivalent because we only set $SUDO to sudo if $EUID != 0
tools/installpsh-debian.sh
Outdated
|
|
||
| #Check that sudo is available | ||
| if [[ "$SUDO" -eq "sudo" && ! ("'$*'" =~ skip-sudo-check) ]]; then | ||
| if [[ $EUID != 0 && "$SUDO" -eq "sudo" && ! ("'$*'" =~ skip-sudo-check) ]]; then |
There was a problem hiding this comment.
verified... there is an error in the conditional... change "$SUDO" -eq "sudo" to "$SUDO" == "sudo" and remove your change
|
Just pushed the requested update |
|
@bjh7242 My changes triggered the code complexity rules (code across multiple files) that mean you need to sign the CLA? Would you mind signing? |
|
I updated your PR title and summary based on the current change |
|
FYI, this answer explains what was going on. |
|
@bjh7242 I have asked for help with CLA. I'll get back to you when I get an answer. |
|
@bjh7242 Thank you so much for reporting this. I just fixed the CLA system. Could you give it a try again? |
|
Just signed it, let me know if you need anything else from me. Thanks! |
|
@bjh7242 Thanks for your contribution. |

PR Summary
The comparison to test if we were using
sudowas failing when running as root. We would then run-v, and get a bad error message. fixing the comparison.PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright headerWIP:to the beginning of the title and remove the prefix when the PR is ready.[feature]if the change is significant or affects feature tests