Skip to content
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

interp: make "type" builtin respect the current $PATH #503

Merged
merged 1 commit into from
Feb 13, 2020

Conversation

theclapp
Copy link
Sponsor Collaborator

@theclapp theclapp commented Feb 12, 2020

Fixes #502.

@theclapp
Copy link
Sponsor Collaborator Author

Regarding the locale change:

-	os.Setenv("LANGUAGE", "en_US.UTF8")
-	os.Setenv("LC_ALL", "en_US.UTF8")
+	os.Setenv("LANGUAGE", "en_US.UTF-8")
+	os.Setenv("LC_ALL", "en_US.UTF-8")

Without this change, I got failures galore. This didn't used to fail. I think it does now because I upgraded bash to 5.0.16 locally.

I looked at trying to install that locale, or copy the existing one, and came up (mostly) empty. All the UTF8 locales on my system are ...UTF-8 not ...UTF8. Copying the one to the other failed:

# in /usr/share/locale
% sudo cp -rp en_US.UTF-8 en_US.UTF8
cp: cannot create directory 'en_US.UTF8': Operation not permitted

Not sure what you can or should do about that. I assume the current "UTF8" code works for you and everybody else. 🤷‍♂

Copy link
Owner

@mvdan mvdan left a comment

Choose a reason for hiding this comment

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

Please add the "Fixes" to the commit, because that's what will remain in master. The PR body isn't really relevant.

os.Setenv("LANGUAGE", "en_US.UTF8")
os.Setenv("LC_ALL", "en_US.UTF8")
os.Setenv("LANGUAGE", "en_US.UTF-8")
os.Setenv("LC_ALL", "en_US.UTF-8")
Copy link
Owner

Choose a reason for hiding this comment

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

I agree this is a good change. Not sure why the old version worked. I think it was a typo of mine.

interp/interp_test.go Outdated Show resolved Hide resolved
@theclapp
Copy link
Sponsor Collaborator Author

Done. PTAL.

@mvdan mvdan merged commit 7459568 into mvdan:master Feb 13, 2020
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.

interp: "type" does not respect $PATH if it's set within the shell
2 participants