-
Notifications
You must be signed in to change notification settings - Fork 444
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BashTemplate - problem resolving relative symlinks on the bash file (not the directory) #39
Comments
I found the setting where it's done, which is rather uncool. The setting should be absolute by default as relative symlink resolution is rather complicated. |
The reason it's relative is actually because I had issues getting the debian file to generate correctly with absolute symlinks. I'm more than happy to take a patch on this. I'm looking into it now. |
Nice. Maybe the symbolic-link logic should be done with: JavaNIO http://docs.oracle.com/javase/tutorial/essential/io/links.html |
I'd love to, except (unfortunately) we're still supporting JDK6. Literally HALF off this code would disappaer/be easier with JDK7, but we're stuck for now. |
# walking up from /usr/share/your-app/bin/your-app to /usr/share/your-app
declare -r app_home=$(dirname $(dirname $(readlink -f $0)))
# TODO - Check whether this is ok in cygwin...
declare -r lib_dir=$app_home/lib not really nice, but it works. However this isn't tested with cygwin. |
Ok, I have a bit more robust fix that retains the current mechanism (which we should try to retain the current realpath, as it fixes a few issues that cropped up on odd systems). Thanks for the patch idea though. Helped me isolate the underlying problem. |
Fixes #39 - Unable to follow symlinks.
Hi,
play-2.2 integrates now the sbt-native-packager plugin. However the [https://github.com/sbt/sbt-native-packager/blob/master/src/main/resources/com/typesafe/sbt/packager/archetypes/bash-template](start script) in a debian package doesn't work, when it's not called within in
/usr/share/<appname>/bin
folder.The problem with the bash script seems to be that
realpath()
cannot handle the relative symlink correctly./usr/bin/<appname>
->../share/<appname>/bin/<appname>
h4. steps to reproduce
play new play-script-test cd play-script-test
Follow ing
build.sbt
Than run
play clean dist debian:packageBin sudo dpkg -i target/play-script-test-1.0.deb # open new console play-script-test
when I run
./<app>
from/usr/share/<app>/bin
everything works. On every other path it fails, as it cannot find the/usr/share/<app>/lib
aka the lib_dir.The text was updated successfully, but these errors were encountered: