fold Build/SysConfig.hs into BuildInfo via include
This avoids warnings from stack about the module not being listed in the cabal file. So, the generated file is also renamed to Build/SysConfig. Note that the setup program seems to be cached despite these changes; I had to cabal clean to get cabal to update it so that Build/SysConfig was written. This commit was sponsored by Jochen Bartl on Patreon.
This commit is contained in:
parent
ad6683e722
commit
308cd1383c
24 changed files with 64 additions and 63 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -4,7 +4,7 @@ Setup
|
||||||
*.o
|
*.o
|
||||||
tmp
|
tmp
|
||||||
test
|
test
|
||||||
Build/SysConfig.hs
|
Build/SysConfig
|
||||||
Build/InstallDesktopFile
|
Build/InstallDesktopFile
|
||||||
Build/EvilSplicer
|
Build/EvilSplicer
|
||||||
Build/Standalone
|
Build/Standalone
|
||||||
|
|
|
@ -25,7 +25,7 @@ module Annex.Ssh (
|
||||||
|
|
||||||
import Annex.Common
|
import Annex.Common
|
||||||
import Annex.LockFile
|
import Annex.LockFile
|
||||||
import qualified Build.SysConfig as SysConfig
|
import qualified BuildInfo
|
||||||
import qualified Annex
|
import qualified Annex
|
||||||
import qualified Git
|
import qualified Git
|
||||||
import qualified Git.Url
|
import qualified Git.Url
|
||||||
|
@ -138,7 +138,7 @@ sshConnectionCachingParams socketfile =
|
||||||
- a different filesystem. -}
|
- a different filesystem. -}
|
||||||
sshCacheDir :: Annex (Maybe FilePath)
|
sshCacheDir :: Annex (Maybe FilePath)
|
||||||
sshCacheDir
|
sshCacheDir
|
||||||
| SysConfig.sshconnectioncaching =
|
| BuildInfo.sshconnectioncaching =
|
||||||
ifM (fromMaybe True . annexSshCaching <$> Annex.getGitConfig)
|
ifM (fromMaybe True . annexSshCaching <$> Annex.getGitConfig)
|
||||||
( ifM crippledFileSystem
|
( ifM crippledFileSystem
|
||||||
( maybe (return Nothing) usetmpdir =<< gettmpdir
|
( maybe (return Nothing) usetmpdir =<< gettmpdir
|
||||||
|
|
|
@ -16,10 +16,10 @@ module Annex.Url (
|
||||||
import Annex.Common
|
import Annex.Common
|
||||||
import qualified Annex
|
import qualified Annex
|
||||||
import Utility.Url as U
|
import Utility.Url as U
|
||||||
import qualified Build.SysConfig as SysConfig
|
import qualified BuildInfo
|
||||||
|
|
||||||
defaultUserAgent :: U.UserAgent
|
defaultUserAgent :: U.UserAgent
|
||||||
defaultUserAgent = "git-annex/" ++ SysConfig.packageversion
|
defaultUserAgent = "git-annex/" ++ BuildInfo.packageversion
|
||||||
|
|
||||||
getUserAgent :: Annex (Maybe U.UserAgent)
|
getUserAgent :: Annex (Maybe U.UserAgent)
|
||||||
getUserAgent = Annex.getState $
|
getUserAgent = Annex.getState $
|
||||||
|
|
|
@ -48,7 +48,7 @@ import Assistant.Types.UrlRenderer
|
||||||
import qualified Utility.Daemon
|
import qualified Utility.Daemon
|
||||||
import Utility.ThreadScheduler
|
import Utility.ThreadScheduler
|
||||||
import Utility.HumanTime
|
import Utility.HumanTime
|
||||||
import qualified Build.SysConfig as SysConfig
|
import qualified BuildInfo
|
||||||
import Annex.Perms
|
import Annex.Perms
|
||||||
import Utility.LogFile
|
import Utility.LogFile
|
||||||
#ifdef mingw32_HOST_OS
|
#ifdef mingw32_HOST_OS
|
||||||
|
@ -135,7 +135,7 @@ startDaemon assistant foreground startdelay cannotrun listenhost startbrowser =
|
||||||
#else
|
#else
|
||||||
go _webappwaiter = do
|
go _webappwaiter = do
|
||||||
#endif
|
#endif
|
||||||
notice ["starting", desc, "version", SysConfig.packageversion]
|
notice ["starting", desc, "version", BuildInfo.packageversion]
|
||||||
urlrenderer <- liftIO newUrlRenderer
|
urlrenderer <- liftIO newUrlRenderer
|
||||||
#ifdef WITH_WEBAPP
|
#ifdef WITH_WEBAPP
|
||||||
let webappthread = [ assist $ webAppThread d urlrenderer False cannotrun Nothing listenhost webappwaiter ]
|
let webappthread = [ assist $ webAppThread d urlrenderer False cannotrun Nothing listenhost webappwaiter ]
|
||||||
|
|
|
@ -21,7 +21,7 @@ import Assistant.Alert
|
||||||
import Assistant.DaemonStatus
|
import Assistant.DaemonStatus
|
||||||
#ifdef WITH_WEBAPP
|
#ifdef WITH_WEBAPP
|
||||||
import Assistant.WebApp.Types
|
import Assistant.WebApp.Types
|
||||||
import qualified Build.SysConfig
|
import qualified BuildInfo
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
import Control.Concurrent.MVar
|
import Control.Concurrent.MVar
|
||||||
|
@ -103,7 +103,7 @@ showSuccessfulUpgrade urlrenderer = do
|
||||||
(T.pack "Enable Automatic Upgrades")
|
(T.pack "Enable Automatic Upgrades")
|
||||||
urlrenderer ConfigEnableAutomaticUpgradeR
|
urlrenderer ConfigEnableAutomaticUpgradeR
|
||||||
)
|
)
|
||||||
void $ addAlert $ upgradeFinishedAlert button Build.SysConfig.packageversion
|
void $ addAlert $ upgradeFinishedAlert button BuildInfo.packageversion
|
||||||
#else
|
#else
|
||||||
noop
|
noop
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -19,7 +19,7 @@ import Assistant.DaemonStatus
|
||||||
import Assistant.Alert
|
import Assistant.Alert
|
||||||
import Utility.NotificationBroadcaster
|
import Utility.NotificationBroadcaster
|
||||||
import qualified Annex
|
import qualified Annex
|
||||||
import qualified Build.SysConfig
|
import qualified BuildInfo
|
||||||
import qualified Utility.DottedVersion as DottedVersion
|
import qualified Utility.DottedVersion as DottedVersion
|
||||||
import Types.Distribution
|
import Types.Distribution
|
||||||
#ifdef WITH_WEBAPP
|
#ifdef WITH_WEBAPP
|
||||||
|
@ -31,7 +31,7 @@ import qualified Data.Text as T
|
||||||
|
|
||||||
upgraderThread :: UrlRenderer -> NamedThread
|
upgraderThread :: UrlRenderer -> NamedThread
|
||||||
upgraderThread urlrenderer = namedThread "Upgrader" $
|
upgraderThread urlrenderer = namedThread "Upgrader" $
|
||||||
when (isJust Build.SysConfig.upgradelocation) $ do
|
when (isJust BuildInfo.upgradelocation) $ do
|
||||||
{- Check for upgrade on startup, unless it was just
|
{- Check for upgrade on startup, unless it was just
|
||||||
- upgraded. -}
|
- upgraded. -}
|
||||||
unlessM (liftIO checkSuccessfulUpgrade) $
|
unlessM (liftIO checkSuccessfulUpgrade) $
|
||||||
|
@ -63,7 +63,7 @@ checkUpgrade urlrenderer = do
|
||||||
where
|
where
|
||||||
go Nothing = debug [ "Failed to check if upgrade is available." ]
|
go Nothing = debug [ "Failed to check if upgrade is available." ]
|
||||||
go (Just d) = do
|
go (Just d) = do
|
||||||
let installed = DottedVersion.normalize Build.SysConfig.packageversion
|
let installed = DottedVersion.normalize BuildInfo.packageversion
|
||||||
let avail = DottedVersion.normalize $ distributionVersion d
|
let avail = DottedVersion.normalize $ distributionVersion d
|
||||||
let old = DottedVersion.normalize <$> distributionUrgentUpgrade d
|
let old = DottedVersion.normalize <$> distributionUrgentUpgrade d
|
||||||
if Just installed <= old
|
if Just installed <= old
|
||||||
|
|
|
@ -36,7 +36,7 @@ import Utility.UserInfo
|
||||||
import Utility.Gpg
|
import Utility.Gpg
|
||||||
import Utility.FileMode
|
import Utility.FileMode
|
||||||
import qualified Utility.Lsof as Lsof
|
import qualified Utility.Lsof as Lsof
|
||||||
import qualified Build.SysConfig
|
import qualified BuildInfo
|
||||||
import qualified Utility.Url as Url
|
import qualified Utility.Url as Url
|
||||||
import qualified Annex.Url as Url
|
import qualified Annex.Url as Url
|
||||||
import Utility.Tuple
|
import Utility.Tuple
|
||||||
|
@ -329,7 +329,7 @@ downloadDistributionInfo = do
|
||||||
)
|
)
|
||||||
|
|
||||||
distributionInfoUrl :: String
|
distributionInfoUrl :: String
|
||||||
distributionInfoUrl = fromJust Build.SysConfig.upgradelocation ++ ".info"
|
distributionInfoUrl = fromJust BuildInfo.upgradelocation ++ ".info"
|
||||||
|
|
||||||
distributionInfoSigUrl :: String
|
distributionInfoSigUrl :: String
|
||||||
distributionInfoSigUrl = distributionInfoUrl ++ ".sig"
|
distributionInfoSigUrl = distributionInfoUrl ++ ".sig"
|
||||||
|
|
|
@ -21,7 +21,7 @@ import Annex.NumCopies
|
||||||
import Utility.DataUnits
|
import Utility.DataUnits
|
||||||
import Git.Config
|
import Git.Config
|
||||||
import Types.Distribution
|
import Types.Distribution
|
||||||
import qualified Build.SysConfig
|
import qualified BuildInfo
|
||||||
|
|
||||||
import qualified Data.Text as T
|
import qualified Data.Text as T
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ prefsAForm d = PrefsForm
|
||||||
, ("disabled", NoAutoUpgrade)
|
, ("disabled", NoAutoUpgrade)
|
||||||
]
|
]
|
||||||
autoUpgradeLabel
|
autoUpgradeLabel
|
||||||
| isJust Build.SysConfig.upgradelocation = "Auto upgrade"
|
| isJust BuildInfo.upgradelocation = "Auto upgrade"
|
||||||
| otherwise = "Auto restart on upgrade"
|
| otherwise = "Auto restart on upgrade"
|
||||||
|
|
||||||
positiveIntField = check isPositive intField
|
positiveIntField = check isPositive intField
|
||||||
|
|
|
@ -11,7 +11,7 @@ module Assistant.WebApp.Documentation where
|
||||||
|
|
||||||
import Assistant.WebApp.Common
|
import Assistant.WebApp.Common
|
||||||
import Assistant.Install (standaloneAppBase)
|
import Assistant.Install (standaloneAppBase)
|
||||||
import Build.SysConfig (packageversion)
|
import BuildInfo (packageversion)
|
||||||
import BuildInfo
|
import BuildInfo
|
||||||
|
|
||||||
{- The full license info may be included in a file on disk that can
|
{- The full license info may be included in a file on disk that can
|
||||||
|
|
|
@ -24,7 +24,7 @@ import Utility.WebApp
|
||||||
import Utility.Yesod
|
import Utility.Yesod
|
||||||
import Types.Transfer
|
import Types.Transfer
|
||||||
import Utility.Gpg (KeyId)
|
import Utility.Gpg (KeyId)
|
||||||
import Build.SysConfig (packageversion)
|
import BuildInfo (packageversion)
|
||||||
import Types.ScheduledActivity
|
import Types.ScheduledActivity
|
||||||
import Assistant.WebApp.RepoId
|
import Assistant.WebApp.RepoId
|
||||||
import Assistant.WebApp.Pairing
|
import Assistant.WebApp.Pairing
|
||||||
|
|
|
@ -18,7 +18,7 @@ import Types.KeySource
|
||||||
import Utility.Hash
|
import Utility.Hash
|
||||||
import Utility.ExternalSHA
|
import Utility.ExternalSHA
|
||||||
|
|
||||||
import qualified Build.SysConfig as SysConfig
|
import qualified BuildInfo
|
||||||
import qualified Data.ByteString.Lazy as L
|
import qualified Data.ByteString.Lazy as L
|
||||||
import Data.Char
|
import Data.Char
|
||||||
|
|
||||||
|
@ -187,11 +187,11 @@ hashFile hash file filesize = go hash
|
||||||
|
|
||||||
shaHasher :: HashSize -> Integer -> Either (L.ByteString -> String) (String, L.ByteString -> String)
|
shaHasher :: HashSize -> Integer -> Either (L.ByteString -> String) (String, L.ByteString -> String)
|
||||||
shaHasher (HashSize hashsize) filesize
|
shaHasher (HashSize hashsize) filesize
|
||||||
| hashsize == 1 = use SysConfig.sha1 sha1
|
| hashsize == 1 = use BuildInfo.sha1 sha1
|
||||||
| hashsize == 256 = use SysConfig.sha256 sha2_256
|
| hashsize == 256 = use BuildInfo.sha256 sha2_256
|
||||||
| hashsize == 224 = use SysConfig.sha224 sha2_224
|
| hashsize == 224 = use BuildInfo.sha224 sha2_224
|
||||||
| hashsize == 384 = use SysConfig.sha384 sha2_384
|
| hashsize == 384 = use BuildInfo.sha384 sha2_384
|
||||||
| hashsize == 512 = use SysConfig.sha512 sha2_512
|
| hashsize == 512 = use BuildInfo.sha512 sha2_512
|
||||||
| otherwise = error $ "unsupported SHA size " ++ show hashsize
|
| otherwise = error $ "unsupported SHA size " ++ show hashsize
|
||||||
where
|
where
|
||||||
use Nothing hasher = Left $ usehasher hasher
|
use Nothing hasher = Left $ usehasher hasher
|
||||||
|
|
|
@ -11,7 +11,7 @@ module Build.BundledPrograms where
|
||||||
|
|
||||||
import Data.Maybe
|
import Data.Maybe
|
||||||
|
|
||||||
import Build.SysConfig as SysConfig
|
import BuildInfo
|
||||||
|
|
||||||
{- Programs that git-annex uses, to include in the bundle.
|
{- Programs that git-annex uses, to include in the bundle.
|
||||||
-
|
-
|
||||||
|
@ -28,7 +28,7 @@ extraBundledPrograms = catMaybes
|
||||||
-- integrate with the system gpg-agent, etc.
|
-- integrate with the system gpg-agent, etc.
|
||||||
-- On Windows, gpg is bundled with git for windows.
|
-- On Windows, gpg is bundled with git for windows.
|
||||||
#ifndef mingw32_HOST_OS
|
#ifndef mingw32_HOST_OS
|
||||||
[ SysConfig.gpg
|
[ BuildInfo.gpg
|
||||||
#else
|
#else
|
||||||
[
|
[
|
||||||
#endif
|
#endif
|
||||||
|
@ -75,19 +75,19 @@ preferredBundledPrograms = catMaybes
|
||||||
-- wget on OSX has been problematic, looking for certs in the wrong
|
-- wget on OSX has been problematic, looking for certs in the wrong
|
||||||
-- places. Don't ship it, use curl or the OSX's own wget if it has
|
-- places. Don't ship it, use curl or the OSX's own wget if it has
|
||||||
-- one.
|
-- one.
|
||||||
, ifset SysConfig.wget "wget"
|
, ifset BuildInfo.wget "wget"
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
, SysConfig.lsof
|
, BuildInfo.lsof
|
||||||
, SysConfig.gcrypt
|
, BuildInfo.gcrypt
|
||||||
#ifndef mingw32_HOST_OS
|
#ifndef mingw32_HOST_OS
|
||||||
-- All these utilities are included in git for Windows
|
-- All these utilities are included in git for Windows
|
||||||
, ifset SysConfig.curl "curl"
|
, ifset BuildInfo.curl "curl"
|
||||||
, SysConfig.sha1
|
, BuildInfo.sha1
|
||||||
, SysConfig.sha256
|
, BuildInfo.sha256
|
||||||
, SysConfig.sha512
|
, BuildInfo.sha512
|
||||||
, SysConfig.sha224
|
, BuildInfo.sha224
|
||||||
, SysConfig.sha384
|
, BuildInfo.sha384
|
||||||
, Just "cp"
|
, Just "cp"
|
||||||
#endif
|
#endif
|
||||||
#ifdef linux_HOST_OS
|
#ifdef linux_HOST_OS
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{- Checks system configuration and generates SysConfig.hs. -}
|
{- Checks system configuration and generates SysConfig. -}
|
||||||
|
|
||||||
{-# OPTIONS_GHC -fno-warn-tabs #-}
|
{-# OPTIONS_GHC -fno-warn-tabs #-}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{- Tests the system and generates Build.SysConfig.hs. -}
|
{- Tests the system and generates SysConfig. -}
|
||||||
|
|
||||||
{-# OPTIONS_GHC -fno-warn-tabs #-}
|
{-# OPTIONS_GHC -fno-warn-tabs #-}
|
||||||
|
|
||||||
|
@ -42,12 +42,11 @@ instance Show Config where
|
||||||
valuetype (MaybeBoolConfig _) = "Maybe Bool"
|
valuetype (MaybeBoolConfig _) = "Maybe Bool"
|
||||||
|
|
||||||
writeSysConfig :: [Config] -> IO ()
|
writeSysConfig :: [Config] -> IO ()
|
||||||
writeSysConfig config = writeFile "Build/SysConfig.hs" body
|
writeSysConfig config = writeFile "Build/SysConfig" body
|
||||||
where
|
where
|
||||||
body = unlines $ header ++ map show config ++ footer
|
body = unlines $ header ++ map show config ++ footer
|
||||||
header = [
|
header = [
|
||||||
"{- Automatically generated. -}"
|
"{- Automatically generated. -}"
|
||||||
, "module Build.SysConfig where"
|
|
||||||
, ""
|
, ""
|
||||||
]
|
]
|
||||||
footer = []
|
footer = []
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{- git-annex build info reporting
|
{- git-annex build info
|
||||||
-
|
-
|
||||||
- Copyright 2013-2017 Joey Hess <id@joeyh.name>
|
- Copyright 2013-2017 Joey Hess <id@joeyh.name>
|
||||||
-
|
-
|
||||||
|
@ -13,6 +13,8 @@ import Data.List
|
||||||
import Data.Ord
|
import Data.Ord
|
||||||
import qualified Data.CaseInsensitive as CI
|
import qualified Data.CaseInsensitive as CI
|
||||||
|
|
||||||
|
#include "Build/SysConfig"
|
||||||
|
|
||||||
buildFlags :: [String]
|
buildFlags :: [String]
|
||||||
buildFlags = filter (not . null)
|
buildFlags = filter (not . null)
|
||||||
[ ""
|
[ ""
|
||||||
|
|
|
@ -12,7 +12,7 @@ import qualified Command.Watch
|
||||||
import Annex.Init
|
import Annex.Init
|
||||||
import Annex.Path
|
import Annex.Path
|
||||||
import Config.Files
|
import Config.Files
|
||||||
import qualified Build.SysConfig
|
import qualified BuildInfo
|
||||||
import Utility.HumanTime
|
import Utility.HumanTime
|
||||||
import Assistant.Install
|
import Assistant.Install
|
||||||
|
|
||||||
|
@ -78,7 +78,7 @@ autoStart o = do
|
||||||
f <- autoStartFile
|
f <- autoStartFile
|
||||||
giveup $ "Nothing listed in " ++ f
|
giveup $ "Nothing listed in " ++ f
|
||||||
program <- programPath
|
program <- programPath
|
||||||
haveionice <- pure Build.SysConfig.ionice <&&> inPath "ionice"
|
haveionice <- pure BuildInfo.ionice <&&> inPath "ionice"
|
||||||
pids <- forM dirs $ \d -> do
|
pids <- forM dirs $ \d -> do
|
||||||
putStrLn $ "git-annex autostart in " ++ d
|
putStrLn $ "git-annex autostart in " ++ d
|
||||||
mpid <- catchMaybeIO $ go haveionice program d
|
mpid <- catchMaybeIO $ go haveionice program d
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
module Command.Version where
|
module Command.Version where
|
||||||
|
|
||||||
import Command
|
import Command
|
||||||
import qualified Build.SysConfig as SysConfig
|
import qualified BuildInfo
|
||||||
import Annex.Version
|
import Annex.Version
|
||||||
import BuildInfo
|
import BuildInfo
|
||||||
import Types.Key
|
import Types.Key
|
||||||
|
@ -61,7 +61,7 @@ showVersion = do
|
||||||
|
|
||||||
showPackageVersion :: IO ()
|
showPackageVersion :: IO ()
|
||||||
showPackageVersion = do
|
showPackageVersion = do
|
||||||
vinfo "git-annex version" SysConfig.packageversion
|
vinfo "git-annex version" BuildInfo.packageversion
|
||||||
vinfo "build flags" $ unwords buildFlags
|
vinfo "build flags" $ unwords buildFlags
|
||||||
vinfo "dependency versions" $ unwords dependencyVersions
|
vinfo "dependency versions" $ unwords dependencyVersions
|
||||||
vinfo "key/value backends" $ unwords $
|
vinfo "key/value backends" $ unwords $
|
||||||
|
@ -70,7 +70,7 @@ showPackageVersion = do
|
||||||
|
|
||||||
showRawVersion :: IO ()
|
showRawVersion :: IO ()
|
||||||
showRawVersion = do
|
showRawVersion = do
|
||||||
putStr SysConfig.packageversion
|
putStr BuildInfo.packageversion
|
||||||
hFlush stdout -- no newline, so flush
|
hFlush stdout -- no newline, so flush
|
||||||
|
|
||||||
vinfo :: String -> String -> IO ()
|
vinfo :: String -> String -> IO ()
|
||||||
|
|
|
@ -8,14 +8,14 @@
|
||||||
module Git.BuildVersion where
|
module Git.BuildVersion where
|
||||||
|
|
||||||
import Git.Version
|
import Git.Version
|
||||||
import qualified Build.SysConfig
|
import qualified BuildInfo
|
||||||
|
|
||||||
{- Using the version it was configured for avoids running git to check its
|
{- Using the version it was configured for avoids running git to check its
|
||||||
- version, at the cost that upgrading git won't be noticed.
|
- version, at the cost that upgrading git won't be noticed.
|
||||||
- This is only acceptable because it's rare that git's version influences
|
- This is only acceptable because it's rare that git's version influences
|
||||||
- code's behavior. -}
|
- code's behavior. -}
|
||||||
buildVersion :: GitVersion
|
buildVersion :: GitVersion
|
||||||
buildVersion = normalize Build.SysConfig.gitversion
|
buildVersion = normalize BuildInfo.gitversion
|
||||||
|
|
||||||
older :: String -> Bool
|
older :: String -> Bool
|
||||||
older n = buildVersion < normalize n
|
older n = buildVersion < normalize n
|
||||||
|
|
2
Makefile
2
Makefile
|
@ -113,7 +113,7 @@ docs: mans
|
||||||
clean:
|
clean:
|
||||||
if [ "$(BUILDER)" != ./Setup ] && [ "$(BUILDER)" != cabal ]; then $(BUILDER) clean; fi
|
if [ "$(BUILDER)" != ./Setup ] && [ "$(BUILDER)" != cabal ]; then $(BUILDER) clean; fi
|
||||||
rm -rf tmp dist git-annex $(mans) configure *.tix .hpc \
|
rm -rf tmp dist git-annex $(mans) configure *.tix .hpc \
|
||||||
doc/.ikiwiki html dist tags Build/SysConfig.hs \
|
doc/.ikiwiki html dist tags Build/SysConfig \
|
||||||
Setup Build/InstallDesktopFile Build/EvilSplicer \
|
Setup Build/InstallDesktopFile Build/EvilSplicer \
|
||||||
Build/Standalone Build/OSXMkLibs Build/LinuxMkLibs \
|
Build/Standalone Build/OSXMkLibs Build/LinuxMkLibs \
|
||||||
Build/DistributionUpdate Build/BuildVersion Build/MakeMans \
|
Build/DistributionUpdate Build/BuildVersion Build/MakeMans \
|
||||||
|
|
4
Test.hs
4
Test.hs
|
@ -88,7 +88,7 @@ import qualified Annex.Action
|
||||||
import qualified Logs.View
|
import qualified Logs.View
|
||||||
import qualified Utility.Path
|
import qualified Utility.Path
|
||||||
import qualified Utility.FileMode
|
import qualified Utility.FileMode
|
||||||
import qualified Build.SysConfig
|
import qualified BuildInfo
|
||||||
import qualified Utility.Format
|
import qualified Utility.Format
|
||||||
import qualified Utility.Verifiable
|
import qualified Utility.Verifiable
|
||||||
import qualified Utility.Process
|
import qualified Utility.Process
|
||||||
|
@ -1622,7 +1622,7 @@ test_rsync_remote = intmpclonerepo $ do
|
||||||
annexed_present annexedfile
|
annexed_present annexedfile
|
||||||
|
|
||||||
test_bup_remote :: Assertion
|
test_bup_remote :: Assertion
|
||||||
test_bup_remote = intmpclonerepo $ when Build.SysConfig.bup $ do
|
test_bup_remote = intmpclonerepo $ when BuildInfo.bup $ do
|
||||||
dir <- absPath "dir" -- bup special remote needs an absolute path
|
dir <- absPath "dir" -- bup special remote needs an absolute path
|
||||||
createDirectory dir
|
createDirectory dir
|
||||||
git_annex "initremote" (words $ "foo type=bup encryption=none buprepo="++dir) @? "initremote failed"
|
git_annex "initremote" (words $ "foo type=bup encryption=none buprepo="++dir) @? "initremote failed"
|
||||||
|
|
|
@ -14,7 +14,7 @@ module Utility.CopyFile (
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import Common
|
import Common
|
||||||
import qualified Build.SysConfig as SysConfig
|
import qualified BuildInfo
|
||||||
|
|
||||||
data CopyMetaData
|
data CopyMetaData
|
||||||
-- Copy timestamps when possible, but no other metadata, and
|
-- Copy timestamps when possible, but no other metadata, and
|
||||||
|
@ -34,11 +34,11 @@ copyFileExternal meta src dest = do
|
||||||
where
|
where
|
||||||
#ifndef __ANDROID__
|
#ifndef __ANDROID__
|
||||||
params = map snd $ filter fst
|
params = map snd $ filter fst
|
||||||
[ (SysConfig.cp_reflink_auto, Param "--reflink=auto")
|
[ (BuildInfo.cp_reflink_auto, Param "--reflink=auto")
|
||||||
, (allmeta && SysConfig.cp_a, Param "-a")
|
, (allmeta && BuildInfo.cp_a, Param "-a")
|
||||||
, (allmeta && SysConfig.cp_p && not SysConfig.cp_a
|
, (allmeta && BuildInfo.cp_p && not BuildInfo.cp_a
|
||||||
, Param "-p")
|
, Param "-p")
|
||||||
, (not allmeta && SysConfig.cp_preserve_timestamps
|
, (not allmeta && BuildInfo.cp_preserve_timestamps
|
||||||
, Param "--preserve=timestamps")
|
, Param "--preserve=timestamps")
|
||||||
]
|
]
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
module Utility.Gpg where
|
module Utility.Gpg where
|
||||||
|
|
||||||
import Common
|
import Common
|
||||||
import qualified Build.SysConfig as SysConfig
|
import qualified BuildInfo
|
||||||
#ifndef mingw32_HOST_OS
|
#ifndef mingw32_HOST_OS
|
||||||
import System.Posix.Types
|
import System.Posix.Types
|
||||||
import qualified System.Posix.IO
|
import qualified System.Posix.IO
|
||||||
|
@ -35,7 +35,7 @@ newtype GpgCmd = GpgCmd { unGpgCmd :: String }
|
||||||
- command was found at configure time, use it, or otherwise, "gpg". -}
|
- command was found at configure time, use it, or otherwise, "gpg". -}
|
||||||
mkGpgCmd :: Maybe FilePath -> GpgCmd
|
mkGpgCmd :: Maybe FilePath -> GpgCmd
|
||||||
mkGpgCmd (Just c) = GpgCmd c
|
mkGpgCmd (Just c) = GpgCmd c
|
||||||
mkGpgCmd Nothing = GpgCmd (fromMaybe "gpg" SysConfig.gpg)
|
mkGpgCmd Nothing = GpgCmd (fromMaybe "gpg" BuildInfo.gpg)
|
||||||
|
|
||||||
boolGpgCmd :: GpgCmd -> [CommandParam] -> IO Bool
|
boolGpgCmd :: GpgCmd -> [CommandParam] -> IO Bool
|
||||||
boolGpgCmd (GpgCmd cmd) = boolSystem cmd
|
boolGpgCmd (GpgCmd cmd) = boolSystem cmd
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
module Utility.Lsof where
|
module Utility.Lsof where
|
||||||
|
|
||||||
import Common
|
import Common
|
||||||
import Build.SysConfig as SysConfig
|
import BuildInfo
|
||||||
import Utility.Env
|
import Utility.Env
|
||||||
|
|
||||||
import System.Posix.Types
|
import System.Posix.Types
|
||||||
|
@ -23,12 +23,12 @@ type CmdLine = String
|
||||||
data ProcessInfo = ProcessInfo ProcessID CmdLine
|
data ProcessInfo = ProcessInfo ProcessID CmdLine
|
||||||
deriving (Show)
|
deriving (Show)
|
||||||
|
|
||||||
{- lsof is not in PATH on all systems, so SysConfig may have the absolute
|
{- lsof is not in PATH on all systems, so BuildInfo may have the absolute
|
||||||
- path where the program was found. Make sure at runtime that lsof is
|
- path where the program was found. Make sure at runtime that lsof is
|
||||||
- available, and if it's not in PATH, adjust PATH to contain it. -}
|
- available, and if it's not in PATH, adjust PATH to contain it. -}
|
||||||
setup :: IO ()
|
setup :: IO ()
|
||||||
setup = do
|
setup = do
|
||||||
let cmd = fromMaybe "lsof" SysConfig.lsof
|
let cmd = fromMaybe "lsof" BuildInfo.lsof
|
||||||
when (isAbsolute cmd) $ do
|
when (isAbsolute cmd) $ do
|
||||||
path <- getSearchPath
|
path <- getSearchPath
|
||||||
let path' = takeDirectory cmd : path
|
let path' = takeDirectory cmd : path
|
||||||
|
|
|
@ -33,7 +33,7 @@ module Utility.Url (
|
||||||
|
|
||||||
import Common
|
import Common
|
||||||
import Utility.Tmp
|
import Utility.Tmp
|
||||||
import qualified Build.SysConfig
|
import qualified BuildInfo
|
||||||
|
|
||||||
import Network.URI
|
import Network.URI
|
||||||
import Network.HTTP.Types
|
import Network.HTTP.Types
|
||||||
|
@ -163,7 +163,7 @@ getUrlInfo url uo = case parseURIRelaxed url of
|
||||||
sz <- getFileSize' f stat
|
sz <- getFileSize' f stat
|
||||||
found (Just sz) Nothing
|
found (Just sz) Nothing
|
||||||
Nothing -> dne
|
Nothing -> dne
|
||||||
| Build.SysConfig.curl -> existscurl u
|
| BuildInfo.curl -> existscurl u
|
||||||
| otherwise -> dne
|
| otherwise -> dne
|
||||||
Nothing -> dne
|
Nothing -> dne
|
||||||
where
|
where
|
||||||
|
@ -281,7 +281,7 @@ download' quiet url file uo = do
|
||||||
-}
|
-}
|
||||||
#ifndef __ANDROID__
|
#ifndef __ANDROID__
|
||||||
wgetparams = concat
|
wgetparams = concat
|
||||||
[ if Build.SysConfig.wgetunclutter && not quiet
|
[ if BuildInfo.wgetunclutter && not quiet
|
||||||
then [Param "-nv", Param "--show-progress"]
|
then [Param "-nv", Param "--show-progress"]
|
||||||
else []
|
else []
|
||||||
, [ Param "--clobber", Param "-c", Param "-O"]
|
, [ Param "--clobber", Param "-c", Param "-O"]
|
||||||
|
|
Loading…
Reference in a new issue