~vcs-imports/xena/trunk

« back to all changes in this revision

Viewing changes to ext/src/javahelp/jhMaster/JavaHelp/javahelp/bin/jhsearch

  • Committer: matthewoliver
  • Date: 2009-12-10 03:18:07 UTC
  • Revision ID: vcs-imports@canonical.com-20091210031807-l086qguzdlljtkl9
Merged Xena Testing into Xena Stable for the Xena 5 release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/sh
 
2
# This searches a search database.  Argument is the database directory
 
3
 
 
4
# Cygwin support.  $cygwin _must_ be set to either true or false.
 
5
case "`uname`" in
 
6
  CYGWIN*) cygwin=true ;;
 
7
  *) cygwin=false ;;
 
8
esac
 
9
 
 
10
# For Cygwin, ensure paths are in UNIX format before anything is touched
 
11
if $cygwin; then
 
12
  [ -n "$JAVAHELP_HOME" ] &&
 
13
    JAVAHELP_HOME=`cygpath --unix "$JAVAHELP_HOME"`
 
14
fi
 
15
 
 
16
if [ "$JAVAHELP_HOME" = "" ] ; then
 
17
  # try to find jhindexer
 
18
  if [ -d /opt/javahelp ] ; then 
 
19
    JAVAHELP_HOME=/opt/javahelp
 
20
  fi
 
21
 
 
22
  if [ -d ${HOME}/opt/jhindexer ] ; then 
 
23
    JAVAHELP_HOME=${HOME}/opt/javahelp
 
24
  fi
 
25
 
 
26
  ## resolve links - $0 may be a link to javahelp's home
 
27
  PRG=$0
 
28
  progname=`basename $0`
 
29
  
 
30
  while [ -h "$PRG" ] ; do
 
31
    ls=`ls -ld "$PRG"`
 
32
    link=`expr "$ls" : '.*-> \(.*\)$'`
 
33
    if expr "$link" : '.*/.*' > /dev/null; then
 
34
        PRG="$link"
 
35
    else
 
36
        PRG="`dirname $PRG`/$link"
 
37
    fi
 
38
  done
 
39
  
 
40
  JAVAHELP_HOME=`dirname "$PRG"`/../..
 
41
 
 
42
fi
 
43
 
 
44
# For Cygwin, switch paths to Windows format before running java
 
45
if $cygwin; then
 
46
  JAVAHELP_HOME=`cygpath --path --windows "$JAVAHELP_HOME"`
 
47
fi
 
48
 
 
49
java -jar $JAVAHELP_HOME/javahelp/bin/jhsearch.jar "$@"