summaryrefslogtreecommitdiff
path: root/Build/Configure.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2014-12-16 14:04:40 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2014-12-16 14:04:40 -0400
commit95418cc430284b65af13105f7c63da08908dd826 (patch)
tree9afab6aad8025f454b12b038936f6322b6a82f1c /Build/Configure.hs
parentbe93817b5bd80b051d5037e0641b63c16838b5fa (diff)
Use wget -q --show-progress for less verbose wget output, when built with wget 1.16.
Diffstat (limited to 'Build/Configure.hs')
-rw-r--r--Build/Configure.hs16
1 files changed, 16 insertions, 0 deletions
diff --git a/Build/Configure.hs b/Build/Configure.hs
index 31b7ccd25..0a0e87c3a 100644
--- a/Build/Configure.hs
+++ b/Build/Configure.hs
@@ -10,10 +10,13 @@ import Control.Monad
import Build.TestConfig
import Build.Version
+import Utility.PartialPrelude
+import Utility.Process
import Utility.SafeCommand
import Utility.ExternalSHA
import Utility.Env
import qualified Git.Version
+import Utility.DottedVersion
tests :: [TestCase]
tests =
@@ -29,6 +32,7 @@ tests =
, TestCase "rsync" $ requireCmd "rsync" "rsync --version >/dev/null"
, TestCase "curl" $ testCmd "curl" "curl --version >/dev/null"
, TestCase "wget" $ testCmd "wget" "wget --version >/dev/null"
+ , TestCase "wget supports -q --show-progress" checkWgetQuietProgress
, TestCase "bup" $ testCmd "bup" "bup --version >/dev/null"
, TestCase "nice" $ testCmd "nice" "nice true >/dev/null"
, TestCase "ionice" $ testCmd "ionice" "ionice -c3 true >/dev/null"
@@ -96,6 +100,18 @@ getGitVersion = do
error $ "installed git version " ++ show v ++ " is too old! (Need " ++ show oldestallowed ++ " or newer)"
return $ Config "gitversion" $ StringConfig $ show v
+checkWgetQuietProgress :: Test
+checkWgetQuietProgress = Config "wgetquietprogress" . BoolConfig
+ . maybe False (>= normalize "1.16")
+ <$> getWgetVersion
+
+getWgetVersion :: IO (Maybe DottedVersion)
+getWgetVersion = extract <$> readProcess "wget" ["--version"]
+ where
+ extract s = case lines s of
+ [] -> Nothing
+ (l:_) -> normalize <$> headMaybe (drop 2 $ words l)
+
getSshConnectionCaching :: Test
getSshConnectionCaching = Config "sshconnectioncaching" . BoolConfig <$>
boolSystem "sh" [Param "-c", Param "ssh -o ControlPersist=yes -V >/dev/null 2>/dev/null"]