diff options
author | Vlastimil Babka <caster@gentoo.org> | 2010-04-13 21:21:06 +0000 |
---|---|---|
committer | Vlastimil Babka <caster@gentoo.org> | 2010-04-13 21:21:06 +0000 |
commit | 45e970c07fb079b6a276066fdc766d4f14b099fe (patch) | |
tree | 8b636aebba226e566ffefa1140325f255ae3e858 | |
parent | #297687. Skip env variables. (diff) | |
download | java-config-45e970c07fb079b6a276066fdc766d4f14b099fe.tar.gz java-config-45e970c07fb079b6a276066fdc766d4f14b099fe.tar.bz2 java-config-45e970c07fb079b6a276066fdc766d4f14b099fe.zip |
Print build-only warnings only when a build-only vm is present. Bug #302109.
svn path=/projects/java-config-2/trunk/; revision=8163
-rw-r--r-- | src/eselect/java-vm.eselect | 10 | ||||
-rwxr-xr-x | src/java-config-2 | 12 |
2 files changed, 15 insertions, 7 deletions
diff --git a/src/eselect/java-vm.eselect b/src/eselect/java-vm.eselect index fa1a771..cc3be83 100644 --- a/src/eselect/java-vm.eselect +++ b/src/eselect/java-vm.eselect @@ -61,6 +61,7 @@ describe_list() { do_list() { targets=( $(find_targets) ) write_list_start "Available Java Virtual Machines:" + local found_build_only if [[ -n ${targets[@]} ]] ; then local i system_name user_name @@ -73,6 +74,7 @@ do_list() { if [[ "${build_only}" == "TRUE" || "{build_only}" == "true" ]]; then mark="$(highlight_warning 'Build Only')" + found_build_only="TRUE" fi if [[ ${targets[${i}]} == ${system_name} ]]; then @@ -88,9 +90,11 @@ do_list() { write_kv_list_entry "(none found)" "" fi echo - write_warning_msg "VMs marked as Build Only may contain Security Vulnerabilities and/or be EOL." - write_warning_msg "Gentoo recommends not setting these VMs as either your System or User VM." - write_warning_msg "Please see http://www.gentoo.org/doc/en/java.xml#build-only for more information." + if [[ "${found_build_only}" == "TRUE" ]]; then + write_warning_msg "VMs marked as Build Only may contain Security Vulnerabilities and/or be EOL." + write_warning_msg "Gentoo recommends not setting these VMs as either your System or User VM." + write_warning_msg "Please see http://www.gentoo.org/doc/en/java.xml#build-only for more information." + fi } ### set action ### diff --git a/src/java-config-2 b/src/java-config-2 index 1372ec6..70adbfc 100755 --- a/src/java-config-2 +++ b/src/java-config-2 @@ -145,6 +145,7 @@ def list_available_vms(option, opt, value, parser): except InvalidVMError: active = None + found_build_only = False printer._print('%HThe following VMs are available for generation-2:%$') for i, vm in vm_list.items(): if vm is active: @@ -152,16 +153,19 @@ def list_available_vms(option, opt, value, parser): printer._print('%G' + '*)\t%s [%s]%s' % (vm.query('VERSION'), vm.name(), '%$')) else: printer._print('%G' + '*)\t%s [%s]%s' % (vm.query('VERSION'), vm.name(), '%$') + '%r (Build Only)%$') + found_build_only = True else: if not vm.is_build_only(): printer._print('%i)\t%s [%s]' % (i, vm.query('VERSION'), vm.name())) else: printer._print('%i)\t%s [%s]' % (i, vm.query('VERSION'), vm.name()) + '%r (Build Only)%$') + found_build_only = True - printer._print('') - printer._print('%r' + 'VMs marked as Build Only may contain Security Vulnerabilities and/or be EOL.') - printer._print('%r' + 'Gentoo recommends not setting these VMs as either your System or User VM.') - printer._print('%r' + 'Please see http://www.gentoo.org/doc/en/java.xml#build-only for more information') + if (found_build_only): + printer._print('') + printer._print('%r' + 'VMs marked as Build Only may contain Security Vulnerabilities and/or be EOL.') + printer._print('%r' + 'Gentoo recommends not setting these VMs as either your System or User VM.') + printer._print('%r' + 'Please see http://www.gentoo.org/doc/en/java.xml#build-only for more information') def print_environment(option, opt, value, parser): vm = manager.get_vm(value) |