aboutsummaryrefslogtreecommitdiff
path: root/Setup.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-11-03 10:45:33 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-11-03 10:47:33 -0400
commit3be3345bb317422ec247f1f19b818bda4d84f4fb (patch)
treeaa63f4a89a941c1d29896ff7cf95a2a5078dd8ef /Setup.hs
parent94b7c09a14f4f554fda6fc2c7fce65d64246344a (diff)
When cabal install is run with the desktop file location not writable, display a warning, but continue successfully.
Installing the desktop file etc is a niceity of git-annex's cabal install, but not a requirement. closes https://github.com/fpco/stackage/issues/726
Diffstat (limited to 'Setup.hs')
-rw-r--r--Setup.hs7
1 files changed, 6 insertions, 1 deletions
diff --git a/Setup.hs b/Setup.hs
index a3c1f1cf6..44816774a 100644
--- a/Setup.hs
+++ b/Setup.hs
@@ -14,6 +14,7 @@ import Control.Applicative
import Control.Monad
import System.Directory
import Data.List
+import Control.Exception
import qualified Build.DesktopFile as DesktopFile
import qualified Build.Configure as Configure
@@ -64,7 +65,11 @@ installManpages copyDest verbosity pkg lbi =
installDesktopFile :: CopyDest -> Verbosity -> PackageDescription -> LocalBuildInfo -> IO ()
installDesktopFile copyDest _verbosity pkg lbi
| progfile copyDest == progfile NoCopyDest =
- DesktopFile.installUser (progfile copyDest)
+ let dest = progfile copyDest
+ in DesktopFile.installUser dest
+ `catch` installerror dest
| otherwise = return ()
where
progfile cd = bindir (absoluteInstallDirs pkg lbi cd) </> "git-annex"
+ installerror :: FilePath -> SomeException -> IO ()
+ installerror dest e = putStrLn ("installation of desktop intrgration files in " ++ dest ++ " did not succeed (" ++ show e ++ "); skipping (set DESTDIR to install these files to a different location)")