[pkg-java] r5616 - in branches/freemind/BRANCH_0.8/debian: . patches

ewl-guest at alioth.debian.org ewl-guest at alioth.debian.org
Wed Feb 6 18:26:20 UTC 2008


Author: ewl-guest
Date: 2008-02-06 18:26:20 +0000 (Wed, 06 Feb 2008)
New Revision: 5616

Added:
   branches/freemind/BRANCH_0.8/debian/patches/54_better_freemind_sh.patch
Modified:
   branches/freemind/BRANCH_0.8/debian/freemind.sgml
Log:
Use a better freemind.sh script, with more DEBUG options.


Modified: branches/freemind/BRANCH_0.8/debian/freemind.sgml
===================================================================
--- branches/freemind/BRANCH_0.8/debian/freemind.sgml	2008-02-06 18:04:59 UTC (rev 5615)
+++ branches/freemind/BRANCH_0.8/debian/freemind.sgml	2008-02-06 18:26:20 UTC (rev 5616)
@@ -97,9 +97,11 @@
         <term><option>DEBUG</option>
         </term>
         <listitem>
-          <para>If  this environment variable is set, freemind gives more
-	  information on how it finds its different elements, as well as some
-	      other information.</para>
+          <para>If this environment variable is set and non-empty, freemind gives
+	  more information on how it finds its different elements, as well as some
+          other information. If the variable contains 'exit', the script
+	  exits without starting FreeMind, and if it contains 'script',
+	  <command>set -x</command> is called.</para>
         </listitem>
       </varlistentry>
       <varlistentry>

Added: branches/freemind/BRANCH_0.8/debian/patches/54_better_freemind_sh.patch
===================================================================
--- branches/freemind/BRANCH_0.8/debian/patches/54_better_freemind_sh.patch	                        (rev 0)
+++ branches/freemind/BRANCH_0.8/debian/patches/54_better_freemind_sh.patch	2008-02-06 18:26:20 UTC (rev 5616)
@@ -0,0 +1,139 @@
+diff -Nur freemind-0.8.1/freemind/freemind.sh freemind-0.8.1.new/freemind/freemind.sh
+--- freemind-0.8.1/freemind/freemind.sh	2008-02-06 19:16:58.000000000 +0100
++++ freemind-0.8.1.new/freemind/freemind.sh	2008-02-06 19:20:09.000000000 +0100
+@@ -9,6 +9,18 @@
+ #             and enhance debug mode.
+ # 2005-11-08, adding commons-codec to classpath.
+ # 2005-11-09, add some dpkg/rpm information and check for Sun/Blackdown VM.
++# 2006-10-29, follow links to this script using readlink.
++# 2008-02-02, improve Java recognition, add lsb_release, fix -x which being empty
++#             add -Dgnu.java.awt.peer.gtk.Graphics=Graphics2D for non-Sun JREs
++# 2008-02-03, add debug values script and exit
++
++# we only want to test the script, not FreeMind itself
++if ( echo "${DEBUG}" | grep -qe "script" )
++then
++	set -x
++fi
++
++########## FUNCTIONS DEFINITIONS #######################################
+ 
+ _debug() {
+ 	if [ -n "${DEBUG}" ]
+@@ -64,22 +76,22 @@
+ 		then
+ 			"$JAVACMD" -version >&2
+ 		fi
+-		if (! "${JAVACMD}" -version 2>&1 | grep -qe \
+-			'Java(TM) 2 Runtime Environment, Standard Edition')
++		if (! "${JAVACMD}" -version 2>&1 | grep -qe 'Java(TM)')
+ 		then
+-			_error "Your Java virtual machine is neither Sun nor Blackdown," \
++			_error "Your Java is not a derivative from Sun's code," \
+ 			       "=======================================" \
+ 			       "FREEMIND WILL MOST PROBABLY *NOT* WORK," \
+ 			       "=======================================" \
+ 			       "define JAVACMD, JAVA_BINDIR, JAVA_HOME or PATH in order" \
+ 			       "to point to such a VM. See the manpage of freemind(1) for details."
+-			return 0
++			JAVA_TYPE=other
++		else
++			JAVA_TYPE=sun
+ 		fi
+ 		return 0
+ 	else
+ 		_error "Couldn't find a java virtual machine," \
+-		       "define JAVACMD, JAVA_BINDIR, JAVA_HOME or PATH." \
+-		       "See the manpage of freemind(1) for details."
++		       "define JAVACMD, JAVA_BINDIR, JAVA_HOME or PATH."
+ 		return 1
+ 	fi
+ }
+@@ -92,26 +104,36 @@
+ 	fi
+ }
+ 
+-output_info() {
++output_debug_info() {
+ 	if [ -z "${DEBUG}" ]
+ 	then
+ 		return 0
+ 	fi
+ 	_debug "Freemind parameters are '${@}'."
+ 	_debug "$(uname -a)"
+-	if [ -x $(which dpkg) ]
++	if [ -x "$(which lsb_release 2>/dev/null)" ]
++	then
++		_debug "$(lsb_release -a)"
++	else
++		_debug "System is not LSB conform, 'lsb_release' does not exist."
++	fi
++	if [ -x "$(which dpkg 2>/dev/null)" ]
+ 	then
+ 		_debug "The following DEB packages are installed:"
+-		COLUMNS=132 dpkg -l \*freemind\* \*j\* | grep -v '<none>' >&2
+-	elif [ -x $(which rpm) ]
++		COLUMNS=132 dpkg -l | grep -i -e freemind >&2
++	elif [ -x "$(which rpm 2>/dev/null)" ]
+ 	then
+ 		_debug "The following RPM packages are installed:"
+-		rpm -qa | grep -i -e freemind -e j >&2
++		rpm -qa | grep -i -e freemind >&2
+ 	else
+ 		_debug "Neither dpkg nor rpm is installed."
+ 	fi
+ }
+ 
++########## START MAIN PART #############################################
++
++#--------- Put the environment together --------------------------------
++
+ _source /etc/freemind/freemindrc
+ _source ~/.freemind/freemindrc
+ 
+@@ -121,9 +143,18 @@
+ 	exit 1
+ fi
+ 
+-output_info
++output_debug_info
+ 
+-freepath=$(dirname "$0")
++if [ -L "$0" ] && [ -x $(which readlink) ]
++then # if the script is a link and we have 'readlink' to follow it
++	# -m should be faster and link does always resolve, else this script
++	# wouldn't be called, would it?
++	freefile=$(readlink -mn "$0")
++	_debug "Link '$0' resolved to '${freefile}'."
++else
++	freefile="$0"
++fi
++freepath=$(dirname "${freefile}")
+ freepath="${freepath%/bin}" # nothing happens if freemind is not installed
+                             # under something/bin
+ 
+@@ -156,6 +187,8 @@
+ 	cp /etc/freemind/patterns.xml ~/.freemind/patterns.xml
+ fi
+ 
++#--------- Call (at last) FreeMind -------------------------------------
++
+ # The CLASSPATH also lets one specify additional jars, which is good, if
+ # you want to add a new Look&Feel jar (the motif one is so ugly...).
+ # 
+@@ -172,5 +205,13 @@
+ /usr/share/java/relaxngDatatype.jar:\
+ /usr/share/java/commons-codec.jar:\
+ ${freedir}"
+-_debug "Calling: '${JAVACMD} -Dgnu.java.awt.peer.gtk.Graphics=Graphics2D -Dfreemind.base.dir=${freedir} -cp ${CLASSPATH} freemind.main.FreeMind  $@'."
+-"${JAVACMD}" -Dgnu.java.awt.peer.gtk.Graphics=Graphics2D -Dfreemind.base.dir="${freedir}" -cp "${CLASSPATH}" freemind.main.FreeMind "$@"
++if [ "${JAVA_TYPE}" = "sun" ]
++then
++	_debug "Calling: '${JAVACMD} -Dfreemind.base.dir=${freedir} -cp ${CLASSPATH} freemind.main.FreeMindStarter  $@'."
++	( echo "${DEBUG}" | grep -qe "exit" ) && exit 0 # do not start FreeMind
++	"${JAVACMD}" -Dfreemind.base.dir="${freedir}" -cp "${CLASSPATH}" freemind.main.FreeMindStarter "$@"
++else # non-Sun environments don't work currently.
++	_debug "Calling: '${JAVACMD} -Dgnu.java.awt.peer.gtk.Graphics=Graphics2D -Dfreemind.base.dir=${freedir} -cp ${CLASSPATH} freemind.main.FreeMindStarter  $@'."
++	( echo "${DEBUG}" | grep -qe "exit" ) && exit 0 # do not start FreeMind
++	"${JAVACMD}" -Dgnu.java.awt.peer.gtk.Graphics=Graphics2D -Dfreemind.base.dir="${freedir}" -cp "${CLASSPATH}" freemind.main.FreeMindStarter "$@"
++fi




More information about the pkg-java-commits mailing list