Use wget -q --show-progress for less verbose wget output, when built with wget 1.16.

This commit is contained in:
Joey Hess 2014-12-16 14:04:40 -04:00
parent 7aa66cb185
commit c64ede23cd
5 changed files with 72 additions and 28 deletions

View file

@ -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"]