Skip to content

base-files: fix /etc/profile call to unset appendpath#54105

Closed
NyaaaWhatsUpDoc wants to merge 1 commit intovoid-linux:masterfrom
NyaaaWhatsUpDoc:fix-etc-profile
Closed

base-files: fix /etc/profile call to unset appendpath#54105
NyaaaWhatsUpDoc wants to merge 1 commit intovoid-linux:masterfrom
NyaaaWhatsUpDoc:fix-etc-profile

Conversation

@NyaaaWhatsUpDoc
Copy link
Copy Markdown
Contributor

@NyaaaWhatsUpDoc NyaaaWhatsUpDoc commented Jan 25, 2025

Testing the changes

  • I tested the changes in this PR: YES

Have confirmed this behaviour of unset in bash, mksh and dash myself. And to quote the unset section of the manpage for sh:

     unset [-fv] name ...
            The specified variables and functions are unset and unexported.
            If -f or -v is specified, the corresponding function or variable
            is unset, respectively.  If a given name corresponds to both a
            variable and a function, and no options are given, only the
            variable is unset.

@classabbyamp classabbyamp added the core core package label Jan 25, 2025
@mtboehlke
Copy link
Copy Markdown
Contributor

mtboehlke commented Jan 27, 2025

Thanks for bringing this up. Imho I think this is a good change for consistent behavior across multiple shells.

I actually made this change a while ago on my machine (and even made a noextract entry for /etc/profile), but kind of forgot about it. I use oksh as the login shell, which is why I think I noticed it at all. From what I can tell, bash will happily unset the function even without the -f flag, as long as there isn't a variable with the same name. The man page makes it sound like maybe that's what dash will do as well, but I don't think that's true. At least oksh and dash seem to require -f to unset a function.

@github-actions
Copy link
Copy Markdown

Pull Requests become stale 90 days after last activity and are closed 14 days after that. If this pull request is still relevant bump it or assign it.

@github-actions github-actions bot added the Stale label Apr 28, 2025
@github-actions github-actions bot closed this May 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core core package Stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants