/hg/icedtea-web: 2 new changesets

jvanek at icedtea.classpath.org jvanek at icedtea.classpath.org
Thu Apr 4 02:21:08 PDT 2013


changeset 0f12ec95deb0 in /hg/icedtea-web
details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=0f12ec95deb0
author: Jiri Vanek <jvanek at redhat.com>
date: Thu Apr 04 11:20:09 2013 +0200

	Plugin is now honoring the custom jre


changeset fbb6b3605538 in /hg/icedtea-web
details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=fbb6b3605538
author: Jiri Vanek <jvanek at redhat.com>
date: Thu Apr 04 11:21:04 2013 +0200

	Fixing typo in changelog annotion -> annotation


diffstat:

 ChangeLog                           |  12 +++++++++++-
 launcher/itweb-settings.in          |   9 +++++++--
 launcher/javaws.in                  |  13 +++++++++----
 plugin/icedteanp/IcedTeaNPPlugin.cc |  28 ++++++++++++++++++++++++----
 4 files changed, 51 insertions(+), 11 deletions(-)

diffs (137 lines):

diff -r 8f99fc51187e -r fbb6b3605538 ChangeLog
--- a/ChangeLog	Wed Apr 03 20:17:10 2013 +0200
+++ b/ChangeLog	Thu Apr 04 11:21:04 2013 +0200
@@ -1,3 +1,13 @@
+2013-04-04  Jiri Vanek <jvanek at redhat.com>
+
+	Plugin is now honoring the custom jre
+	* launcher/itweb-settings.in :
+	* launcher/javaws.in:
+	In case that custom jre do not exists, complains, and use default rather
+	* plugin/icedteanp/IcedTeaNPPlugin.cc: (get_plugin_executable) and
+	(get_plugin_rt_jar) now tries to return custom values before returning the 
+	default one.
+
 2013-04-03  Jana Fabrikova  <jfabriko at redhat.com>
 
 	* /test/reproducers/simple/JavascriptFuncParam/testcases/JavascriptFuncParamTest.java:
@@ -18,7 +28,7 @@
 	current browser are detected in addition to the tests that are
 	k2f in all browsers
 	* /tests/junit-runner/LessVerboseTextListener.java:
-	added method (getK2FinB) reading the annotion,
+	added method (getK2FinB) reading the annotation,
 	in method (printK2F) the testcases that are known to fail in
 	current browser are detected in addition to the tests that are
 	k2f in all browsers
diff -r 8f99fc51187e -r fbb6b3605538 launcher/itweb-settings.in
--- a/launcher/itweb-settings.in	Wed Apr 03 20:17:10 2013 +0200
+++ b/launcher/itweb-settings.in	Thu Apr 04 11:21:04 2013 +0200
@@ -7,13 +7,18 @@
 BINARY_LOCATION=@ITWEB_SETTINGS_BIN_LOCATION@
 PROGRAM_NAME=itweb-settings
 
-CUSTOM_JRE_REGEX="^deployment.jre.dir *= *"
+PROPERTY_NAME=deployment.jre.dir
+CUSTOM_JRE_REGEX="^$PROPERTY_NAME *= *"
 CUSTOM_JRE=`grep "$CUSTOM_JRE_REGEX" ~/.icedtea/deployment.properties 2>/dev/null |  sed "s/$CUSTOM_JRE_REGEX//g"`
 if [ "x$CUSTOM_JRE" = "x" ] ; then
   CUSTOM_JRE=`grep "$CUSTOM_JRE_REGEX" /etc/.java/.deploy/deployment.properties 2>/dev/null |  sed "s/$CUSTOM_JRE_REGEX//g"`
 fi;
 if [ "x$CUSTOM_JRE" != "x" ] ; then
-  JAVA=$CUSTOM_JRE/bin/java
+  if [ -d  "$CUSTOM_JRE" -a -f "$CUSTOM_JRE/bin/java" ] ; then
+    JAVA=$CUSTOM_JRE/bin/java
+  else
+    echo "Your custom JRE $CUSTOM_JRE read from deployment.properties under key $PROPERTY_NAME as $CUSTOM_JRE is not valid. Using default ($JAVA) in attempt to start. Please fix this."
+  fi
 fi;
 
 ${JAVA} ${LAUNCHER_BOOTCLASSPATH} ${LAUNCHER_FLAGS} \
diff -r 8f99fc51187e -r fbb6b3605538 launcher/javaws.in
--- a/launcher/javaws.in	Wed Apr 03 20:17:10 2013 +0200
+++ b/launcher/javaws.in	Thu Apr 04 11:21:04 2013 +0200
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 
 JAVA=@JAVA@
 LAUNCHER_BOOTCLASSPATH=@LAUNCHER_BOOTCLASSPATH@
@@ -9,14 +9,19 @@
 PROGRAM_NAME=javaws
 CP=@JRE@/lib/rt.jar
 
-CUSTOM_JRE_REGEX="^deployment.jre.dir *= *"
+PROPERTY_NAME=deployment.jre.dir
+CUSTOM_JRE_REGEX="^$PROPERTY_NAME *= *"
 CUSTOM_JRE=`grep "$CUSTOM_JRE_REGEX" ~/.icedtea/deployment.properties 2>/dev/null |  sed "s/$CUSTOM_JRE_REGEX//g"`
 if [ "x$CUSTOM_JRE" = "x" ] ; then
   CUSTOM_JRE=`grep "$CUSTOM_JRE_REGEX" /etc/.java/.deploy/deployment.properties 2>/dev/null |  sed "s/$CUSTOM_JRE_REGEX//g"`
 fi;
 if [ "x$CUSTOM_JRE" != "x" ] ; then
-  JAVA=$CUSTOM_JRE/bin/java
-  CP=$CUSTOM_JRE/lib/rt.jar
+  if [ -d  "$CUSTOM_JRE" -a -f "$CUSTOM_JRE/bin/java" -a -f "$CUSTOM_JRE/lib/rt.jar" ] ; then
+    JAVA=$CUSTOM_JRE/bin/java
+    CP=$CUSTOM_JRE/lib/rt.jar
+  else
+    echo "Your custom JRE $CUSTOM_JRE read from deployment.properties under key $PROPERTY_NAME as $CUSTOM_JRE is not valid. Using default ($JAVA, $CP) in attempt to start. Please fix this."
+  fi
 fi;
 
 JAVA_ARGS=( )
diff -r 8f99fc51187e -r fbb6b3605538 plugin/icedteanp/IcedTeaNPPlugin.cc
--- a/plugin/icedteanp/IcedTeaNPPlugin.cc	Wed Apr 03 20:17:10 2013 +0200
+++ b/plugin/icedteanp/IcedTeaNPPlugin.cc	Thu Apr 04 11:21:04 2013 +0200
@@ -48,6 +48,9 @@
 #include <sys/types.h>
 #include <unistd.h>
 
+//IcedTea-plugin includes
+#include "IcedTeaPluginUtils.h"
+#include "IcedTeaParseProperties.h"
 // Liveconnect extension
 #include "IcedTeaScriptablePluginObject.h"
 #include "IcedTeaNPPlugin.h"
@@ -74,6 +77,7 @@
 #include <nsServiceManagerUtils.h>
 #endif
 
+
 // Error reporting macros.
 #define PLUGIN_ERROR(message)                                       \
   g_printerr ("%s:%d: thread %p: Error: %s\n", __FILE__, __LINE__,  \
@@ -287,13 +291,29 @@
 #endif
 
 static std::string get_plugin_executable(){
-      return std::string (appletviewer_default_executable);
-      
+      std::string custom_jre;
+      bool custom_jre_defined = find_custom_jre(custom_jre);
+      if (custom_jre_defined) {
+            if (IcedTeaPluginUtilities::file_exists(custom_jre+"/bin/java")){
+                  return custom_jre+"/bin/java";
+            } else {
+                 fprintf(stderr, "Your custom jre (/bin/java check) %s is not valid. Please fix %s in your %s. In attempt to run using default one. \n", custom_jre.c_str(), custom_jre_key.c_str(), default_file_ITW_deploy_props_name.c_str());
+            }
+      }
+      return appletviewer_default_executable;      
 }
 
 static std::string get_plugin_rt_jar(){
-      return std::string (appletviewer_default_rtjar);
-      
+      std::string custom_jre;
+      bool custom_jre_defined = find_custom_jre(custom_jre);
+      if (custom_jre_defined) {
+            if (IcedTeaPluginUtilities::file_exists(custom_jre+"/lib/rt.jar")){
+                  return custom_jre+"/lib/rt.jar";
+            } else {
+                  fprintf(stderr, "Your custom jre (/lib/rt.jar check) %s is not valid. Please fix %s in your %s. In attempt to run using default one. \n", custom_jre.c_str(), custom_jre_key.c_str(), default_file_ITW_deploy_props_name.c_str());
+            }
+      }
+      return appletviewer_default_rtjar;      
 }
 
 



More information about the distro-pkg-dev mailing list