From 99d60109e26444a1d1bfd9e710573d624e7f7937 Mon Sep 17 00:00:00 2001 From: "http://mildred.fr/" Date: Fri, 13 Dec 2013 11:22:14 +0000 Subject: --- ...6____47__.local__47__bin_for_prebuilt_package.mdwn | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 doc/todo/symlink_git-annex_binaries_to___126____47__.local__47__bin_for_prebuilt_package.mdwn (limited to 'doc/todo/symlink_git-annex_binaries_to___126____47__.local__47__bin_for_prebuilt_package.mdwn') diff --git a/doc/todo/symlink_git-annex_binaries_to___126____47__.local__47__bin_for_prebuilt_package.mdwn b/doc/todo/symlink_git-annex_binaries_to___126____47__.local__47__bin_for_prebuilt_package.mdwn new file mode 100644 index 000000000..516e20f79 --- /dev/null +++ b/doc/todo/symlink_git-annex_binaries_to___126____47__.local__47__bin_for_prebuilt_package.mdwn @@ -0,0 +1,19 @@ +Instead of changing the `PATH`, it should be possible to symlink the binaries to the `~/.local/bin` directory. + +Here is a script I put on the prebuilt package (its basename is unimportant but it must be placed along with the git-annex script): + + #!/bin/sh + link="$(readlink "$0")" + base="$(cd "$(dirname "$0")"; cd "$(dirname "$link")"; echo "$PWD")" + name="$(basename "$0")" + exec "$base/$name" "$@" + +Symlink this script to `~/.local/bin/git-annex`, `~/.local/bin/git-annex-shell` and `~/.local/bin/git-annex-webapp`. on my system I have: + + lrwxrwxrwx. 1 mildred mildred 36 Dec 13 12:12 git-annex -> ../opt/git-annex.linux/run-git-annex + lrwxrwxrwx. 1 mildred mildred 36 Dec 13 12:12 git-annex-shell -> ../opt/git-annex.linux/run-git-annex + lrwxrwxrwx. 1 mildred mildred 36 Dec 13 12:12 git-annex-webapp -> ../opt/git-annex.linux/run-git-annex + +The script will detect the installation directory using `readlink`. Both absolute and relative links works. Then it starts the correct script depending on the basename of the link. + +It should be possible to link the `git-annex`, `git-annex-webapp` and `git-annex-shell` scripts instead if they used `readlink` to find out the location of the prebuilt package. -- cgit v1.2.3