public inbox for gentoo-java@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-java] Making the --jar argument to dolauncher optional
@ 2006-10-21  9:02 Petteri Räty
  2006-10-21  9:06 ` Petteri Räty
  0 siblings, 1 reply; 3+ messages in thread
From: Petteri Räty @ 2006-10-21  9:02 UTC (permalink / raw
  To: gentoo-java


[-- Attachment #1.1: Type: text/plain, Size: 219 bytes --]

When a package only install one jar that has the Main-class attribute
set there should not be any need to specify the --jar argument to
java-pkg_dolauncher so I made the --jar argument optional.

Regards,
Petteri

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: java-utils-2.eclass.patch --]
[-- Type: text/x-patch; name="java-utils-2.eclass.patch", Size: 793 bytes --]

Index: java-utils-2.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/java-utils-2.eclass,v
retrieving revision 1.24
diff -u -r1.24 java-utils-2.eclass
--- java-utils-2.eclass	27 Sep 2006 21:35:54 -0000	1.24
+++ java-utils-2.eclass	21 Oct 2006 08:59:59 -0000
@@ -563,8 +563,10 @@
 	echo "#!/bin/bash" > "${target}"
 	[[ -n "${pre}" ]] && [[ -f "${pre}" ]] && cat "${pre}" >> "${target}"
 	echo "gjl_package=${JAVA_PKG_NAME}" >> "${target}"
-	cat "${var_tmp}" >> "${target}"
-	rm -f "${var_tmp}"
+	if [[ -f "${var_tmp}" ]]; then
+		cat "${var_tmp}" >> "${target}"
+		rm -f "${var_tmp}"
+	fi
 	echo "source /usr/share/java-config-2/launcher/launcher.bash" >> "${target}"
 
 	if [[ -n "${target_dir}" ]]; then

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.3: launcher.bash.patch --]
[-- Type: text/x-patch; name="launcher.bash.patch", Size: 596 bytes --]

Index: launcher.bash
===================================================================
--- launcher.bash	(revision 3104)
+++ launcher.bash	(working copy)
@@ -25,7 +25,13 @@
 elif [[ -n ${gjl_jar} ]]; then
 	request="${request} --get-jar ${gjl_jar}"
 else
-	abort "Need main or jar to start"
+	# Check if the installed package has only one jar and use that
+	jars=$(java-config --classpath=${gjl_package})
+	if [[ "${jars/:}" = "${jars}" ]]; then
+		request="${request} --get-jar ${jars}"
+	else
+		abort "Need main or jar to start"
+	fi
 fi
 
 if [[ -z ${GENTOO_VM} ]]; then

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 252 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-10-21 10:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-21  9:02 [gentoo-java] Making the --jar argument to dolauncher optional Petteri Räty
2006-10-21  9:06 ` Petteri Räty
2006-10-21 10:14   ` Petteri Räty

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox