diff options
author | Joey Hess <joeyh@joeyh.name> | 2015-11-03 10:45:33 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2015-11-03 10:47:33 -0400 |
commit | 3be3345bb317422ec247f1f19b818bda4d84f4fb (patch) | |
tree | aa63f4a89a941c1d29896ff7cf95a2a5078dd8ef /Setup.hs | |
parent | 94b7c09a14f4f554fda6fc2c7fce65d64246344a (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.hs | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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)") |