Avoid installing desktop file and program file if cabal install git-annex is run...
authorJoey Hess <joeyh@joeyh.name>
Tue, 3 Nov 2015 14:38:08 +0000 (10:38 -0400)
committerJoey Hess <joeyh@joeyh.name>
Tue, 3 Nov 2015 14:38:08 +0000 (10:38 -0400)
Build/DesktopFile.hs
Setup.hs
debian/changelog

index 9d68ff1d998ea5334475bd517a9b582b4f0ff6e8..cb5a47b691e90f820ce25f5ccd06c9007d76276b 100644 (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 ()
+       )
index f0c9fb4eb88e05e42765001d8b7b1795821d55cd..a3c1f1cf6404f76008462d9249007b24188f5329 100644 (file)
--- a/Setup.hs
+++ b/Setup.hs
@@ -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"
index fed1f76a620778ea89a22b358bfce72621d5e248..2f6b9e9df3170f706bbd2590a637497ee5990050 100644 (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.