/[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.17 Revision 1.18
597 echo "dowar: warning, skipping directory ${war}" 597 echo "dowar: warning, skipping directory ${war}"
598 continue 598 continue
599 else 599 else
600 warpath="${war}" 600 warpath="${war}"
601 fi 601 fi
602 602
603 # Install those files like you mean it 603 # Install those files like you mean it
604 INSOPTIONS="-m 0644" \ 604 INSOPTIONS="-m 0644" \
605 INSDESTTREE=${JAVA_PKG_WARDEST} \ 605 INSDESTTREE=${JAVA_PKG_WARDEST} \
606 doins ${warpath} 606 doins ${warpath}
607 done 607 done
673 if [[ "${1}" = "--build-only" ]]; then 673 if [[ "${1}" = "--build-only" ]]; then
674 build_only="true" 674 build_only="true"
675 shift 675 shift
676 fi 676 fi
677 677
678 local target_pkg="${1}" target_jar="${2}" destjar="${3}" 678 local target_pkg="${1}" target_jar="${2}" destjar="${3}"
679 679
680 [[ -z ${target_pkg} ]] && die "Must specify a package" 680 [[ -z ${target_pkg} ]] && die "Must specify a package"
681 681
682 # default destjar to the target jar 682 # default destjar to the target jar
683 [[ -z "${destjar}" ]] && destjar="${target_jar}" 683 [[ -z "${destjar}" ]] && destjar="${target_jar}"
684 684
685 local error_msg="There was a problem getting the classpath for ${target_pkg}."
686 local classpath
685 local classpath="$(java-config --classpath=${target_pkg})" 687 classpath="$(java-config --classpath=${target_pkg})"
686 [[ $? != 0 ]] && die "There was a problem getting the classpath for ${target_pkg}" 688 [[ $? != 0 ]] && die ${error_msg}
687 689
688 local jar 690 local jar
689 for jar in ${classpath//:/ }; do 691 for jar in ${classpath//:/ }; do
690 local jar_name=$(basename "${jar}") 692 local jar_name=$(basename "${jar}")
691 if [[ ! -f "${jar}" ]] ; then 693 if [[ ! -f "${jar}" ]] ; then
759 # NOTE could probably just pass $@ to java-config --classpath. and return it 761 # NOTE could probably just pass $@ to java-config --classpath. and return it
760 local classpath pkg 762 local classpath pkg
761 for pkg in ${@//,/ }; do 763 for pkg in ${@//,/ }; do
762 #for pkg in $(echo "$@" | tr ',' ' '); do 764 #for pkg in $(echo "$@" | tr ',' ' '); do
763 jars="$(java-config --classpath=${pkg})" 765 jars="$(java-config --classpath=${pkg})"
766 [[ -z "${jars}" ]] && die "java-config --classpath=${pkg} failed"
764 debug-print "${pkg}:${jars}" 767 debug-print "${pkg}:${jars}"
765 # TODO should we ensure jars exist? 768
766 if [[ -z "${classpath}" ]]; then 769 if [[ -z "${classpath}" ]]; then
767 classpath="${jars}" 770 classpath="${jars}"
768 else 771 else
769 classpath="${classpath}:${jars}" 772 classpath="${classpath}:${jars}"
770 fi 773 fi
805 808
806 local pkg="${1}" target_jar="${2}" jar 809 local pkg="${1}" target_jar="${2}" jar
807 [[ -z ${pkg} ]] && die "Must specify package to get a jar from" 810 [[ -z ${pkg} ]] && die "Must specify package to get a jar from"
808 [[ -z ${target_jar} ]] && die "Must specify jar to get" 811 [[ -z ${target_jar} ]] && die "Must specify jar to get"
809 812
810 # TODO check that package is actually installed 813 local error_msg="Could not find classpath for ${pkg}. Are you sure its installed?"
814 local classpath
811 local classpath=$(java-config --classpath=${pkg}) 815 classpath=$(java-config --classpath=${pkg})
812 [[ $? != 0 ]] && die "There could not find classpath for ${pkg}. Are you sure its installed?" 816 [[ $? != 0 ]] && die ${error_msg}
817
813 for jar in ${classpath//:/ }; do 818 for jar in ${classpath//:/ }; do
814 if [[ ! -f "${jar}" ]] ; then 819 if [[ ! -f "${jar}" ]] ; then
815 die "Installation problem with jar ${jar} in ${pkg} - is it installed?" 820 die "Installation problem with jar ${jar} in ${pkg} - is it installed?"
816 fi 821 fi
817 822

Legend:
Removed from v.1.17  
changed lines
  Added in v.1.18

  ViewVC Help
Powered by ViewVC 1.1.20