This commit is contained in:
https://www.google.com/accounts/o8/id?id=AItOawmqz6wCn-Q1vzrsHGvEJHOt_T5ZESilxhc 2014-04-05 20:33:26 +00:00 committed by admin
parent 66f7354dae
commit 04c99bf7e5

View file

@ -0,0 +1,46 @@
### Please describe the problem.
Starting the webapp fails if the Nautilus scripts directory doesn't exist.
### What steps will reproduce the problem?
[[!format sh """
$ mv ~/.local/share/nautilus ~/.local/share/nautilus.bak
$ git-annex webapp
git-annex: /home/brunksn/.local/share/nautilus/scripts/git-annex get: openFile: does not exist (No such file or directory)
failed
git-annex: webapp: 1 failed
"""]]
### What version of git-annex are you using? On what operating system?
5.20140402, Debian testing
### Please provide any additional information below.
Workaround for users without Gnome/Nautilus:
[[!format sh """
$ mkdir -p ~/.local/share/nautilus
"""]]
It seems git-annex tries to create the scripts without checking if the actually directory exists. One solution would be to just create it if it doesn't exist or to only write the scripts if it exists already. Patch for the latter below. Works for me but my haskell knowledge is still very limited.
By the way, what is the preferred way to contribute patches for git-annex? I couldn't find any information about that on the website.
[[!format diff """
diff --git a/Assistant/Install.hs b/Assistant/Install.hs
index 4d02c0e..883ca48 100644
--- a/Assistant/Install.hs
+++ b/Assistant/Install.hs
@@ -87,8 +87,9 @@ installNautilus :: FilePath -> IO ()
#ifdef linux_HOST_OS
installNautilus program = do
scriptdir <- (\d -> d </> "nautilus" </> "scripts") <$> userDataDir
- genscript scriptdir "get"
- genscript scriptdir "drop"
+ whenM (doesDirectoryExist scriptdir) $ do
+ genscript scriptdir "get"
+ genscript scriptdir "drop"
where
genscript scriptdir action =
installscript (scriptdir </> scriptname action) $ unlines
"""]]