diff options
author | Joey Hess <joey@kitenet.net> | 2011-03-19 14:33:24 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2011-03-19 14:33:24 -0400 |
commit | 828a84ba3341d4b7a84292d8b9002a8095dd2382 (patch) | |
tree | d1c854a9c3d48bd7256a7c5e1db8dfae75d81f68 /configure.hs | |
parent | 33cb114be5135ce02671d8ce80440d40e97ca824 (diff) |
Add version command to show git-annex version as well as repository version information.
Diffstat (limited to 'configure.hs')
-rw-r--r-- | configure.hs | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/configure.hs b/configure.hs index f5c295648..f8cd577e9 100644 --- a/configure.hs +++ b/configure.hs @@ -7,7 +7,8 @@ import TestConfig tests :: [TestCase] tests = [ - testCp "cp_a" "-a" + TestCase "version" $ getVersion + , testCp "cp_a" "-a" , testCp "cp_p" "-p" , testCp "cp_reflink_auto" "--reflink=auto" , TestCase "uuid generator" $ selectCmd "uuid" ["uuid", "uuidgen"] @@ -49,6 +50,16 @@ unicodeFilePath = do let file = head $ filter (isInfixOf "unicode-test") fs return $ Config "unicodefilepath" (BoolConfig $ isInfixOf "ΓΌ" file) +{- Pulls package version out of the changelog. -} +getVersion :: Test +getVersion = do + changelog <- readFile "debian/changelog" + let verline = head $ lines changelog + let version = middle (words verline !! 1) + return $ Config "packageversion" (StringConfig version) + where + middle s = drop 1 $ take (length s - 1) s + setup :: IO () setup = do createDirectoryIfMissing True tmpDir |