FS#66339 - [java-runtime-common] ash profile script doesn't check if $PATH variable contains jvm path
Attached to Project:
Arch Linux
Opened by Jakub Nowak (MrQubo) - Tuesday, 21 April 2020, 14:55 GMT
Last edited by freswa (frederik) - Wednesday, 18 January 2023, 17:34 GMT
Opened by Jakub Nowak (MrQubo) - Tuesday, 21 April 2020, 14:55 GMT
Last edited by freswa (frederik) - Wednesday, 18 January 2023, 17:34 GMT
|
Details
Description:
The `profile_jre.sh` script adds new path to the $PATH env variable but it doesn't check if this path isn't already there. The `profile_jre.csh` doesn't check this as well. Note that `/etc/profile` from `core/filesystem` (https://git.archlinux.org/svntogit/packages.git/tree/trunk/profile?h=packages/filesystem&id=b436e401c6b2115110b99b679d386b4da2ec192f) does this properly using `appendpath()`. I'm using tmux and the jvm path ends up in $PATH twice. |
This task depends upon
Closed by freswa (frederik)
Wednesday, 18 January 2023, 17:34 GMT
Reason for closing: Fixed
Additional comments about closing: java-*-common-3-4
Wednesday, 18 January 2023, 17:34 GMT
Reason for closing: Fixed
Additional comments about closing: java-*-common-3-4
set -g default-shell /usr/bin/zsh
set -g default-command /usr/bin/zsh
in your config?
I still think that it will be more robust to check if the path isn't already present in the $PATH env variable as default `/etc/profile` does.
@anthraxx /etc/profile's 'append_path' function exists now to solve exactly this issue, it's available to every script run from /etc/profile.d.
I made the following edits to profile_jre.sh on my local machine:
-export PATH=${PATH}:/usr/lib/jvm/default/bin
+append_path '/usr/lib/jvm/default/bin'
+export PATH
Granted that one needs to be prepended, not appended, but I would like to see this change implemented as well in `profile_jre.sh`
```
append_path '/usr/lib/jvm/default/bin'
export PATH
```
Anything holding this back? It seems straightforward to me.