/[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.4 Revision 1.5
206# Records an already installed jar in the package.env 206# Records an already installed jar in the package.env
207# This would mostly be used if the package has make or a custom script to 207# This would mostly be used if the package has make or a custom script to
208# install things. 208# install things.
209# 209#
210# Example: 210# Example:
211# java-pkg-regjar ${D}/opt/foo/lib/foo.jar 211# java-pkg_regjar ${D}/opt/foo/lib/foo.jar
212#
213# WARNING:
214# if you want to use shell expansion, you have to use ${D}/... as the for in
215# this function will not be able to expand the path, here's an example:
216#
217# java-pkg_regjar /opt/my-java/lib/*.jar
218#
219# will not work, because:
220# * the `for jar in "$@"` can't expand the path to jar file names, as they
221# don't exist yet
222# * all `if ...` inside for will fail - the file '/opt/my-java/lib/*.jar'
223# doesn't exist
224#
225# you have to use it as:
226#
227# java-pkg_regjar ${D}/opt/my-java/lib/*.jar
212# 228#
213# @param $@ - jars to record 229# @param $@ - jars to record
214# ------------------------------------------------------------------------------ 230# ------------------------------------------------------------------------------
215# TODO fix me! 231# TODO fix me!
216java-pkg_regjar() { 232java-pkg_regjar() {
224 240
225 local jar jar_dir jar_file 241 local jar jar_dir jar_file
226 for jar in "$@"; do 242 for jar in "$@"; do
227 # TODO use java-pkg_check-versioned-jar 243 # TODO use java-pkg_check-versioned-jar
228 if [[ -e "${jar}" ]]; then 244 if [[ -e "${jar}" ]]; then
245 # nelchael: we should strip ${D} in this case too, here's why:
246 # imagine such call:
247 # java-pkg_regjar ${D}/opt/java/*.jar
248 # such call will fall into this case (-e ${jar}) and will
249 # record paths with ${D} in package.env
229 java-pkg_append_ JAVA_PKG_CLASSPATH "${jar}" 250 java-pkg_append_ JAVA_PKG_CLASSPATH "${jar#${D}}"
230 elif [[ -e "${D}${jar}" ]]; then 251 elif [[ -e "${D}${jar}" ]]; then
231 java-pkg_append_ JAVA_PKG_CLASSPATH "${jar#${D}}" 252 java-pkg_append_ JAVA_PKG_CLASSPATH "${jar#${D}}"
232 else 253 else
233 die "${jar} does not exist" 254 die "${jar} does not exist"
234 fi 255 fi

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

  ViewVC Help
Powered by ViewVC 1.1.20