From: Vlastimil Babka Date: Mon, 15 Jan 2007 00:01:21 +0000 (+0000) Subject: Make dolauncher die if -pre specifies non-existing file. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=52dafc1613216500e2bd757dcf91e6a7d03a8132;p=gentoo.git Make dolauncher die if -pre specifies non-existing file. ---------------------------------------------------------------------- --- diff --git a/eclass/java-utils-2.eclass b/eclass/java-utils-2.eclass index f6d1c2badc02..6aeaf27dc2c7 100644 --- a/eclass/java-utils-2.eclass +++ b/eclass/java-utils-2.eclass @@ -6,7 +6,7 @@ # # Licensed under the GNU General Public License, v2 # -# $Header: /var/cvsroot/gentoo-x86/eclass/java-utils-2.eclass,v 1.41 2007/01/12 16:12:15 betelgeuse Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/java-utils-2.eclass,v 1.42 2007/01/15 00:01:21 caster Exp $ # ----------------------------------------------------------------------------- @@ -552,10 +552,10 @@ java-pkg_dosrc() { # --main the.main.class.too.start # --jar /the/jar/too/launch.jar or just .jar # --java_args 'Extra arguments to pass to java' -# --pkg_args 'Extra arguments too pass to the package' -# --pwd -# -into -# -pre +# --pkg_args 'Extra arguments to pass to the package' +# --pwd Directory the launcher changes to before executing java +# -into Directory to install the launcher to, instead of /usr/bin +# -pre Prepend contents of this file to the launcher # ------------------------------------------------------------------------------ java-pkg_dolauncher() { debug-print-function ${FUNCNAME} $* @@ -606,7 +606,13 @@ java-pkg_dolauncher() { # Write the actual script echo "#!/bin/bash" > "${target}" - [[ -n "${pre}" ]] && [[ -f "${pre}" ]] && cat "${pre}" >> "${target}" + if [[ -n "${pre}" ]]; then + if [[ -f "${pre}" ]]; then + cat "${pre}" >> "${target}" + else + die "-pre specified file '${pre}' does not exist" + fi + fi echo "gjl_package=${JAVA_PKG_NAME}" >> "${target}" cat "${var_tmp}" >> "${target}" rm -f "${var_tmp}"