From: Joey Hess Date: Tue, 3 Nov 2015 14:45:33 +0000 (-0400) Subject: When cabal install is run with the desktop file location not writable, display a... X-Git-Tag: archive/raspbian/10.20250416-2+rpi1~1^2~324^2~121 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=628429f1b0788bedad9d5a695ec037ed58099bdc;p=git-annex.git 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 --- diff --git a/Setup.hs b/Setup.hs index a3c1f1cf64..44816774ad 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)") diff --git a/debian/changelog b/debian/changelog index 2f6b9e9df3..df1fa74361 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 Tue, 03 Nov 2015 10:36:43 -0400