oracle / opengrok

OpenGrok is a fast and usable source code search and cross reference engine, written in Java
http://oracle.github.io/opengrok/
Other
4.36k stars 748 forks source link

Handle symlinks correctly for OpenGrok shell script #870

Closed zjj closed 5 years ago

zjj commented 9 years ago

line 99 of OpenGrok shell script opengrokbin=$(readlink -f ${0}) SCRIPT_DIRECTORY="dirname ${opengrokbin}" SCRIPT_DIRECTORY="cd ${SCRIPT_DIRECTORY}; pwd"

A small apporch to that

tarzanek commented 9 years ago

not sure if readlink is portable if you find a better patch I'll gladly accept, otherwise I will figure this out

zjj commented 9 years ago

@tarzanek

man readlink (on linux..., not test on other platform, but you can find this out on Solaris if there is something simliar)

   -f, --canonicalize
          canonicalize  by  following  every symlink in every component of
          the given name recursively; all  but  the  last  component  must
          exist

pi@raspberrypi /tmp/test $ tree . ├── a -> b └── b -> ../bin/OpenGrok

0 directories, 2 files pi@raspberrypi /tmp/test $ readlink -f a /tmp/bin/OpenGrok pi@raspberrypi /tmp $ readlink -f /tmp/bin/OpenGrok /tmp/bin/OpenGrok

tulinkry commented 5 years ago

We no longer use OpenGrok shell script.