2010-11-14 18:44:24 +00:00
|
|
|
{- git-annex upgrade support
|
|
|
|
-
|
|
|
|
- Copyright 2010 Joey Hess <joey@kitenet.net>
|
|
|
|
-
|
|
|
|
- Licensed under the GNU GPL version 3 or higher.
|
|
|
|
-}
|
|
|
|
|
|
|
|
module Upgrade where
|
|
|
|
|
|
|
|
import Types
|
|
|
|
import Version
|
2011-03-16 05:23:20 +00:00
|
|
|
import qualified Upgrade.V0
|
|
|
|
import qualified Upgrade.V1
|
2011-06-22 21:51:48 +00:00
|
|
|
import qualified Upgrade.V2
|
2010-11-14 18:44:24 +00:00
|
|
|
|
|
|
|
{- Uses the annex.version git config setting to automate upgrades. -}
|
|
|
|
upgrade :: Annex Bool
|
|
|
|
upgrade = do
|
|
|
|
version <- getVersion
|
|
|
|
case version of
|
2011-06-22 22:07:45 +00:00
|
|
|
Just "0" -> Upgrade.V0.upgrade
|
|
|
|
Just "1" -> Upgrade.V1.upgrade
|
|
|
|
Just "2" -> Upgrade.V2.upgrade
|
2011-03-19 22:33:39 +00:00
|
|
|
_ -> return True
|