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 | |
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
-rw-r--r-- | Setup.hs | 7 | ||||
-rw-r--r-- | debian/changelog | 2 |
2 files changed, 8 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)") diff --git a/debian/changelog b/debian/changelog index 2f6b9e9df..df1fa7436 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,6 +3,8 @@ git-annex (5.20151103) UNRELEASED; urgency=medium * Avoid installing desktop file and program file if cabal install git-annex is run as root, since that is not a systemwide install, but to /root, and so generating a systemwide desktop file is not right. + * When cabal install is run with the desktop file location not writable, + display a warning, but continue successfully. -- Joey Hess <id@joeyh.name> Tue, 03 Nov 2015 10:36:43 -0400 |