2010-11-14 14:44:24 -04:00
|
|
|
{- git-annex upgrade support
|
|
|
|
-
|
|
|
|
- Copyright 2010 Joey Hess <joey@kitenet.net>
|
|
|
|
-
|
|
|
|
- Licensed under the GNU GPL version 3 or higher.
|
|
|
|
-}
|
|
|
|
|
2013-05-11 15:03:00 -05:00
|
|
|
{-# LANGUAGE CPP #-}
|
|
|
|
|
2010-11-14 14:44:24 -04:00
|
|
|
module Upgrade where
|
|
|
|
|
2011-10-05 16:02:51 -04:00
|
|
|
import Common.Annex
|
2011-10-04 00:40:47 -04:00
|
|
|
import Annex.Version
|
2013-08-04 13:07:55 -04:00
|
|
|
#ifndef mingw32_HOST_OS
|
2011-03-16 01:23:20 -04:00
|
|
|
import qualified Upgrade.V0
|
|
|
|
import qualified Upgrade.V1
|
2013-05-11 15:03:00 -05:00
|
|
|
#endif
|
2011-06-22 17:51:48 -04:00
|
|
|
import qualified Upgrade.V2
|
2010-11-14 14:44:24 -04:00
|
|
|
|
|
|
|
upgrade :: Annex Bool
|
2012-01-10 15:36:54 -04:00
|
|
|
upgrade = go =<< getVersion
|
2012-11-11 00:51:07 -04:00
|
|
|
where
|
2013-08-04 13:07:55 -04:00
|
|
|
#ifndef mingw32_HOST_OS
|
2012-11-11 00:51:07 -04:00
|
|
|
go (Just "0") = Upgrade.V0.upgrade
|
|
|
|
go (Just "1") = Upgrade.V1.upgrade
|
2013-05-11 15:03:00 -05:00
|
|
|
#else
|
|
|
|
go (Just "0") = error "upgrade from v0 on Windows not supported"
|
|
|
|
go (Just "1") = error "upgrade from v1 on Windows not supported"
|
|
|
|
#endif
|
2012-11-11 00:51:07 -04:00
|
|
|
go (Just "2") = Upgrade.V2.upgrade
|
|
|
|
go _ = return True
|