2011-03-19 18:33:24 +00:00
|
|
|
{- git-annex command
|
|
|
|
-
|
|
|
|
- Copyright 2010 Joey Hess <joey@kitenet.net>
|
|
|
|
-
|
|
|
|
- Licensed under the GNU GPL version 3 or higher.
|
|
|
|
-}
|
|
|
|
|
|
|
|
module Command.Version where
|
|
|
|
|
2011-10-05 20:02:51 +00:00
|
|
|
import Common.Annex
|
2011-03-19 18:33:24 +00:00
|
|
|
import Command
|
2011-08-20 20:11:42 +00:00
|
|
|
import qualified Build.SysConfig as SysConfig
|
2011-10-04 04:40:47 +00:00
|
|
|
import Annex.Version
|
2013-03-09 18:57:23 +00:00
|
|
|
import BuildFlags
|
2011-03-19 18:33:24 +00:00
|
|
|
|
2011-10-29 19:19:05 +00:00
|
|
|
def :: [Command]
|
2012-09-16 00:46:38 +00:00
|
|
|
def = [noCommit $ noRepo showPackageVersion $ dontCheck repoExists $
|
2013-03-24 22:28:21 +00:00
|
|
|
command "version" paramNothing seek SectionQuery "show version info"]
|
2011-03-19 18:33:24 +00:00
|
|
|
|
|
|
|
seek :: [CommandSeek]
|
|
|
|
seek = [withNothing start]
|
|
|
|
|
2011-09-15 20:50:49 +00:00
|
|
|
start :: CommandStart
|
2011-03-19 18:33:24 +00:00
|
|
|
start = do
|
|
|
|
v <- getVersion
|
2011-10-31 20:46:51 +00:00
|
|
|
liftIO $ do
|
2011-11-16 04:49:09 +00:00
|
|
|
showPackageVersion
|
2011-10-31 20:46:51 +00:00
|
|
|
putStrLn $ "local repository version: " ++ fromMaybe "unknown" v
|
|
|
|
putStrLn $ "default repository version: " ++ defaultVersion
|
|
|
|
putStrLn $ "supported repository versions: " ++ vs supportedVersions
|
|
|
|
putStrLn $ "upgrade supported from repository versions: " ++ vs upgradableVersions
|
2013-03-09 18:57:23 +00:00
|
|
|
putStrLn $ "build flags: " ++ unwords buildFlags
|
2012-02-14 16:40:40 +00:00
|
|
|
stop
|
2012-11-12 05:05:04 +00:00
|
|
|
where
|
|
|
|
vs = join " "
|
2011-11-16 04:49:09 +00:00
|
|
|
|
|
|
|
showPackageVersion :: IO ()
|
|
|
|
showPackageVersion = putStrLn $ "git-annex version: " ++ SysConfig.packageversion
|