Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 36046
Collapse All | Expand All

(-)jc_options.py-orig (-4 / +25 lines)
Lines 416-425 Link Here
416
fi
416
fi
417
'''
417
'''
418
418
419
source_java_classpath_csh = \
420
'''
421
if ( -f $HOME/.gentoo/java-env-classpath.csh ) then
422
	source $HOME/.gentoo/java-env-classpath.csh
423
endif
424
'''
425
419
def set_vm(vm_name, system=False):
426
def set_vm(vm_name, system=False):
420
427
421
	conf_str = ''
428
	conf_str = ''
422
	
429
	conf_str_csh = '' # used for --set-user-vm only ("system" is False)
430
431
	# Boris, 2003-12-27: Do config_file and config_path have any purpose?
423
	if system:
432
	if system:
424
		config_file = '20java'
433
		config_file = '20java'
425
		config_path = '/etc/env.d'
434
		config_path = '/etc/env.d'
Lines 435-442 Link Here
435
	for command, value in vm.iteritems():
444
	for command, value in vm.iteritems():
436
		if command == 'ADDPATH' and not system:
445
		if command == 'ADDPATH' and not system:
437
			conf_str += 'PATH=%s:${PATH}\n' % value.strip('"')
446
			conf_str += 'PATH=%s:${PATH}\n' % value.strip('"')
447
			conf_str_csh += 'setenv PATH %s:${PATH}\n' % value.strip('"')
438
		elif command == 'MANPATH' and not system:
448
		elif command == 'MANPATH' and not system:
439
			conf_str += 'MANPATH=${MANPATH}:%s\n' % value.strip('"')
449
			conf_str += 'MANPATH=${MANPATH}:%s\n' % value.strip('"')
450
			conf_str_csh += 'setenv MANPATH ${MANPATH}:%s\n' % value.strip('"')
440
		elif command == 'ADDPATH' and system:
451
		elif command == 'ADDPATH' and system:
441
			conf_str += 'PATH=%s\n' % (value,)
452
			conf_str += 'PATH=%s\n' % (value,)
442
			conf_str += 'ROOTPATH=%s\n' % (value,)
453
			conf_str += 'ROOTPATH=%s\n' % (value,)
Lines 444-453 Link Here
444
			if system: conf_str += 'LDPATH=%s\n' % (value,)
455
			if system: conf_str += 'LDPATH=%s\n' % (value,)
445
		elif command == 'CLASSPATH':
456
		elif command == 'CLASSPATH':
446
			conf_str += 'CLASSPATH=%s\n' % (value,)	
457
			conf_str += 'CLASSPATH=%s\n' % (value,)	
458
			conf_str_csh += 'setenv CLASSPATH %s\n' % (value,)	
447
		elif command == 'VERSION':
459
		elif command == 'VERSION':
448
			conf_str += '# %s=%s\n' % (command, value)
460
			conf_str += '# %s=%s\n' % (command, value)
461
			conf_str_csh += '# %s=%s\n' % (command, value)
449
		elif command != 'ENV_VARS':
462
		elif command != 'ENV_VARS':
450
			conf_str += '%s=%s\n' % (command, value)
463
			conf_str += '%s=%s\n' % (command, value)
464
			conf_str_csh += 'setenv %s %s\n' % (command, value)
465
	
466
	auto = '# Autogenerated by java-config\n# Command: --%s=%s' \
467
		% ({0 : 'set-user-vm', 1 : 'set-system-vm'}[system], vm_name)
451
	
468
	
452
	if system:
469
	if system:
453
		conf_file = open('/etc/env.d/20java', 'w')	
470
		conf_file = open('/etc/env.d/20java', 'w')	
Lines 456-464 Link Here
456
			os.mkdir('%s/.gentoo' % env['HOME'])
473
			os.mkdir('%s/.gentoo' % env['HOME'])
457
		conf_file = open('%s/.gentoo/java' % env['HOME'], 'w')
474
		conf_file = open('%s/.gentoo/java' % env['HOME'], 'w')
458
475
459
	auto = '# Autogenerated by java-config\n# Command: --%s=%s' \
476
		conf_file_csh = open('%s/.gentoo/java.csh' % env['HOME'], 'w')
460
		% ({0 : 'set-user-vm', 1 : 'set-system-vm'}[system], vm_name)
477
		print >> conf_file_csh, auto
461
	
478
		print >> conf_file_csh, conf_str_csh,
479
		conf_file_csh.close()
480
462
	print >> conf_file, auto
481
	print >> conf_file, auto
463
	print >> conf_file, conf_str,
482
	print >> conf_file, conf_str,
464
483
Lines 505-510 Link Here
505
		set_vm(args)
524
		set_vm(args)
506
		if not os.path.isfile(jc_dir + '/java-env'): 
525
		if not os.path.isfile(jc_dir + '/java-env'): 
507
			print >> open(jc_dir + '/java-env', 'w'), source_java_classpath
526
			print >> open(jc_dir + '/java-env', 'w'), source_java_classpath
527
		if not os.path.isfile(jc_dir + '/java-env.csh'): 
528
			print >> open(jc_dir + '/java-env.csh', 'w'), source_java_classpath_csh
508
529
509
530
510
class SetSystemClasspath (jc_iface.OptInterface):
531
class SetSystemClasspath (jc_iface.OptInterface):

Return to bug 36046