diff --git a/Assistant/Install.hs b/Assistant/Install.hs index 97f2dee940..6fa30f2507 100644 --- a/Assistant/Install.hs +++ b/Assistant/Install.hs @@ -39,7 +39,7 @@ ensureInstalled = go =<< standaloneAppBase where go Nothing = noop go (Just base) = do - let program = base ++ "runshell git-annex" + let program = base <$> "git-annex" programfile <- programFile createDirectoryIfMissing True (parentDir programfile) writeFile programfile program diff --git a/debian/changelog b/debian/changelog index 37c322acdf..e2bdd6046e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,7 @@ git-annex (3.20121128) UNRELEASED; urgency=low * webapp: Defaults to sharing box.com account info with friends, allowing one-click enabling of the repository. + * Fix broken .config/git-annex/program installed by standalone tarball. -- Joey Hess Wed, 28 Nov 2012 13:31:07 -0400 diff --git a/doc/bugs/wrong_program_path_in___126____47__.config__47__git-annex__47__program.mdwn b/doc/bugs/wrong_program_path_in___126____47__.config__47__git-annex__47__program.mdwn index 7d0de0d87b..ae8496a68c 100644 --- a/doc/bugs/wrong_program_path_in___126____47__.config__47__git-annex__47__program.mdwn +++ b/doc/bugs/wrong_program_path_in___126____47__.config__47__git-annex__47__program.mdwn @@ -16,3 +16,5 @@ git-annex=3.20121127 on Ubuntu 12.04 LTS ## Please provide any additional information below. Otherwise it is working great. + +> I've fixed this. [[done]] --[[Joey]] diff --git a/standalone/linux/git-annex b/standalone/linux/git-annex new file mode 100755 index 0000000000..cda5b569be --- /dev/null +++ b/standalone/linux/git-annex @@ -0,0 +1,25 @@ +#!/bin/sh +base="$(dirname $0)" +if [ ! -d "$base" ]; then + echo "** cannot find base directory (I seem to be $0)" >&2 + exit 1 +fi +if [ ! -e "$base/runshell" ]; then + echo "** cannot find $base/runshell" >&2 + exit 1 +fi + +# Get absolute path to base, to avoid breakage when things change directories. +orig="$(pwd)" +cd "$base" +base="$(pwd)" +cd "$orig" + +# If this is a standalone app, set a variable that git-annex can use to +# install itself. +if [ -e "$base/bin/git-annex" ]; then + GIT_ANNEX_APP_BASE="$base" + export GIT_ANNEX_APP_BASE +fi + +"$base/runshell" git-annex "$@" diff --git a/standalone/osx/git-annex.app/Contents/MacOS/git-annex b/standalone/osx/git-annex.app/Contents/MacOS/git-annex new file mode 100755 index 0000000000..cda5b569be --- /dev/null +++ b/standalone/osx/git-annex.app/Contents/MacOS/git-annex @@ -0,0 +1,25 @@ +#!/bin/sh +base="$(dirname $0)" +if [ ! -d "$base" ]; then + echo "** cannot find base directory (I seem to be $0)" >&2 + exit 1 +fi +if [ ! -e "$base/runshell" ]; then + echo "** cannot find $base/runshell" >&2 + exit 1 +fi + +# Get absolute path to base, to avoid breakage when things change directories. +orig="$(pwd)" +cd "$base" +base="$(pwd)" +cd "$orig" + +# If this is a standalone app, set a variable that git-annex can use to +# install itself. +if [ -e "$base/bin/git-annex" ]; then + GIT_ANNEX_APP_BASE="$base" + export GIT_ANNEX_APP_BASE +fi + +"$base/runshell" git-annex "$@"