Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 144856 - java-config-2 breaks with no $HOME
Summary: java-config-2 breaks with no $HOME
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Java team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-08-23 07:15 UTC by Georgi Georgiev
Modified: 2006-08-24 16:49 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Georgi Georgiev 2006-08-23 07:15:19 UTC
Steps to reproduce:
1. emerge =dev-java/java-config-2.0.26-r5
2. java-config-2 -O
/opt/sun-jdk-1.5.0.08
3. env -u HOME java-config-2 -O

Actual results:

Traceback (most recent call last):
  File "/usr/bin/java-config-2", line 308, in ?
    (options, args) = parser.parse_args()
  File "/usr/lib64/python2.4/optparse.py", line 1275, in parse_args
    stop = self._process_args(largs, rargs, values)
  File "/usr/lib64/python2.4/optparse.py", line 1319, in _process_args
    self._process_short_opts(rargs, values)
  File "/usr/lib64/python2.4/optparse.py", line 1426, in _process_short_opts
    option.process(opt, value, values, self)
  File "/usr/lib64/python2.4/optparse.py", line 707, in process
    return self.take_action(
  File "/usr/lib64/python2.4/optparse.py", line 726, in take_action
    self.callback(self, opt, value, parser, *args, **kwargs)
  File "/usr/bin/java-config-2", line 52, in jdk_home
    print_java_home()
  File "/usr/bin/java-config-2", line 47, in print_java_home
    printer._print(manager.get_active_vm().query('JAVA_HOME'))
  File "/usr/share/java-config-2/pym/java_config/EnvironmentManager.py", line 116, in get_active_vm
    self.load_active_vm()
  File "/usr/share/java-config-2/pym/java_config/EnvironmentManager.py", line 101, in load_active_vm
    for link in self.vm_links():
  File "/usr/share/java-config-2/pym/java_config/EnvironmentManager.py", line 223, in vm_links
    return [ self.user_vm_link(), self.system_vm_link() ]
  File "/usr/share/java-config-2/pym/java_config/EnvironmentManager.py", line 226, in user_vm_link
    return  os.path.join(os.environ.get('HOME'), '.gentoo/java-config-2/current-user-vm')
  File "/usr/lib64/python2.4/posixpath.py", line 62, in join
    elif path == '' or path.endswith('/'):
AttributeError: 'NoneType' object has no attribute 'endswith'

Expected results:
/opt/sun-jdk-1.5.0.08
Comment 1 Josh Nichols (RETIRED) gentoo-dev 2006-08-23 12:17:49 UTC
Good find. Out of curiousity though, is there a use case where $HOME would be intentionally undefined?
Comment 2 Georgi Georgiev 2006-08-23 16:21:15 UTC
(In reply to comment #1)
> Good find. Out of curiousity though, is there a use case where $HOME would be
> intentionally undefined?

I stumbled upon this while trying to run tomcat from daemontools. Apparently the run script is started with an empty environment. More precisely, the environment contains only exactly these variables:

BASH BASH_ARGC BASH_ARGV BASH_EXECUTION_STRING BASH_LINENO BASH_SOURCE BASH_VERSINFO BASH_VERSION DIRSTACK EUID GROUPS HOSTNAME HOSTTYPE IFS MACHTYPE OPTERR OPTIND OSTYPE PATH POSIXLY_CORRECT PPID PS4 PWD SHELL SHELLOPTS SHLVL TERM UID
Comment 3 Georgi Georgiev 2006-08-24 16:26:21 UTC
Alright, seems to habe been fixed in java-config-2.0.27. Might as well mark as FIXED.
Comment 4 Josh Nichols (RETIRED) gentoo-dev 2006-08-24 16:49:29 UTC
Yep. Just hadn't gotten around to marking it as such :) Thanks for reporting.