summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-03-27 12:55:18 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-03-27 12:55:18 -0400
commitab47dea8053bb1087008dbeec1919a6c5f68863a (patch)
tree89eb2fdb0478047e5a42ffc0695f934b2cb83d3e
parent9bfb1b905de738984d4686b43a3d094bfba12805 (diff)
Fix bug introduced in the last release that broke git-annex sync when git-annex was installed from the standalone tarball.
This was introduced by commit 849a4b1a0d71071a602f552125fd7e25689662db However, the same problem could affect other calls to programPath, specifically some on the assistant. So, I fixed it at a deeper level.
-rw-r--r--Annex/Path.hs25
-rw-r--r--debian/changelog2
-rw-r--r--doc/bugs/git-annex_sync_fails_with___34__error_while_loading_shared_libraries__34__.mdwn1
-rw-r--r--doc/bugs/git_annex_sync_strange_shared_library_error.mdwn44
-rwxr-xr-xstandalone/linux/skel/git-annex3
5 files changed, 23 insertions, 52 deletions
diff --git a/Annex/Path.hs b/Annex/Path.hs
index ac4e77645..8209e5ba0 100644
--- a/Annex/Path.hs
+++ b/Annex/Path.hs
@@ -11,7 +11,9 @@ module Annex.Path where
import Common
import Config.Files
-import System.Environment
+import Utility.Env
+
+import System.Environment (getExecutablePath)
{- A fully qualified path to the currently running git-annex program.
-
@@ -19,15 +21,22 @@ import System.Environment
- well, it returns the complete path to the program. But, on other OSs,
- it might return just the basename. Fall back to reading the programFile,
- or searching for the command name in PATH.
+ -
+ - The standalone build runs git-annex via ld.so, and defeats
+ - getExecutablePath. It sets GIT_ANNEX_PROGRAMPATH to the correct path
+ - to the wrapper script to use.
-}
programPath :: IO FilePath
-programPath = do
+programPath = go =<< getEnv "GIT_ANNEX_PROGRAMPATH"
+ where
+ go (Just p) = return p
+ go Nothing = do
#if MIN_VERSION_base(4,6,0)
- exe <- getExecutablePath
- p <- if isAbsolute exe
- then return exe
- else readProgramFile
+ exe <- getExecutablePath
+ p <- if isAbsolute exe
+ then return exe
+ else readProgramFile
#else
- p <- readProgramFile
+ p <- readProgramFile
#endif
- maybe cannotFindProgram return =<< searchPath p
+ maybe cannotFindProgram return =<< searchPath p
diff --git a/debian/changelog b/debian/changelog
index bb487279b..aa32da69b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -18,6 +18,8 @@ git-annex (5.20150318) UNRELEASED; urgency=medium
command-line length limits and cause the commit to fail. This
only happened when using the assistant in an indirect mode repository.
* Work around curl bug when asked to download an empty url to a file.
+ * Fix bug introduced in the last release that broke git-annex sync
+ when git-annex was installed from the standalone tarball.
-- Joey Hess <id@joeyh.name> Thu, 19 Mar 2015 17:05:32 -0400
diff --git a/doc/bugs/git-annex_sync_fails_with___34__error_while_loading_shared_libraries__34__.mdwn b/doc/bugs/git-annex_sync_fails_with___34__error_while_loading_shared_libraries__34__.mdwn
index fb3f7d434..25a60cb5d 100644
--- a/doc/bugs/git-annex_sync_fails_with___34__error_while_loading_shared_libraries__34__.mdwn
+++ b/doc/bugs/git-annex_sync_fails_with___34__error_while_loading_shared_libraries__34__.mdwn
@@ -43,3 +43,4 @@ git-annex: sync: 2 failed
# End of transcript or log.
"""]]
+> [[fixed|done]] --[[Joey]]
diff --git a/doc/bugs/git_annex_sync_strange_shared_library_error.mdwn b/doc/bugs/git_annex_sync_strange_shared_library_error.mdwn
deleted file mode 100644
index 6e3126693..000000000
--- a/doc/bugs/git_annex_sync_strange_shared_library_error.mdwn
+++ /dev/null
@@ -1,44 +0,0 @@
-### Please describe the problem.
-git annex sync fails with "error while loading shared libraries: hostname: cannot open shared object file: No such file or directory" with hostname being the hostname of the remote git annex repo.
-
-### What steps will reproduce the problem?
-Running "git annex sync" in a normal git annex repo.
-
-### What version of git-annex are you using? On what operating system?
-Arch Linux with git-annex from the git-annex-bin AUR package:
-git-annex version: 5.20150317-g237d5b0
-
-build flags: Assistant Webapp Webapp-secure Pairing Testsuite S3 WebDAV Inotify DBus DesktopNotify XMPP DNS Feeds Quvi TDFA
-
-key/value backends: SHA256E SHA1E SHA512E SHA224E SHA384E SKEIN256E SKEIN512E MD5E SHA256 SHA1 SHA512 SHA224 SHA384 SKEIN256 SKEIN512 MD5 WORM URL
-
-remote types: git gcrypt S3 bup directory rsync web bittorrent webdav tahoe glacier ddar hook external
-
-### Please provide any additional information below.
-people describing the same problem here: <https://aur.archlinux.org/packages/git-annex-bin/>
-
-SSH and normal git operations work fine.
-
-[[!format sh """
-# If you can, paste a complete transcript of the problem occurring here.
-# If the problem is with the git-annex assistant, paste in .git/annex/daemon.log
-[dafo@simon-desktop dokumente_ga]$ git annex sync
-commit ok
-pull leno
-dafo@leno: error while loading shared libraries: dafo@leno: cannot open shared object file: No such file or directory
-fatal: Could not read from remote repository.
-Please make sure you have the correct access rights
-and the repository exists.
-failed
-push leno
-dafo@leno: error while loading shared libraries: dafo@leno: cannot open shared object file: No such file or directory
-fatal: Could not read from remote repository.
-Please make sure you have the correct access rights
-and the repository exists.
- Pushing to leno failed.
- (non-fast-forward problems can be solved by setting receive.denyNonFastforwards to false in the remote's git config)
-failed
-git-annex: sync: 2 failed
-
-# End of transcript or log.
-"""]]
diff --git a/standalone/linux/skel/git-annex b/standalone/linux/skel/git-annex
index 7fc864d87..8b59be23c 100755
--- a/standalone/linux/skel/git-annex
+++ b/standalone/linux/skel/git-annex
@@ -28,4 +28,7 @@ if [ -e "$base/bin/git-annex" ]; then
export GIT_ANNEX_APP_BASE
fi
+GIT_ANNEX_PROGRAMPATH="$0"
+export GIT_ANNEX_PROGRAMPATH
+
exec "$base/runshell" git-annex "$@"