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
This commit is contained in:
parent
0717ad4440
commit
628429f1b0
2 changed files with 8 additions and 1 deletions
7
Setup.hs
7
Setup.hs
|
@ -14,6 +14,7 @@ import Control.Applicative
|
||||||
import Control.Monad
|
import Control.Monad
|
||||||
import System.Directory
|
import System.Directory
|
||||||
import Data.List
|
import Data.List
|
||||||
|
import Control.Exception
|
||||||
|
|
||||||
import qualified Build.DesktopFile as DesktopFile
|
import qualified Build.DesktopFile as DesktopFile
|
||||||
import qualified Build.Configure as Configure
|
import qualified Build.Configure as Configure
|
||||||
|
@ -64,7 +65,11 @@ installManpages copyDest verbosity pkg lbi =
|
||||||
installDesktopFile :: CopyDest -> Verbosity -> PackageDescription -> LocalBuildInfo -> IO ()
|
installDesktopFile :: CopyDest -> Verbosity -> PackageDescription -> LocalBuildInfo -> IO ()
|
||||||
installDesktopFile copyDest _verbosity pkg lbi
|
installDesktopFile copyDest _verbosity pkg lbi
|
||||||
| progfile copyDest == progfile NoCopyDest =
|
| progfile copyDest == progfile NoCopyDest =
|
||||||
DesktopFile.installUser (progfile copyDest)
|
let dest = progfile copyDest
|
||||||
|
in DesktopFile.installUser dest
|
||||||
|
`catch` installerror dest
|
||||||
| otherwise = return ()
|
| otherwise = return ()
|
||||||
where
|
where
|
||||||
progfile cd = bindir (absoluteInstallDirs pkg lbi cd) </> "git-annex"
|
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)")
|
||||||
|
|
2
debian/changelog
vendored
2
debian/changelog
vendored
|
@ -3,6 +3,8 @@ git-annex (5.20151103) UNRELEASED; urgency=medium
|
||||||
* Avoid installing desktop file and program file if cabal install
|
* Avoid installing desktop file and program file if cabal install
|
||||||
git-annex is run as root, since that is not a systemwide 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.
|
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
|
-- Joey Hess <id@joeyh.name> Tue, 03 Nov 2015 10:36:43 -0400
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue