/hg/icedtea-web: 2 new changesets

jvanek at icedtea.classpath.org jvanek at icedtea.classpath.org
Wed Aug 26 08:19:10 UTC 2015


changeset 8ab371a45c51 in /hg/icedtea-web
details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=8ab371a45c51
author: Jiri Vanek <jvanek at redhat.com>
date: Wed Aug 26 08:31:49 2015 +0200

	icedteaweb-completion renamed to icedteaweb-completion.in for future repurposing


changeset b1aa74ef87a4 in /hg/icedtea-web
details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=b1aa74ef87a4
author: Jiri Vanek <jvanek at redhat.com>
date: Wed Aug 26 10:18:29 2015 +0200

	Added generation of icedteaweb-completion from sources.

	* Makefile.am: declared BASH_CMPL_DEST_DIR as directory where to install generated icedteaweb-completion. (clean-local) (.PHONY) added clean-icedteaweb-completion (install-exec-local) now creates BASH_CMPL_DEST_DIR and copy icedteaweb-completion to it (uninstall-local) now removes also  BASH_CMPL_DEST_DIR/icedteaweb-completion (icedteaweb-completion), new target, substiture real values from javacode via icedteaweb-completion.in to icedteaweb-completion (stamps/netx-dist.stamp) now depends also on icedteaweb-completion (clean-icedteaweb-completion) new target to remove generated file
	* icedteaweb-completion.in: hardcoded opts value replaced by fields for substitutions
	*netx/net/sourceforge/jnlp/OptionsDefinitions.java: added main method, which can print currently accurate switches


diffstat:

 ChangeLog                                         |  20 ++++++++++
 Makefile.am                                       |  27 +++++++++++--
 icedteaweb-completion                             |  44 -----------------------
 icedteaweb-completion.in                          |  43 ++++++++++++++++++++++
 netx/net/sourceforge/jnlp/OptionsDefinitions.java |  23 ++++++++++-
 5 files changed, 106 insertions(+), 51 deletions(-)

diffs (264 lines):

diff -r c87f010b8cf7 -r b1aa74ef87a4 ChangeLog
--- a/ChangeLog	Tue Aug 25 18:52:07 2015 +0200
+++ b/ChangeLog	Wed Aug 26 10:18:29 2015 +0200
@@ -1,3 +1,23 @@
+2015-08-25  Jiri Vanek  <jvanek at redhat.com>
+            Lukasz Dracz  <ldracz at redhat.com>
+
+	* Makefile.am: declared BASH_CMPL_DEST_DIR as directory where to install
+	generated icedteaweb-completion. (clean-local) (.PHONY) added clean-icedteaweb-completion
+	(install-exec-local) now creates BASH_CMPL_DEST_DIR and copy icedteaweb-completion to it
+	(uninstall-local) now removes also  BASH_CMPL_DEST_DIR/icedteaweb-completion
+	(icedteaweb-completion), new target, substiture real values from javacode
+	via icedteaweb-completion.in to icedteaweb-completion
+	(stamps/netx-dist.stamp) now depends also on icedteaweb-completion
+	(clean-icedteaweb-completion) new target to remove generated file
+	* icedteaweb-completion.in: hardcoded opts value replaced by fields for substitutions
+	*netx/net/sourceforge/jnlp/OptionsDefinitions.java: added main method, which
+	can print currently accurate switches
+
+2015-08-25  Jiri Vanek  <jvanek at redhat.com>
+
+	* icedteaweb-completion: removed, renamed to icedteaweb-completion.in
+	* icedteaweb-completion.in: new file from icedteaweb-completion
+
 2015-08-25  Jiri Vanek  <jvanek at redhat.com>
 
 	Added more tests MixedSigningAndTrustedOnly
diff -r c87f010b8cf7 -r b1aa74ef87a4 Makefile.am
--- a/Makefile.am	Tue Aug 25 18:52:07 2015 +0200
+++ b/Makefile.am	Wed Aug 26 10:18:29 2015 +0200
@@ -18,6 +18,7 @@
 export NETX_SRCDIR = $(abs_top_srcdir)/netx
 export NETX_RESOURCE_DIR=$(NETX_SRCDIR)/net/sourceforge/jnlp/resources
 export ICONS_DEST_DIR=$(DESTDIR)$(datadir)/pixmaps
+export BASH_CMPL_DEST_DIR=$(DESTDIR)$(sysconfdir)/bash_completion.d
 
 export REPORT_STYLES_DIRNAME=report-styles
 
@@ -219,7 +220,7 @@
 
 export PLUGIN_VERSION = IcedTea-Web $(FULL_VERSION)
 
-export EXTRA_DIST = $(top_srcdir)/netx $(top_srcdir)/plugin javaws.png javaws.desktop.in policyeditor.desktop.in icedteaweb-completion \
+export EXTRA_DIST = $(top_srcdir)/netx $(top_srcdir)/plugin javaws.png javaws.desktop.in policyeditor.desktop.in icedteaweb-completion.in \
  itweb-settings.desktop.in launcher $(top_srcdir)/tests html-gen.sh NEW_LINE_IFS
 
 # reproducers `D`shortcuts
@@ -263,18 +264,18 @@
 check-local: $(RHINO_TESTS) $(JUNIT_TESTS)
 
 clean-local: clean-netx clean-plugin clean-liveconnect \
- clean-native-ecj clean-launchers clean-desktop-files clean-docs clean-generated-docs clean-tests clean-bootstrap-directory
+ clean-native-ecj clean-launchers clean-desktop-files clean-docs clean-generated-docs clean-icedteaweb-completion clean-tests clean-bootstrap-directory
 	if [ -e stamps ] ; then \
 	  rmdir stamps ; \
 	fi
 
 .PHONY: clean-IcedTeaPlugin clean-add-netx clean-add-netx-debug clean-add-plugin clean-add-plugin-debug \
- clean-bootstrap-directory clean-native-ecj clean-desktop-files clean-netx-docs clean-docs clean-plugin-docs clean-generated-docs \
+ clean-bootstrap-directory clean-native-ecj clean-desktop-files clean-netx-docs clean-docs clean-plugin-docs clean-generated-docs clean-icedteaweb-completion\
  clean-tests check-local clean-launchers stamps/check-pac-functions.stamp stamps/run-netx-unit-tests.stamp clean-netx-tests \
  clean-junit-runner clean-netx-unit-tests
 
 install-exec-local:
-	${mkinstalldirs} $(DESTDIR)$(bindir) $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/ $(DESTDIR)$(libdir) $(ICONS_DEST_DIR)
+	${mkinstalldirs} $(DESTDIR)$(bindir) $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/ $(DESTDIR)$(libdir) $(ICONS_DEST_DIR) $(BASH_CMPL_DEST_DIR)
 if ENABLE_PLUGIN
 	${INSTALL_PROGRAM} $(PLUGIN_DIR)/$(BUILT_PLUGIN_LIBRARY) $(DESTDIR)$(libdir)
 	${INSTALL_DATA} $(abs_top_builddir)/liveconnect/lib/classes.jar $(DESTDIR)$(datadir)/$(PACKAGE_NAME)/plugin.jar
@@ -282,6 +283,7 @@
 	${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} $(abs_top_srcdir)/javaws.png $(ICONS_DEST_DIR)/
+	${INSTALL_DATA} $(abs_top_builddir)/icedteaweb-completion $(BASH_CMPL_DEST_DIR)/icedteaweb-completion
 	${INSTALL_PROGRAM} launcher.build/$(javaws) $(DESTDIR)$(bindir)
 	${INSTALL_PROGRAM} launcher.build/$(itweb_settings) $(DESTDIR)$(bindir)
 	${INSTALL_PROGRAM} launcher.build/$(policyeditor) $(DESTDIR)$(bindir)
@@ -324,6 +326,7 @@
 	rm -f $(DESTDIR)$(bindir)/$(itweb_settings)
 	rm -f $(DESTDIR)$(bindir)/$(policyeditor)
 	rm -rf $(DESTDIR)$(htmldir)
+	rm -f $(BASH_CMPL_DEST_DIR)/icedteaweb-completion
 
 # Plugin
 
@@ -508,6 +511,18 @@
 	sed -i '/RhinoBasedPacEvaluator/ d' $@
 endif
 
+$(abs_top_builddir)/icedteaweb-completion: $(abs_top_srcdir)/icedteaweb-completion.in
+	OPTIONS_COMMAND="$(SYSTEM_JRE_DIR)/bin/java -cp $(NETX_DIR) net.sourceforge.jnlp.OptionsDefinitions" ;  \
+	JAVAWS=`$$OPTIONS_COMMAND javaws` ; \
+	POLICYEDITOR=`$$OPTIONS_COMMAND policyeditor` ; \
+	ITWEBSETTINGS=`$$OPTIONS_COMMAND itweb-settings`; \
+	echo $$JAVAWS ; \
+	echo $$POLICYEDITOR ; \
+	echo $$ITWEBSETTINGS ; \
+	cat $(abs_top_srcdir)/icedteaweb-completion.in | sed "s/@JAVAWS@/$${JAVAWS}/" \
+	| sed "s/@POLICYEDITOR@/$${POLICYEDITOR}/" | \
+	sed "s/@ITWEBSETTINGS@/$${ITWEBSETTINGS}/" > $(abs_top_builddir)/icedteaweb-completion ;
+
 stamps/generate-docs.stamp: stamps/netx.stamp
 	mkdir -p "$(DOCS_DIR)" ; \
 	HTML_DOCS_TARGET_DIR="$(DOCS_DIR)/html"  ; \
@@ -575,7 +590,7 @@
 	mkdir -p stamps
 	touch $@
 
-stamps/netx-dist.stamp: stamps/netx.stamp $(abs_top_builddir)/netx.manifest stamps/generate-docs.stamp
+stamps/netx-dist.stamp: stamps/netx.stamp $(abs_top_builddir)/netx.manifest stamps/generate-docs.stamp $(abs_top_builddir)/icedteaweb-completion 
 	(cd $(NETX_DIR) ; \
 	 mkdir -p lib ; \
 	 $(SYSTEM_JDK_DIR)/bin/jar cfm lib/classes.jar \
@@ -690,6 +705,8 @@
 	rm -rf "$(DOCS_DIR)"
 	rm -f stamps/generate-docs.stamp
 
+clean-icedteaweb-completion:
+	rm -f $(abs_top_builddir)/icedteaweb-completion
 
 # check
 # ==========================
diff -r c87f010b8cf7 -r b1aa74ef87a4 icedteaweb-completion
--- a/icedteaweb-completion	Tue Aug 25 18:52:07 2015 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-#/bin/bash
-#place this file over to /etc/bash_completion.d/ to make this file useful
-#Note: If you do not have bash-completion you will need to install it
-_itweb-settings()
-{
-    local cur prev opts base
-    cur="${COMP_WORDS[COMP_CWORD]}"
-    prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    # Icedtea-web settings Options
-    opts="-check -get -headless -help -info -list -reset -set -verbose"
-
-    COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
-    return 0
-}
-complete -F _itweb-settings itweb-settings
-
-_policyeditor()
-{
-    local cur prev opts base
-    cur="${COMP_WORDS[COMP_CWORD]}"
-    prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    # PolicyEditor Options
-    opts="-codebase -file -help"
-
-    COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
-    return 0
-}
-complete -F _policyeditor policyeditor
-
-_javaws()
-{
-    local cur prev opts base
-    cur="${COMP_WORDS[COMP_CWORD]}"
-    prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    # JavaWs Options
-    opts="-about -help -license -viewer -Xclearcache -allowredirect -arg -headless -html -jnlp -nosecurity -noupdate -param -property -strict -update -verbose -version -Xignoreheaders -xml -Xnofork -Xoffline -Xtrustnone"
-
-    COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
-    return 0
-}
-complete -F _javaws javaws
diff -r c87f010b8cf7 -r b1aa74ef87a4 icedteaweb-completion.in
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/icedteaweb-completion.in	Wed Aug 26 10:18:29 2015 +0200
@@ -0,0 +1,43 @@
+#/bin/bash
+#place this file over to /etc/bash_completion.d/ to make this file useful
+#Note: If you do not have bash-completion you will need to install it
+_itweb-settings()
+{
+    local cur prev opts base
+    cur="${COMP_WORDS[COMP_CWORD]}"
+    prev="${COMP_WORDS[COMP_CWORD-1]}"
+
+    # Icedtea-web settings Options
+    opts="@ITWEBSETTINGS@"
+
+    COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
+    return 0
+}
+complete -F _itweb-settings itweb-settings
+
+_policyeditor()
+{
+    local cur prev opts base
+    cur="${COMP_WORDS[COMP_CWORD]}"
+    prev="${COMP_WORDS[COMP_CWORD-1]}"
+
+    # PolicyEditor Options
+    opts="@POLICYEDITOR@"
+
+    COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
+    return 0
+}
+complete -F _policyeditor policyeditor
+
+_javaws()
+{
+    local cur prev opts base
+    cur="${COMP_WORDS[COMP_CWORD]}"
+    prev="${COMP_WORDS[COMP_CWORD-1]}"
+
+    # JavaWs Options
+    opts="@JAVAWS@"
+    COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
+    return 0
+}
+complete -F _javaws javaws
diff -r c87f010b8cf7 -r b1aa74ef87a4 netx/net/sourceforge/jnlp/OptionsDefinitions.java
--- a/netx/net/sourceforge/jnlp/OptionsDefinitions.java	Tue Aug 25 18:52:07 2015 +0200
+++ b/netx/net/sourceforge/jnlp/OptionsDefinitions.java	Wed Aug 26 10:18:29 2015 +0200
@@ -1,4 +1,4 @@
-/* 
+/*
    Copyright (C) 2008 Red Hat, Inc.
 
 This file is part of IcedTea.
@@ -36,11 +36,13 @@
 */
 package net.sourceforge.jnlp;
 
+import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
 
 import static net.sourceforge.jnlp.runtime.Translator.R;
+import net.sourceforge.jnlp.util.docprovider.TextsProvider;
 
 public class OptionsDefinitions {
 
@@ -229,5 +231,22 @@
         return l;
     }
 
-    
+    public static void main(String[] args) throws IOException {
+        if (args[0].equals(TextsProvider.JAVAWS)) {
+            printOptions(getJavaWsOptions());
+        } else if (args[0].equals(TextsProvider.ITWEB_SETTINGS)) {
+            printOptions(getItwsettingsCommands());
+        } else if (args[0].equals(TextsProvider.POLICY_EDITOR)) {
+            printOptions(getPolicyEditorOptions());
+        }
+    }
+
+    private static void printOptions(List<OPTIONS> options) {
+        StringBuilder sb = new StringBuilder();
+        for (OPTIONS option : options) {
+            sb.append(option.option).append(" ");
+        }
+        System.out.println(sb.toString().trim());
+    }
+
 }


More information about the distro-pkg-dev mailing list