From 04c99bf7e54cda6bcfbe7a06314ca115240602ee Mon Sep 17 00:00:00 2001 From: "https://www.google.com/accounts/o8/id?id=AItOawmqz6wCn-Q1vzrsHGvEJHOt_T5ZESilxhc" Date: Sat, 5 Apr 2014 20:33:26 +0000 Subject: [PATCH] --- ..._nautilus_script_directory_is_missing.mdwn | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 doc/bugs/git-annex_fails_to_start_when_nautilus_script_directory_is_missing.mdwn diff --git a/doc/bugs/git-annex_fails_to_start_when_nautilus_script_directory_is_missing.mdwn b/doc/bugs/git-annex_fails_to_start_when_nautilus_script_directory_is_missing.mdwn new file mode 100644 index 0000000000..1fa0f4acc9 --- /dev/null +++ b/doc/bugs/git-annex_fails_to_start_when_nautilus_script_directory_is_missing.mdwn @@ -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 +"""]]