From 0d86f4c6e1e2273d724aa3a45a703330a6f2114a Mon Sep 17 00:00:00 2001 From: =?utf8?q?C=C3=A9dric=20Pineau?= Date: Fri, 17 Aug 2012 15:21:58 +0200 Subject: [PATCH] Prevent update-alternatives errors on missing feature on earlier jdk (javaws, libnpjp2.so, ..) --- lib/j2se.sh | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/lib/j2se.sh b/lib/j2se.sh index cd72d5e..a98a915 100644 --- a/lib/j2se.sh +++ b/lib/j2se.sh @@ -80,9 +80,11 @@ if [ "\$1" = configure ]; then program_base="\$1" shift for program in \$*; do - update-alternatives \\ - --install "/usr/bin/\$program" "\$program" "\$program_base/\$program" $j2se_priority \\ - --slave "/usr/share/man/man1/\$program.1.gz" "\$program.1.gz" "$jvm_base$j2se_name/man/man1/\$program.1.gz" + if [[ -f "\$program_base/\$program" ]]; then + update-alternatives \\ + --install "/usr/bin/\$program" "\$program" "\$program_base/\$program" $j2se_priority \\ + --slave "/usr/share/man/man1/\$program.1.gz" "\$program.1.gz" "$jvm_base$j2se_name/man/man1/\$program.1.gz" + fi done } @@ -91,7 +93,9 @@ if [ "\$1" = configure ]; then program_base="\$1" shift for program in \$*; do - update-alternatives --install "/usr/bin/\$program" "\$program" "\$program_base/\$program" $j2se_priority + if [[ -f "\$program_base/\$program" ]]; then + update-alternatives --install "/usr/bin/\$program" "\$program" "\$program_base/\$program" $j2se_priority + fi done } @@ -102,7 +106,9 @@ if [ "\$1" = configure ]; then local plugin_name="\$3" local plugin="\$4" [ -d "\$link_path" ] || install -d -m 755 "\$link_path" - update-alternatives --install "\$link_path/\$link_name" "\$plugin_name" "\$plugin" $j2se_priority + if [[ -f "\$plugin" ]]; then + update-alternatives --install "\$link_path/\$link_name" "\$plugin_name" "\$plugin" $j2se_priority + fi } EOF -- 2.39.5