summaryrefslogtreecommitdiff
path: root/Build/Configure.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-11-21 17:49:56 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-11-21 17:49:56 -0400
commit40c91a0d45a875b8ef58c42a38fb29f4a608b425 (patch)
tree1ba0bcab443dfad4301d3d824034067d57fce4c3 /Build/Configure.hs
parent5ec99409fa0e4ec617f70c4c87c6f7c8460b61c4 (diff)
upgrade alerts
The webapp will check twice a day, when the network is connected, to see if it can download a distributon upgrade file. If a newer version is found, display an upgrade alert. This will need the autobuilders to set UPGRADE_LOCATION to the url it can be downloaded from when building git-annex. Only builds with that set need automatic upgrade alerts. Currently, the upgrade page just requests the user manually download and upgrade it. But, all the info is provided to do automated upgrades in the future. Note that urls used will need to all be https. This commit was sponsored by Dirk Kraft.
Diffstat (limited to 'Build/Configure.hs')
-rw-r--r--Build/Configure.hs9
1 files changed, 8 insertions, 1 deletions
diff --git a/Build/Configure.hs b/Build/Configure.hs
index 262ac2080..8884d57db 100644
--- a/Build/Configure.hs
+++ b/Build/Configure.hs
@@ -7,7 +7,7 @@ import Data.List
import System.Process
import Control.Applicative
import System.FilePath
-import System.Environment
+import System.Environment (getArgs)
import Data.Maybe
import Control.Monad.IfElse
import Data.Char
@@ -17,11 +17,13 @@ import Build.Version
import Utility.SafeCommand
import Utility.Monad
import Utility.ExternalSHA
+import Utility.Env
import qualified Git.Version
tests :: [TestCase]
tests =
[ TestCase "version" getVersion
+ , TestCase "UPGRADE_LOCATION" getUpgradeLocation
, TestCase "git" $ requireCmd "git" "git --version >/dev/null"
, TestCase "git version" getGitVersion
, testCp "cp_a" "-a"
@@ -90,6 +92,11 @@ testCp k option = TestCase cmd $ testCmd k cmdline
cmd = "cp " ++ option
cmdline = cmd ++ " " ++ testFile ++ " " ++ testFile ++ ".new"
+getUpgradeLocation :: Test
+getUpgradeLocation = do
+ e <- getEnv "UPGRADE_LOCATION"
+ return $ Config "upgradelocation" $ MaybeStringConfig e
+
getGitVersion :: Test
getGitVersion = Config "gitversion" . StringConfig . show
<$> Git.Version.installed