aboutsummaryrefslogtreecommitdiff
path: root/configure.hs
diff options
context:
space:
mode:
Diffstat (limited to 'configure.hs')
-rw-r--r--configure.hs13
1 files changed, 12 insertions, 1 deletions
diff --git a/configure.hs b/configure.hs
index 772ba5489..6ebaf00a8 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"]
@@ -48,6 +49,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