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.

This commit is contained in:
Joey Hess 2015-11-03 10:38:08 -04:00
parent 924668f27c
commit 0717ad4440
Failed to extract signature
3 changed files with 15 additions and 1 deletions

View file

@ -79,3 +79,9 @@ install command = do
createDirectoryIfMissing True (parentDir programfile)
writeFile programfile command
)
installUser :: FilePath -> IO ()
installUser command = ifM systemwideInstall
( install command
, return ()
)

View file

@ -64,7 +64,7 @@ installManpages copyDest verbosity pkg lbi =
installDesktopFile :: CopyDest -> Verbosity -> PackageDescription -> LocalBuildInfo -> IO ()
installDesktopFile copyDest _verbosity pkg lbi
| progfile copyDest == progfile NoCopyDest =
DesktopFile.install (progfile copyDest)
DesktopFile.installUser (progfile copyDest)
| otherwise = return ()
where
progfile cd = bindir (absoluteInstallDirs pkg lbi cd) </> "git-annex"

8
debian/changelog vendored
View file

@ -1,3 +1,11 @@
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.
-- Joey Hess <id@joeyh.name> Tue, 03 Nov 2015 10:36:43 -0400
git-annex (5.20151102) unstable; urgency=medium
* Use statvfs on OSX.