Community Packages

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#22715 - [jre] profile.d/jre.sh broken when jdk.sh is installed

Attached to Project: Community Packages
Opened by Yun Huang Yong (goosmurf) - Wednesday, 02 February 2011, 08:46 GMT
Last edited by Thomas Dziedzic (tomd123) - Thursday, 03 February 2011, 07:02 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Thomas Dziedzic (tomd123)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
Background - jdk package depends on jre; each installs profile.d/{pkgname}.sh

jre.sh contains:
---
if [ ! -f /etc/profile.d/jdk.sh ]; then
export JAVA_HOME=/opt/java/jre
fi
---

The issue is, for example, when a rc script sources jre.sh, and the jdk is installed, jre.sh does not set JAVA_HOME. The rc script does not require jdk; but if the user had the jdk installed, then jre.sh has no effect.

I suspect the current behaviour is because in the general login case which sources /etc/profile.d/*.sh jre.sh would be sourced after jdk.sh. In this scenario it's desirable not to override JAVA_HOME.

To support both behaviours could jre.sh change to:

export JAVA_HOME=${JAVA_HOME:-/opt/java/jre}

Additional info:
jre 6u23-3
This task depends upon

Closed by  Thomas Dziedzic (tomd123)
Thursday, 03 February 2011, 07:02 GMT
Reason for closing:  Implemented
Additional comments about closing:  pkgrel 4
Comment by Thomas Dziedzic (tomd123) - Thursday, 03 February 2011, 05:42 GMT
This makes sense, I will implement this in pkgrel 4
Comment by Thomas Dziedzic (tomd123) - Thursday, 03 February 2011, 05:53 GMT
btw, if you know how to do ${a:-something} in csh, please tell me :) because there is a .csh profile also
Comment by Yun Huang Yong (goosmurf) - Thursday, 03 February 2011, 06:22 GMT
I'm not a csh guy either but this seems to do the same:

if ( ! "$?JAVA_HOME" ) then
setenv JAVA_HOME /opt/java/jre
endif

Loading...