diff options
author | Joey Hess <joey@kitenet.net> | 2011-04-17 01:13:21 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2011-04-17 01:13:21 -0400 |
commit | 50cfcdf54b828fbeab532b712e00063ae9e82581 (patch) | |
tree | 1d32f1930baf8d9b13f257ca90ac4de16611effc /Config.hs | |
parent | 89fab6c7b8955ef26e653d539f7be3b70129c15e (diff) |
make encrypted remotes have slightly higher costs
Diffstat (limited to 'Config.hs')
-rw-r--r-- | Config.hs | 17 |
1 files changed, 16 insertions, 1 deletions
@@ -52,10 +52,25 @@ remoteCost r def = do cheapRemoteCost :: Int cheapRemoteCost = 100 semiCheapRemoteCost :: Int -semiCheapRemoteCost = 150 +semiCheapRemoteCost = 110 expensiveRemoteCost :: Int expensiveRemoteCost = 200 +{- Adjust's a remote's cost to reflect it being encrypted. -} +encryptedRemoteCostAdj :: Int +encryptedRemoteCostAdj = 50 + +{- Make sure the remote cost numbers work out. -} +prop_cost_sane :: Bool +prop_cost_sane = False `notElem` + [ expensiveRemoteCost > 0 + , cheapRemoteCost < semiCheapRemoteCost + , semiCheapRemoteCost < expensiveRemoteCost + , cheapRemoteCost + encryptedRemoteCostAdj > semiCheapRemoteCost + , cheapRemoteCost + encryptedRemoteCostAdj < expensiveRemoteCost + , semiCheapRemoteCost + encryptedRemoteCostAdj < expensiveRemoteCost + ] + {- Checks if a repo should be ignored, based either on annex-ignore - setting, or on command-line options. Allows command-line to override - annex-ignore. -} |