[Git][haskell-team/package-plan][master] Update lts-diff.hs to work with current libraries

Sven Bartscher gitlab at salsa.debian.org
Sat Aug 4 10:47:39 BST 2018


Sven Bartscher pushed to branch master at Debian Haskell Group / package-plan


Commits:
58855718 by Sven Bartscher at 2018-08-04T09:47:21Z
Update lts-diff.hs to work with current libraries

- - - - -


1 changed file:

- lts-diff.hs


Changes:

=====================================
lts-diff.hs
=====================================
--- a/lts-diff.hs
+++ b/lts-diff.hs
@@ -11,15 +11,17 @@ import qualified Data.Map as M
 import System.Environment (getArgs)
 import System.Exit (exitFailure)
 import Distribution.Package ( PackageId
-                            , PackageName(PackageName)
+                            , PackageName
                             , PackageIdentifier(PackageIdentifier)
+                            , mkPackageName
                             , pkgName
                             , pkgVersion
                             , unPackageName
                             )
-import Distribution.Version ( Version(Version)
-                            , versionBranch
+import Distribution.Version ( Version
+                            , mkVersion
                             )
+import Distribution.Text (display)
 import Safe (readMay)
 
 main :: IO ()
@@ -65,7 +67,7 @@ debianPackagesFile = "packages.txt"
 parseDebianPackage :: String -> Maybe PackageId
 parseDebianPackage line = do
   (rawName:rawVersion:_) <- return $ words line
-  let name = PackageName rawName
+  let name = mkPackageName rawName
   version <- parseVersion rawVersion
   return PackageIdentifier { pkgName = name
                            , pkgVersion = version
@@ -89,7 +91,7 @@ parseLtsPackage line = case line of
                                        -- Throws eventual whitespaces
                                        -- from the end and the
                                        -- beginning of the name
-                                   let name = PackageName
+                                   let name = mkPackageName
                                               $ filter isAlpha
                                                        rawName
                                        -- Throw the trailing comma away.
@@ -145,8 +147,8 @@ printDifferences different = do
 printDifference :: PackageName -> (Version, Version) -> IO ()
 printDifference name (debianV, ltsV) =
     putStrLn $ unPackageName name ++ " has version " ++
-             showVersion debianV ++ " in Debian but " ++ showVersion
-             ltsV ++ " in LTS."
+             display debianV ++ " in Debian but " ++
+             display ltsV ++ " in LTS."
 
 printMore :: S.Set PackageName -> IO ()
 printMore more = do
@@ -160,12 +162,9 @@ parseVersion :: String -> Maybe Version
 parseVersion raw = do
   let parts = splitOn "." raw
   numericParts <- mapM readMay parts
-  return $ Version numericParts []
+  return $ mkVersion numericParts
 
 stripComma :: String -> String
 stripComma s
     | last s == ',' = init s
     | otherwise = s
-
-showVersion :: Version -> String
-showVersion = intercalate "." . map show . versionBranch



View it on GitLab: https://salsa.debian.org/haskell-team/package-plan/commit/588557189ac9f6eac6feb1a45a368b1f98592ac6

-- 
View it on GitLab: https://salsa.debian.org/haskell-team/package-plan/commit/588557189ac9f6eac6feb1a45a368b1f98592ac6
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-haskell-commits/attachments/20180804/f89bc2f2/attachment-0001.html>


More information about the Pkg-haskell-commits mailing list