/[gentoo-x86]/eclass/java-utils-2.eclass
Gentoo

Diff of /eclass/java-utils-2.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.19 Revision 1.20
522# 522#
523# @param $1 - filename of launcher to create 523# @param $1 - filename of launcher to create
524# @param $2 - options, as follows: 524# @param $2 - options, as follows:
525# --main the.main.class.too.start 525# --main the.main.class.too.start
526# --jar /the/jar/too/launch.jar 526# --jar /the/jar/too/launch.jar
527# --java_args 'Extra arguments to pass too jave' 527# --java_args 'Extra arguments to pass to java'
528# --pkg_args 'extra arguments too pass too the package' 528# --pkg_args 'Extra arguments too pass to the package'
529# --pwd 529# --pwd
530# -into 530# -into
531# -pre 531# -pre
532# ------------------------------------------------------------------------------ 532# ------------------------------------------------------------------------------
533java-pkg_dolauncher() { 533java-pkg_dolauncher() {
540 java-pkg_init_paths_ 540 java-pkg_init_paths_
541 541
542 local name="${1}" 542 local name="${1}"
543 # TODO rename to launcher 543 # TODO rename to launcher
544 local target="${T}/${name}" 544 local target="${T}/${name}"
545 local var_tmp="${T}/launcher_variables_tmp"
545 local target_dir pre 546 local target_dir pre
546 shift 547 shift
547 548
548 echo "#!/bin/bash" > "${target}" 549 # Process the other the rest of the arguments
549 while [[ -n "${1}" && -n "${2}" ]]; do 550 while [[ -n "${1}" && -n "${2}" ]]; do
550 local var=${1} value=${2} 551 local var=${1} value=${2}
551 if [[ "${var:0:2}" == "--" ]]; then 552 if [[ "${var:0:2}" == "--" ]]; then
552 echo "gjl_${var:2}=\"${value}\"" >> "${target}" 553 echo "gjl_${var:2}=\"${value}\"" >> "${var_tmp}"
553 elif [[ "${var}" == "-into" ]]; then 554 elif [[ "${var}" == "-into" ]]; then
554 target_dir="${value}" 555 target_dir="${value}"
555 elif [[ "${var}" == "-pre" ]]; then 556 elif [[ "${var}" == "-pre" ]]; then
556 pre="${value}" 557 pre="${value}"
557 fi 558 fi
558 shift 2 559 shift 2
559 done 560 done
561
562 # Write the actual script
563 echo "#!/bin/bash" > "${target}"
564 [[ -n "${pre}" ]] && [[ -f "${pre}" ]] && cat "${pre}" >> "${target}"
560 echo "gjl_package=${JAVA_PKG_NAME}" >> "${target}" 565 echo "gjl_package=${JAVA_PKG_NAME}" >> "${target}"
561 [[ -n "${pre}" ]] && [[ -f "${pre}" ]] && cat "${pre}" >> "${target}" 566 cat "${var_tmp}" >> "${target}"
562 echo "source /usr/share/java-config-2/launcher/launcher.bash" >> "${target}" 567 echo "source /usr/share/java-config-2/launcher/launcher.bash" >> "${target}"
563 568
564 if [[ -n "${target_dir}" ]]; then 569 if [[ -n "${target_dir}" ]]; then
565 DESTTREE="${target_dir}" dobin "${target}" 570 DESTTREE="${target_dir}" dobin "${target}"
566 local ret=$? 571 local ret=$?

Legend:
Removed from v.1.19  
changed lines
  Added in v.1.20

  ViewVC Help
Powered by ViewVC 1.1.20