2011-03-16 19:48:26 +00:00
|
|
|
{- git-annex command
|
|
|
|
-
|
2015-01-21 16:50:09 +00:00
|
|
|
- Copyright 2011 Joey Hess <id@joeyh.name>
|
2011-03-16 19:48:26 +00:00
|
|
|
-
|
|
|
|
- Licensed under the GNU GPL version 3 or higher.
|
|
|
|
-}
|
|
|
|
|
|
|
|
module Command.Upgrade where
|
|
|
|
|
|
|
|
import Command
|
2011-03-19 22:58:10 +00:00
|
|
|
import Upgrade
|
2016-03-31 21:20:43 +00:00
|
|
|
import Annex.Version
|
|
|
|
import Annex.Init
|
2011-03-16 19:48:26 +00:00
|
|
|
|
2015-07-08 16:33:27 +00:00
|
|
|
cmd :: Command
|
|
|
|
cmd = dontCheck repoExists $ -- because an old version may not seem to exist
|
2015-12-15 19:34:28 +00:00
|
|
|
noDaemonRunning $ -- avoid upgrading repo out from under daemon
|
2015-07-08 19:08:02 +00:00
|
|
|
command "upgrade" SectionMaintenance "upgrade repository layout"
|
|
|
|
paramNothing (withParams seek)
|
2011-03-16 19:48:26 +00:00
|
|
|
|
2015-07-08 19:08:02 +00:00
|
|
|
seek :: CmdParams -> CommandSeek
|
2018-10-01 18:12:06 +00:00
|
|
|
seek = withNothing (commandAction start)
|
2011-03-16 19:48:26 +00:00
|
|
|
|
2011-09-15 20:50:49 +00:00
|
|
|
start :: CommandStart
|
2011-03-16 19:48:26 +00:00
|
|
|
start = do
|
2017-11-28 18:40:26 +00:00
|
|
|
showStart' "upgrade" Nothing
|
2016-03-31 21:20:43 +00:00
|
|
|
whenM (isNothing <$> getVersion) $ do
|
2017-12-13 18:34:32 +00:00
|
|
|
initialize (AutoInit False) Nothing Nothing
|
2016-10-05 20:23:09 +00:00
|
|
|
r <- upgrade False latestVersion
|
2011-05-15 06:02:46 +00:00
|
|
|
next $ next $ return r
|