/hg/icedtea-web: Made rust launchers to resovle jars, compose cl...

jvanek at icedtea.classpath.org jvanek at icedtea.classpath.org
Wed Jan 9 15:17:28 UTC 2019


changeset ab5d4f74c562 in /hg/icedtea-web
details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=ab5d4f74c562
author: Jiri Vanek <jvanek at redhat.com>
date: Wed Jan 09 16:16:54 2019 +0100

	Made rust launchers to resovle jars, compose classpath and this run itw

	* Makefile: renamed netx.jar to javaws.jar; properly ued variabels for NETX_JAR and SPLASH_PNG and all other .jar and.png resources
	* configure.a: added check for --with-itw-libs which determines wheter build is for distribution, self or portable usage
	* netx/net/sourceforge/jnlp/cache/CacheUtil.java: adapted netx->javaws renaming
	* netx/net/sourceforge/jnlp/controlpanel/ClassFinder.java:  adapted netx->javaws renaming
	* netx/net/sourceforge/jnlp/resources/Messages.properties:  adapted netx->javaws renaming
	* netx/net/sourceforge/jnlp/resources/Messages_cs.properties:  adapted netx->javaws renaming
	* netx/net/sourceforge/jnlp/resources/Messages_de.properties:  adapted netx->javaws renaming
	* netx/net/sourceforge/jnlp/resources/Messages_pl.properties:  adapted netx->javaws renaming
	* netx/net/sourceforge/jnlp/resources/Messages_ru.properties:  adapted netx->javaws renaming
	* netx/net/sourceforge/jnlp/runtime/Translator.java:  adapted netx->javaws renaming
	* rust-launcher/src/dirs_paths_helper.rs: added utility methods of path_to_string, current_program, current_program_parent, current_program_name check_config_files_paths split to check_config_files_paths and check_legacy_config_files_paths. Both win only. First one temporarily.
	* rust-launcher/src/hardcoded_paths.rs: made aware of SPLASH_PNG, TAGSOUP_JAR, RHINO_JAR, ITW_LIBS added enum for ITW_LIBS - BOTH, BUNDLED and DISTRIBUTION
	* rust-launcher/src/main.rs: by using jars_helper, compose classpath, put it to java args together with main, and so is making launchers work
	* rust-launcher/src/jars_helper.rs: new class, responsible composing classpath by resolving which jars to use
	* rust-launcher/src/os_access.rs: Added trait method get_classpath_separator
	* rust-launcher/src/property_from_files_resolver.rs: TestLogger moved to utils
	* rust-launcher/src/utils.rs: got TestLogger and provided factory method for it.


diffstat:

 ChangeLog                                                  |   23 +
 Makefile.am                                                |   39 +-
 configure.ac                                               |   20 +
 netx/net/sourceforge/jnlp/cache/CacheUtil.java             |    4 +-
 netx/net/sourceforge/jnlp/controlpanel/ClassFinder.java    |    2 +-
 netx/net/sourceforge/jnlp/resources/Messages.properties    |    4 +-
 netx/net/sourceforge/jnlp/resources/Messages_cs.properties |    4 +-
 netx/net/sourceforge/jnlp/resources/Messages_de.properties |    4 +-
 netx/net/sourceforge/jnlp/resources/Messages_pl.properties |    4 +-
 netx/net/sourceforge/jnlp/resources/Messages_ru.properties |    4 +-
 netx/net/sourceforge/jnlp/runtime/Translator.java          |    2 +-
 rust-launcher/src/dirs_paths_helper.rs                     |   37 +-
 rust-launcher/src/hardcoded_paths.rs                       |  111 +++++++-
 rust-launcher/src/jars_helper.rs                           |  199 +++++++++++++
 rust-launcher/src/main.rs                                  |   57 +++-
 rust-launcher/src/os_access.rs                             |    9 +
 rust-launcher/src/property_from_files_resolver.rs          |   64 +---
 rust-launcher/src/utils.rs                                 |   65 ++++-
 18 files changed, 553 insertions(+), 99 deletions(-)

diffs (truncated from 1040 to 500 lines):

diff -r 3202999ab80f -r ab5d4f74c562 ChangeLog
--- a/ChangeLog	Thu Dec 13 10:51:17 2018 +0100
+++ b/ChangeLog	Wed Jan 09 16:16:54 2019 +0100
@@ -1,3 +1,26 @@
+2019-01-09  Jiri Vanek <jvanek at redhat.com>
+
+	Made rust launchers to resovle jars, compose classpath and this run itw
+	* Makefile: renamed netx.jar to javaws.jar; properly ued variabels for NETX_JAR and SPLASH_PNG and all other .jar and.png resources
+	* configure.a: added check for --with-itw-libs which determines wheter build is for distribution, self or portable usage
+	* netx/net/sourceforge/jnlp/cache/CacheUtil.java: adapted netx->javaws renaming
+	* netx/net/sourceforge/jnlp/controlpanel/ClassFinder.java:  adapted netx->javaws renaming
+	* netx/net/sourceforge/jnlp/resources/Messages.properties:  adapted netx->javaws renaming
+	* netx/net/sourceforge/jnlp/resources/Messages_cs.properties:  adapted netx->javaws renaming
+	* netx/net/sourceforge/jnlp/resources/Messages_de.properties:  adapted netx->javaws renaming
+	* netx/net/sourceforge/jnlp/resources/Messages_pl.properties:  adapted netx->javaws renaming
+	* netx/net/sourceforge/jnlp/resources/Messages_ru.properties:  adapted netx->javaws renaming
+	* netx/net/sourceforge/jnlp/runtime/Translator.java:  adapted netx->javaws renaming
+	* rust-launcher/src/dirs_paths_helper.rs: added utility methods of path_to_string, current_program, current_program_parent, current_program_name
+	check_config_files_paths split to check_config_files_paths and check_legacy_config_files_paths. Both win only. First one temporarily.
+	* rust-launcher/src/hardcoded_paths.rs: made aware of SPLASH_PNG, TAGSOUP_JAR, RHINO_JAR, ITW_LIBS
+	added enum for ITW_LIBS - BOTH, BUNDLED and DISTRIBUTION
+	* rust-launcher/src/main.rs: by using jars_helper, compose classpath, put it to java args together with main, and so is making launchers work
+	* rust-launcher/src/jars_helper.rs: new class, responsible composing classpath by resolving which jars to use
+	* rust-launcher/src/os_access.rs: Added trait method get_classpath_separator
+	* rust-launcher/src/property_from_files_resolver.rs: TestLogger moved to utils
+	* rust-launcher/src/utils.rs: got TestLogger and provided factory method for it.
+
 2018-12-10  Jiri Vanek <jvanek at redhat.com>
             jtesdall <jtesdall at mapcon.com>
 
diff -r 3202999ab80f -r ab5d4f74c562 Makefile.am
--- a/Makefile.am	Thu Dec 13 10:51:17 2018 +0100
+++ b/Makefile.am	Wed Jan 09 16:16:54 2019 +0100
@@ -164,6 +164,8 @@
   PLUGIN_JAR=$(datadir)/$(PACKAGE_NAME)/plugin.jar
   JSOBJECT_JAR=$(datadir)/$(PACKAGE_NAME)/jsobject.jar
 endif
+  NETX_JAR=$(datadir)/$(PACKAGE_NAME)/javaws.jar
+  SPLASH_PNG=$(datadir)/$(PACKAGE_NAME)/javaws_splash.png
 
 # Conditional defintions
 if HAVE_TAGSOUP
@@ -186,7 +188,7 @@
 #    IllegalAccessException
 #  - we want full privileges
 #
-export UNIFIED_CLASSPATH_SEGMENTS=$(datadir)/$(PACKAGE_NAME)/netx.jar $(PLUGIN_JAR) $(JSOBJECT_JAR) $(RHINO_JAR) $(TAGSOUP_JAR)
+export UNIFIED_CLASSPATH_SEGMENTS=$(NETX_JAR) $(PLUGIN_JAR) $(JSOBJECT_JAR) $(RHINO_JAR) $(TAGSOUP_JAR)
 export UNIFIED_JACOCO_CLASSPATH_SEGMENTS=$(UNIFIED_CLASSPATH_SEGMENTS) $(JACOCO_CLASSPATH)
 export UNIFIED_CLASSPATH=$(call joinsegments, $(UNIFIED_CLASSPATH_SEGMENTS))
 export UNIFIED_JACOCO_CLASSPATH=$(call joinsegments, $(UNIFIED_JACOCO_CLASSPATH_SEGMENTS))
@@ -314,14 +316,16 @@
 # make-time from configure-time
 edit_launcher_script = sed \
   -e "s|[@]LAUNCHER_BOOTCLASSPATH[@]|$(LAUNCHER_BOOTCLASSPATH)|g" \
-  -e "s|[@]JAVAWS_SPLASH_LOCATION[@]|$(datadir)/$(PACKAGE_NAME)/javaws_splash.png|g" \
+  -e "s|[@]JAVAWS_SPLASH_LOCATION[@]|$(SPLASH_PNG)|g" \
   -e "s|[@]JAVA[@]|$(JAVA)|g" \
   -e "s|[@]JRE[@]|$(SYSTEM_JRE_DIR)|g" \
   -e "s|[@]MAIN_CLASS[@]|$${MAIN_CLASS}|g" \
   -e "s|[@]BIN_LOCATION[@]|$${BIN_LOCATION}|g" \
-  -e "s|[@]NETX_JAR[@]|$(datadir)/$(PACKAGE_NAME)/netx.jar|g" \
+  -e "s|[@]NETX_JAR[@]|$(NETX_JAR)|g" \
   -e "s|[@]PLUGIN_JAR[@]|$(PLUGIN_JAR)|g" \
   -e "s|[@]JSOBJECT_JAR[@]|$(JSOBJECT_JAR)|g" \
+  -e "s|[@]TAGSOUP_JAR[@]|$(TAGSOUP_JAR)|g" \
+  -e "s|[@]RHINO_JAR[@]|$(RHINO_JAR)|g" \
   -e "s|[@]PROGRAM_NAME[@]|$${PROGRAM_NAME}|g"
 
 # Top-Level Targets
@@ -350,11 +354,11 @@
 	${INSTALL_PROGRAM} $(PLUGIN_DIR)/$(BUILT_PLUGIN_LIBRARY) $(DESTDIR)$(libdir)
 endif
 if ENABLE_PLUGINJAR
-	${INSTALL_DATA} $(TOP_BUILD_DIR)/liveconnect/lib/classes-applet.jar   $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/plugin.jar
-	${INSTALL_DATA} $(TOP_BUILD_DIR)/liveconnect/lib/classes-jsobject.jar $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/jsobject.jar
+	${INSTALL_DATA} $(TOP_BUILD_DIR)/liveconnect/lib/classes-applet.jar   $(DESTDIR)$(PLUGIN_JAR)
+	${INSTALL_DATA} $(TOP_BUILD_DIR)/liveconnect/lib/classes-jsobject.jar $(DESTDIR)$(JSOBJECT_JAR)
 endif
-	${INSTALL_DATA} $(NETX_DIR)/lib/classes.jar $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/netx.jar
-	${INSTALL_DATA} $(NETX_SRCDIR)/javaws_splash.png $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/javaws_splash.png
+	${INSTALL_DATA} $(NETX_DIR)/lib/classes.jar $(DESTDIR)$(NETX_JAR)
+	${INSTALL_DATA} $(NETX_SRCDIR)/javaws_splash.png $(DESTDIR)$(SPLASH_PNG)
 	${INSTALL_DATA} $(TOP_SRC_DIR)/javaws.png $(ICONS_DEST_DIR)/
 if ENABLE_NATIVE_LAUNCHERS
 	${INSTALL_PROGRAM} launcher.build/$(javaws) $(DESTDIR)$(bindir)
@@ -510,10 +514,10 @@
 	rm -f $(BASH_CMPL_DEST_DIR)/policyeditor.bash
 
 uninstall-local: uninstall-linux-only
-	rm -f $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/plugin.jar
-	rm -f $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/jsobject.jar
-	rm -f $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/netx.jar
-	rm -r $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/javaws_splash.png
+	rm -f $(DESTDIR)$(PLUGIN_JAR)
+	rm -f $(DESTDIR)$(JSOBJECT_JAR)
+	rm -f $(DESTDIR)$(NETX_JAR)
+	rm -r $(DESTDIR)$(SPLASH_PNG)
 	rm -r $(ICONS_DEST_DIR)/javaws.png
 	rm -rf $(DESTDIR)$(htmldir)
 if WINDOWS
@@ -554,7 +558,7 @@
 	  -DMOZILLA_VERSION_COLLAPSED="$(MOZILLA_VERSION_COLLAPSED)" \
 	  -DICEDTEA_WEB_JRE="\"$(SYSTEM_JRE_DIR)\"" \
 	  -DPLUGIN_BOOTCLASSPATH=$(PLUGIN_BOOTCLASSPATH) \
-	  -DNETX_JAR="\"$(datadir)/$(PACKAGE_NAME)/netx.jar\"" \
+	  -DNETX_JAR="\"$(NETX_JAR)\"" \
 	  -DPLUGIN_JAR="\"$(PLUGIN_JAR)\"" \
 	  -DJSOBJECT_JAR="\"$(JSOBJECT_JAR)\""\
 	  $(GLIB_CFLAGS) \
@@ -609,7 +613,7 @@
 	  -DMOZILLA_VERSION_COLLAPSED="$(MOZILLA_VERSION_COLLAPSED)" \
 	  -DICEDTEA_WEB_JRE="\"$(SYSTEM_JRE_DIR)\"" \
 	  -DPLUGIN_BOOTCLASSPATH=$(PLUGIN_BOOTCLASSPATH) \
-	  -DNETX_JAR="\"$(datadir)/$(PACKAGE_NAME)/netx.jar\"" \
+	  -DNETX_JAR="\"$(NETX_JAR)\"" \
 	  -DPLUGIN_JAR="\"$(PLUGIN_JAR)\"" \
 	  -DJSOBJECT_JAR="\"$(JSOBJECT_JAR)\""\
 	  $(GLIB_CFLAGS) \
@@ -907,6 +911,13 @@
 	pushd $$outs ; \
 	  export JAVA=$(JAVA) ; \
 	  export JRE=$(SYSTEM_JRE_DIR) ; \
+	  export SPLASH_PNG=$(SPLASH_PNG) ; \
+	  export ITW_LIBS=$(ITW_LIBS) ; \
+	  export PLUGIN_JAR=$(PLUGIN_JAR) ; \
+	  export NETX_JAR=$(NETX_JAR) ; \
+	  export JSOBJECT_JAR=$(JSOBJECT_JAR) ; \
+	  export TAGSOUP_JAR=$(TAGSOUP_JAR) ; \
+	  export RHINO_JAR=$(RHINO_JAR) ; \
 	  unset MAIN_CLASS ; \
 	  unset BIN_LOCATION ; \
 	  unset PROGRAM_NAME ; \
@@ -1638,7 +1649,7 @@
 	  -DICEDTEA_WEB_JRE="\"$(SYSTEM_JRE_DIR)\"" \
 	  -DPLUGIN_BOOTCLASSPATH=$(PLUGIN_COVERAGE_BOOTCLASSPATH) \
 	  -DCOVERAGE_AGENT=$(JACOCO_AGENT_PLUGIN_SWITCH) \
-	  -DNETX_JAR="\"$(datadir)/$(PACKAGE_NAME)/netx.jar\"" \
+	  -DNETX_JAR="\"$(NETX_JAR)\"" \
 	  -DPLUGIN_JAR="\"$(PLUGIN_JAR)\"" \
 	  -DJSOBJECT_JAR="\"$(JSOBJECT_JAR)\""\
 	  $(GLIB_CFLAGS) \
diff -r 3202999ab80f -r ab5d4f74c562 configure.ac
--- a/configure.ac	Thu Dec 13 10:51:17 2018 +0100
+++ b/configure.ac	Wed Jan 09 16:16:54 2019 +0100
@@ -82,6 +82,26 @@
 AM_CONDITIONAL([LINUX], [test "$build_linux" = "yes"])
 AM_CONDITIONAL([WINDOWS], [test "$build_windows" = "yes"])
 
+AC_MSG_CHECKING([how to search for libraries in native launchers])
+AC_ARG_WITH([itw-libs],
+	      [AS_HELP_STRING([--with-itw-libs],
+	      		      [set way of searching system for jar depndencies - BUNDLED, for portable build (in application space); DISTRIBUTION, for linux (in installed path); BOTH, for both usages (should be for testing only])], [ITW_LIBS="${withval}"], [ITW_LIBS='none'])
+if test "x$build_windows" = xyes ; then
+  if test x"$ITW_LIBS" = xnone -o x"$ITW_LIBS" = x; then
+      ITW_LIBS="BUNDLED"
+      echo  -n "On Windows, presetting missing --with-itw-libs ITW_LIBS to $ITW_LIBS. " 
+      echo  -n "On Windows, DISTRIBUTION nor BOTH do not have much sense... " 
+  fi
+fi
+AC_MSG_RESULT(${ITW_LIBS})
+AC_SUBST(ITW_LIBS)
+if test x"$ITW_LIBS" = xnone -o x"$ITW_LIBS" = x; then
+    AC_MSG_ERROR([missing --with-itw-libs; mandatory on linux. Use BUNDLED, DISTRIBUTION or BOTH. use BOTH with care. ])
+fi
+if test ! "$ITW_LIBS" = BUNDLED -a ! "$ITW_LIBS" = DISTRIBUTION -a ! "$ITW_LIBS" = BOTH; then
+    AC_MSG_ERROR([incorrect --with-itw-libs; mandatory are BUNDLED, DISTRIBUTION or BOTH ])
+fi
+
 IT_CHECK_WITH_GCJ
 FIND_TOOL([ZIP], [zip])
 FIND_JAVAC
diff -r 3202999ab80f -r ab5d4f74c562 netx/net/sourceforge/jnlp/cache/CacheUtil.java
--- a/netx/net/sourceforge/jnlp/cache/CacheUtil.java	Thu Dec 13 10:51:17 2018 +0100
+++ b/netx/net/sourceforge/jnlp/cache/CacheUtil.java	Wed Jan 09 16:16:54 2019 +0100
@@ -183,10 +183,10 @@
                 FileChannel channel = fis.getChannel();
                 locking  = channel.tryLock();
                 if (locking == null) {
-                    OutputController.getLogger().log("Other instances of netx are running");
+                    OutputController.getLogger().log("Other instances of javaws are running");
                     return false;
                 }
-                OutputController.getLogger().log("No other instances of netx are running");
+                OutputController.getLogger().log("No other instances of javaws are running");
                 return true;
 
             } else {
diff -r 3202999ab80f -r ab5d4f74c562 netx/net/sourceforge/jnlp/controlpanel/ClassFinder.java
--- a/netx/net/sourceforge/jnlp/controlpanel/ClassFinder.java	Thu Dec 13 10:51:17 2018 +0100
+++ b/netx/net/sourceforge/jnlp/controlpanel/ClassFinder.java	Wed Jan 09 16:16:54 2019 +0100
@@ -74,7 +74,7 @@
         for (String classpathEntry : classPathRoots) {
             //need to avoid base jdk jars/modules
             if (classpathEntry.toLowerCase().contains("icedtea-web")
-                    || classpathEntry.toLowerCase().contains("netx")
+                    || classpathEntry.toLowerCase().contains("javaws")
                     || classpathEntry.toLowerCase().contains("plugin")) {
                 File f = new File(classpathEntry);
                 if (!f.exists()) {
diff -r 3202999ab80f -r ab5d4f74c562 netx/net/sourceforge/jnlp/resources/Messages.properties
--- a/netx/net/sourceforge/jnlp/resources/Messages.properties	Thu Dec 13 10:51:17 2018 +0100
+++ b/netx/net/sourceforge/jnlp/resources/Messages.properties	Wed Jan 09 16:16:54 2019 +0100
@@ -133,8 +133,8 @@
 LCantReadInfo=You can try to download this file manually and send it as bug report to IcedTea-Web team.
 LNullLocation=Could not determine .jnlp file location.
 LNullLocationInfo=An attempt was made to launch a JNLP file in another JVM, but the file could not be located.  In order to launch in an external JVM, the runtime must be able to locate the .jnlp file either in the local file system or on a server.
-LNetxJarMissing=Could not determine location of netx.jar.
-LNetxJarMissingInfo=An attempt was made to launch a JNLP file in another JVM, but the netx.jar could not be located.  In order to launch in an external JVM, the runtime must be able to locate the netx.jar file.
+LNetxJarMissing=Could not determine location of javaws.jar.
+LNetxJarMissingInfo=An attempt was made to launch a JNLP file in another JVM, but the javaws.jar could not be located.  In order to launch in an external JVM, the runtime must be able to locate the javaws.jar file.
 LNotToSpec=JNLP file not strictly to specifications.
 LNotToSpecInfo=The JNLP file contains data that is prohibited by the JNLP specification.  The runtime can attempt to ignore the invalid information and continue launching the file.
 LNotApplication=Not an application file.
diff -r 3202999ab80f -r ab5d4f74c562 netx/net/sourceforge/jnlp/resources/Messages_cs.properties
--- a/netx/net/sourceforge/jnlp/resources/Messages_cs.properties	Thu Dec 13 10:51:17 2018 +0100
+++ b/netx/net/sourceforge/jnlp/resources/Messages_cs.properties	Wed Jan 09 16:16:54 2019 +0100
@@ -111,8 +111,8 @@
 LCantReadInfo=M\u016f\u017eete zkusit st\u00e1hnout tento soubor ru\u010dn\u011b a zaslat ho prost\u0159ednictv\u00edm hl\u00e1\u0161en\u00ed o chyb\u011b t\u00fdmu IcedTea-Web.
 LNullLocation=Nelze ur\u010dit um\u00edst\u011bn\u00ed souboru JNLP.
 LNullLocationInfo=Byl u\u010din\u011bn pokus o spu\u0161t\u011bn\u00ed souboru JNLP v jin\u00e9m prost\u0159ed\u00ed JVM, av\u0161ak soubor nebyl nalezen.  Chcete-li spustit extern\u00ed prost\u0159ed\u00ed JVM, modul runtime mus\u00ed b\u00fdt schopen nal\u00e9zt soubor .jnlp v lok\u00e1ln\u00edm souborov\u00e9m syst\u00e9mu nebo na serveru.
-LNetxJarMissing=Nelze ur\u010dit um\u00edst\u011bn\u00ed souboru netx.jar.
-LNetxJarMissingInfo=Byl u\u010din\u011bn pokus o spu\u0161t\u011bn\u00ed souboru JNLP v jin\u00e9m prost\u0159ed\u00ed JVM, av\u0161ak soubor netx.jar nebyl nalezen.  Chcete-li spustit extern\u00ed prost\u0159ed\u00ed JVM, modul runtime mus\u00ed b\u00fdt schopen nal\u00e9zt soubor netx.jar.
+LNetxJarMissing=Nelze ur\u010dit um\u00edst\u011bn\u00ed souboru javaws.jar.
+LNetxJarMissingInfo=Byl u\u010din\u011bn pokus o spu\u0161t\u011bn\u00ed souboru JNLP v jin\u00e9m prost\u0159ed\u00ed JVM, av\u0161ak soubor javaws.jar nebyl nalezen.  Chcete-li spustit extern\u00ed prost\u0159ed\u00ed JVM, modul runtime mus\u00ed b\u00fdt schopen nal\u00e9zt soubor javaws.jar.
 LNotToSpec=Soubor JNLP p\u0159esn\u011b neodpov\u00edd\u00e1 specifikaci.
 LNotToSpecInfo=Soubor JNLP obsahuje data, kter\u00e1 jsou zak\u00e1z\u00e1na v r\u00e1mci specifikace JNLP.  Modul runtime se m\u016f\u017ee pokusit ignorovat neplatn\u00e9 informace a pokra\u010dovat ve spou\u0161t\u011bn\u00ed souboru.
 LNotApplication=Nejedn\u00e1 se o soubor aplikace.
diff -r 3202999ab80f -r ab5d4f74c562 netx/net/sourceforge/jnlp/resources/Messages_de.properties
--- a/netx/net/sourceforge/jnlp/resources/Messages_de.properties	Thu Dec 13 10:51:17 2018 +0100
+++ b/netx/net/sourceforge/jnlp/resources/Messages_de.properties	Wed Jan 09 16:16:54 2019 +0100
@@ -129,8 +129,8 @@
 LCantReadInfo=Die Datei kann m\u00f6glicherweise manuell heruntergeladen und als Fehlerbericht an das IcedTea-Web Team gesendet werden.
 LNullLocation=Konnte den Ort der .jnlp Datei nicht bestimmen.
 LNullLocationInfo=Es wurde versucht eine JNLP-Datei in einer anderen JVM zu starten, aber die Datei konnte am Ort nicht ermittelt werden. Um in einer externen JVM zu starten, muss die Laufzeitumgebung in der Lage sein die .jnlp Datei entweder auf dem lokalen Dateisystem oder einem Server zu ermitteln.
-LNetxJarMissing=Konnte den Ort von netx.jar nicht bestimmen.
-LNetxJarMissingInfo=Ein wurde versucht eine JNLP-Datei in einer anderen JVM zu starten, aber das netx.jar konnte am Ort nicht ermittelt werden. Um in einer externen JVM zu starten, muss die Laufzeitumgebung in der Lage sein das netx.jar zu ermitteln.
+LNetxJarMissing=Konnte den Ort von javaws.jar nicht bestimmen.
+LNetxJarMissingInfo=Ein wurde versucht eine JNLP-Datei in einer anderen JVM zu starten, aber das javaws.jar konnte am Ort nicht ermittelt werden. Um in einer externen JVM zu starten, muss die Laufzeitumgebung in der Lage sein das javaws.jar zu ermitteln.
 LNotToSpec=JNLP-Datei nicht strikt nach Spezifikation.
 LNotToSpecInfo=Die JNLP-Datei enth\u00e4lt Daten, die nach JNLP Spezifikation verboten sind. Die Laufzeitumgebung kann versuchen die ung\u00fcltigen Information zu ignorieren und die Datei zu starten fortfahren.
 LNotApplication=Keine Anwendungsdatei.
diff -r 3202999ab80f -r ab5d4f74c562 netx/net/sourceforge/jnlp/resources/Messages_pl.properties
--- a/netx/net/sourceforge/jnlp/resources/Messages_pl.properties	Thu Dec 13 10:51:17 2018 +0100
+++ b/netx/net/sourceforge/jnlp/resources/Messages_pl.properties	Wed Jan 09 16:16:54 2019 +0100
@@ -110,8 +110,8 @@
 LCantReadInfo=Mo\u017cesz spr\u00f3bowa\u0107 r\u0119cznie pobra\u0107 ten plik i wys\u0142a\u0107 go razem ze zg\u0142oszeniem b\u0142\u0119du do zespo\u0142u IcedTea-Web.
 LNullLocation=Nie mo\u017cna ustali\u0107 lokalizacj\u0119 pliku .jnlp.
 LNullLocationInfo=Podj\u0119to pr\u00f3b\u0119 wystartowania pliku JNLP w innej JVM, lecz nie mo\u017cna by\u0142o zlokalizowa\u0107 plik. Aby wystartowa\u0107 w zewn\u0119trznej JVM, uruchomienie programowe musi by\u0107 w stanie zlokalizowa\u0107 plik .jnlp albo w lokalnym systemie plik\u00f3w czy na serwerze.
-LNetxJarMissing=Nie mo\u017cna ustali\u0107 lokalizacj\u0119 netx.jar.
-LNetxJarMissingInfo=Podj\u0119to pr\u00f3b\u0119 wystartowania pliku JNLP w innej JVM, lecz nie mo\u017cna by\u0142o zlokalizowa\u0107 netx.jar. Aby wystartowa\u0107 w zewn\u0119trznej JVM, uruchomienie programowe musi by\u0107 w stanie zlokalizowa\u0107 plik netx.jar.
+LNetxJarMissing=Nie mo\u017cna ustali\u0107 lokalizacj\u0119 javaws.jar.
+LNetxJarMissingInfo=Podj\u0119to pr\u00f3b\u0119 wystartowania pliku JNLP w innej JVM, lecz nie mo\u017cna by\u0142o zlokalizowa\u0107 javaws.jar. Aby wystartowa\u0107 w zewn\u0119trznej JVM, uruchomienie programowe musi by\u0107 w stanie zlokalizowa\u0107 plik javaws.jar.
 LNotToSpec=Plik JNLP nie spe\u0142nia \u015bci\u015ble specyfikacji.
 LNotToSpecInfo=Plik JNLP zawiera dane, kt\u00f3re s\u0105 zabronione wed\u0142ug specyfikacji JNLP. Uruchomienie programowe mo\u017ce pr\u00f3bowa\u0107 ignorowa\u0107 niepoprawne informacje i kontynuowa\u0107 startowanie pliku.
 LNotApplication=Brak pliku applet-owego.
diff -r 3202999ab80f -r ab5d4f74c562 netx/net/sourceforge/jnlp/resources/Messages_ru.properties
--- a/netx/net/sourceforge/jnlp/resources/Messages_ru.properties	Thu Dec 13 10:51:17 2018 +0100
+++ b/netx/net/sourceforge/jnlp/resources/Messages_ru.properties	Wed Jan 09 16:16:54 2019 +0100
@@ -113,8 +113,8 @@
 LCantReadInfo=\u041c\u043e\u0436\u043d\u043e \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0435\u0433\u043e \u0432 \u043e\u0442\u0447\u0451\u0442\u0435 \u043e\u0431 \u043e\u0448\u0438\u0431\u043a\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u0435 IcedTea-Web.
 LNullLocation=\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430 .jnlp.
 LNullLocationInfo=\u0411\u044b\u043b\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0430 \u043f\u043e\u043f\u044b\u0442\u043a\u0430 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0444\u0430\u0439\u043b\u0430 JNLP \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u0439 JVM, \u043d\u043e \u043d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043d\u0430\u0439\u0442\u0438 \u0444\u0430\u0439\u043b.  \u0427\u0442\u043e\u0431\u044b \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0432\u043d\u0435\u0448\u043d\u044e\u044e JVM, \u0441\u0440\u0435\u0434\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0434\u043e\u043b\u0436\u043d\u0430 \u0438\u043c\u0435\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043d\u0430\u0439\u0442\u0438 \u0444\u0430\u0439\u043b .jnlp \u043b\u0438\u0431\u043e \u0432 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435, \u043b\u0438\u0431\u043e \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435.
-LNetxJarMissing=\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043d\u0430\u0439\u0442\u0438 \u0444\u0430\u0439\u043b netx.jar.
-LNetxJarMissingInfo=\u0411\u044b\u043b\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0430 \u043f\u043e\u043f\u044b\u0442\u043a\u0430 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0444\u0430\u0439\u043b\u0430 JNLP \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u0439 JVM, \u043d\u043e \u043d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043d\u0430\u0439\u0442\u0438 \u0444\u0430\u0439\u043b netx.jar.  \u0427\u0442\u043e\u0431\u044b \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0432\u043d\u0435\u0448\u043d\u044e\u044e JVM, \u0441\u0440\u0435\u0434\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0434\u043e\u043b\u0436\u043d\u0430 \u0438\u043c\u0435\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043d\u0430\u0439\u0442\u0438 \u0444\u0430\u0439\u043b netx.jar.
+LNetxJarMissing=\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043d\u0430\u0439\u0442\u0438 \u0444\u0430\u0439\u043b javaws.jar.
+LNetxJarMissingInfo=\u0411\u044b\u043b\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0430 \u043f\u043e\u043f\u044b\u0442\u043a\u0430 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0444\u0430\u0439\u043b\u0430 JNLP \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u0439 JVM, \u043d\u043e \u043d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043d\u0430\u0439\u0442\u0438 \u0444\u0430\u0439\u043b javaws.jar.  \u0427\u0442\u043e\u0431\u044b \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0432\u043d\u0435\u0448\u043d\u044e\u044e JVM, \u0441\u0440\u0435\u0434\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0434\u043e\u043b\u0436\u043d\u0430 \u0438\u043c\u0435\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043d\u0430\u0439\u0442\u0438 \u0444\u0430\u0439\u043b javaws.jar.
 LNotToSpec=\u0424\u0430\u0439\u043b JNLP \u043d\u0435 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f\u043c.
 LNotToSpecInfo=\u0424\u0430\u0439\u043b JNLP \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0434\u0430\u043d\u043d\u044b\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u044b \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0435\u0439 JNLP.  \u0421\u0440\u0435\u0434\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043f\u043e\u043f\u044b\u0442\u043a\u0443 \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0438 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c \u0437\u0430\u043f\u0443\u0441\u043a \u0444\u0430\u0439\u043b\u0430.
 LNotApplication=\u041d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0444\u0430\u0439\u043b\u043e\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.
diff -r 3202999ab80f -r ab5d4f74c562 netx/net/sourceforge/jnlp/runtime/Translator.java
--- a/netx/net/sourceforge/jnlp/runtime/Translator.java	Thu Dec 13 10:51:17 2018 +0100
+++ b/netx/net/sourceforge/jnlp/runtime/Translator.java	Wed Jan 09 16:16:54 2019 +0100
@@ -52,7 +52,7 @@
             resources = ResourceBundle.getBundle(s);
         } catch (Exception ex) {
             throw new IllegalStateException("No bundles found for Locale: " + Locale.getDefault().toString()
-                    + "and missing base resource bundle in netx.jar:net/sourceforge/jnlp/resource/Messages.properties");
+                    + "and missing base resource bundle in javaws.jar:net/sourceforge/jnlp/resource/Messages.properties");
         }
     }
 
diff -r 3202999ab80f -r ab5d4f74c562 rust-launcher/src/dirs_paths_helper.rs
--- a/rust-launcher/src/dirs_paths_helper.rs	Thu Dec 13 10:51:17 2018 +0100
+++ b/rust-launcher/src/dirs_paths_helper.rs	Wed Jan 09 16:16:54 2019 +0100
@@ -60,6 +60,22 @@
     path.metadata().map(|md| md.is_dir()).unwrap_or(false)
 }
 
+pub fn path_to_string(path: &std::path::PathBuf) -> String {
+    path.to_str().expect("unwrap of os string failed").to_string()
+}
+
+pub fn current_program() -> std::path::PathBuf {
+    env::current_exe().expect("unwrap of pgm path failed")
+}
+
+pub fn current_program_parent() -> std::path::PathBuf {
+    std::path::PathBuf::from(current_program().parent().expect("getting of pgm dir failed"))
+}
+
+pub fn current_program_name() -> String {
+    String::from(current_program().file_name().expect("unwrap of pgm name failed").to_str().expect("unwrap of pgm name failed"))
+}
+
 /*tests*/
 #[cfg(test)]
 mod tests {
@@ -69,22 +85,30 @@
     use utils::tests_utils as tu;
 
     #[test]
+    #[cfg(not(windows))]
     fn check_config_files_paths() {
         let os = os_access::Linux::new(false);
         let p3 = super::get_itw_config_file(&os);
-        let p4 = super::get_itw_legacy_config_file(&os);
-        let p5 = super::get_itw_legacy_global_config_file(&os);
         let p6 = super::get_itw_global_config_file(&os);
         assert_ne!(None, p3);
-        assert_ne!(None, p4);
-        assert_ne!(None, p5);
         assert_ne!(None, p6);
         println!("{}", p3.clone().expect("unwrap failed").display());
-        println!("{}", p4.clone().expect("unwrap failed").display());
-        println!("{}", p5.clone().expect("unwrap failed").display());
         println!("{}", p6.clone().expect("unwrap failed").display());
         assert_eq!(true, p3.clone().expect("unwrap failed").display().to_string().contains("icedtea-web"));
         assert_eq!(true, p3.clone().expect("unwrap failed").display().to_string().ends_with("deployment.properties"));
+        assert_eq!(true, p6.clone().expect("unwrap failed").display().to_string().ends_with("deployment.properties"));
+    }
+
+    #[test]
+    #[cfg(not(windows))]
+    fn check_legacy_config_files_paths() {
+        let os = os_access::Linux::new(false);
+        let p4 = super::get_itw_legacy_config_file(&os);
+        let p5 = super::get_itw_legacy_global_config_file(&os);
+        assert_ne!(None, p4);
+        assert_ne!(None, p5);
+        println!("{}", p4.clone().expect("unwrap failed").display());
+        println!("{}", p5.clone().expect("unwrap failed").display());
         assert_eq!(true, p4.clone().expect("unwrap failed").display().to_string().contains(".icedtea"));
         assert_eq!(true, p4.clone().expect("unwrap failed").display().to_string().ends_with("deployment.properties"));
         assert_eq!(true, p5.clone().expect("unwrap failed").display().to_string().contains("etc"));
@@ -94,7 +118,6 @@
         assert_eq!(true, p5.clone().expect("unwrap failed").display().to_string().contains("etc"));
         assert_eq!(true, p5.clone().expect("unwrap failed").display().to_string().contains(".java"));
         assert_eq!(true, p5.clone().expect("unwrap failed").display().to_string().contains("deployment"));
-        assert_eq!(true, p6.clone().expect("unwrap failed").display().to_string().ends_with("deployment.properties"));
     }
 
     #[test]
diff -r 3202999ab80f -r ab5d4f74c562 rust-launcher/src/hardcoded_paths.rs
--- a/rust-launcher/src/hardcoded_paths.rs	Thu Dec 13 10:51:17 2018 +0100
+++ b/rust-launcher/src/hardcoded_paths.rs	Wed Jan 09 16:16:54 2019 +0100
@@ -1,7 +1,13 @@
+use os_access;
+use env;
+use std::string::String;
+use std::fmt::Write;
+use std::str::FromStr;
+
 /*legacy variables*/
 const PROGRAM_NAME: Option<&'static str> = option_env!("PROGRAM_NAME");
 const LAUNCHER_BOOTCLASSPATH: Option<&'static str> = option_env!("LAUNCHER_BOOTCLASSPATH");
-const JAVAWS_SPLASH_LOCATION: Option<&'static str> = option_env!("JAVAWS_SPLASH_LOCATION");
+const SPLASH_PNG: Option<&'static str> = option_env!("SPLASH_PNG");
 const JAVA: Option<&'static str> = option_env!("JAVA");
 const JRE: Option<&'static str> = option_env!("JRE");
 const MAIN_CLASS: Option<&'static str> = option_env!("MAIN_CLASS");
@@ -9,6 +15,9 @@
 const NETX_JAR: Option<&'static str> = option_env!("NETX_JAR");
 const PLUGIN_JAR: Option<&'static str> = option_env!("PLUGIN_JAR");
 const JSOBJECT_JAR: Option<&'static str> = option_env!("JSOBJECT_JAR");
+const TAGSOUP_JAR: Option<&'static str> = option_env!("TAGSOUP_JAR");
+const RHINO_JAR: Option<&'static str> = option_env!("RHINO_JAR");
+const ITW_LIBS: Option<&'static str> = option_env!("ITW_LIBS");
 
 
 pub fn get_jre() -> &'static str {
@@ -31,12 +40,93 @@
     BIN_LOCATION.unwrap_or("BIN_LOCATION-dev-unspecified")
 }
 
+pub fn get_splash() -> &'static str {
+    SPLASH_PNG.unwrap_or("SPLASH_PNG-dev-unspecified")
+}
+
+pub fn get_netx() -> &'static str { NETX_JAR.unwrap_or("NETX_JAR-dev-unspecified") }
+
+fn get_itwlibsearch() -> &'static str {
+    ITW_LIBS.unwrap_or("ITW_LIBS-dev-unspecified")
+}
+
+pub fn get_bootcp() -> &'static str {LAUNCHER_BOOTCLASSPATH.unwrap_or("LAUNCHER_BOOTCLASSPATH-dev-unspecified") }
+
+// optional deps
+pub fn get_plugin() -> Option<&'static str> {
+    PLUGIN_JAR
+}
+
+pub fn get_jsobject() -> Option<&'static str> { JSOBJECT_JAR }
+
+pub fn get_tagsoup() -> Option<&'static str> { TAGSOUP_JAR }
+
+pub fn get_rhino() -> Option<&'static str> { RHINO_JAR }
+
+
+#[derive(PartialEq)]
+pub enum ItwLibSearch {
+    BUNDLED,
+    DISTRIBUTION,
+    BOTH,
+}
+
+#[derive(Debug, Clone, PartialEq, Eq)]
+pub struct ParseItwLibSearch { _priv: () }
+
+impl FromStr for ItwLibSearch {
+
+    type Err = ParseItwLibSearch;
+
+    fn from_str(sstr: &str) -> Result<ItwLibSearch, ParseItwLibSearch> {
+        if sstr == "BOTH" {
+            return Ok(ItwLibSearch::BOTH);
+        }
+        if sstr == "BUNDLED" {
+            return Ok(ItwLibSearch::BUNDLED);
+        }
+        if sstr == "DISTRIBUTION" {
+            return Ok(ItwLibSearch::DISTRIBUTION);
+        }
+        return Err(ParseItwLibSearch { _priv: () })
+    }
+}
+
+pub fn get_libsearch(logger: &os_access::Os) -> ItwLibSearch {
+    let itw_libs_override = env::var("ITW_LIBS");
+    match itw_libs_override {
+        Ok(result_of_override_var) => match ItwLibSearch::from_str(&result_of_override_var) {
+            Ok(result_of_override_to_enum) => {
+                return result_of_override_to_enum;
+            }
+            _Err => {
+                let mut info = String::new();
+                write!(&mut info, "ITW-LIBS provided, but have invalid value of {}. Use BUNDLED, DISTRIBUTION or BOTH", result_of_override_var);
+                logger.info(&info);
+            }
+        }
+        _error => {
+            //no op, continuing via get_itwlibsearch
+        }
+    }
+    match ItwLibSearch::from_str(get_itwlibsearch()) {
+        Ok(v) => {
+            return v
+        }
+        _Err=> {
+            panic!("itw-lib search out of range");
+        }
+    }
+}
+
 
 /*new variables*/
 
 /*tests*/
 #[cfg(test)]
 mod tests {
+    use std::str::FromStr;
+
     #[test]
     fn variables_non_default() {
         assert_ne!(String::from(super::get_jre()).trim(), String::from("JRE-dev-unspecified"));
@@ -44,6 +134,9 @@
         assert_ne!(String::from(super::get_main()).trim(), String::from("MAIN_CLASS-dev-unspecified"));
         assert_ne!(String::from(super::get_name()).trim(), String::from("PROGRAM_NAME-dev-unspecified"));
         assert_ne!(String::from(super::get_bin()).trim(), String::from("BIN_LOCATION-dev-unspecified"));
+        assert_ne!(String::from(super::get_splash()).trim(), String::from("SPLASH_PNG-dev-unspecified"));
+        assert_ne!(String::from(super::get_netx()).trim(), String::from("NETX_JAR-dev-unspecified"));
+        assert_ne!(String::from(super::get_itwlibsearch()).trim(), String::from("ITW_LIBS-dev-unspecified"));
     }
 
     #[test]
@@ -53,5 +146,21 @@
         assert_ne!(String::from(super::get_main()).trim(), String::from(""));
         assert_ne!(String::from(super::get_name()).trim(), String::from(""));
         assert_ne!(String::from(super::get_bin()).trim(), String::from(""));
+        assert_ne!(String::from(super::get_splash()).trim(), String::from(""));
+        assert_ne!(String::from(super::get_netx()).trim(), String::from(""));
+        assert_ne!(String::from(super::get_itwlibsearch()).trim(), String::from(""));
+    }
+
+    #[test]
+    fn get_itwlibsearch_in_enumeration() {
+        assert_eq!(super::get_itwlibsearch() == "BOTH" || super::get_itwlibsearch() == "BUNDLED" || super::get_itwlibsearch() == "DISTRIBUTION", true);
+    }
+
+    #[test]


More information about the distro-pkg-dev mailing list