From: "Petteri Räty" <betelgeuse@gentoo.org>
To: gentoo-java@lists.gentoo.org
Subject: [gentoo-java] Making the --jar argument to dolauncher optional
Date: Sat, 21 Oct 2006 12:02:30 +0300 [thread overview]
Message-ID: <4539E226.5080701@gentoo.org> (raw)
[-- 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 --]
next reply other threads:[~2006-10-21 9:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-21 9:02 Petteri Räty [this message]
2006-10-21 9:06 ` [gentoo-java] Making the --jar argument to dolauncher optional Petteri Räty
2006-10-21 10:14 ` Petteri Räty
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4539E226.5080701@gentoo.org \
--to=betelgeuse@gentoo.org \
--cc=gentoo-java@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox