projects
/
pkg-find-outdated-cabal.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
410939d
)
code cleanup
master
author
PHO
<pho@cielonegro.org>
Fri, 2 Oct 2009 03:42:50 +0000
(12:42 +0900)
committer
PHO
<pho@cielonegro.org>
Fri, 2 Oct 2009 03:42:50 +0000
(12:42 +0900)
Main.hs
patch
|
blob
|
history
diff --git
a/Main.hs
b/Main.hs
index 13bc9485d5dd0168889cead1728ccebaf384b5e2..c7d498007826de02eb4dbf085e8b979a73e30ac6 100644
(file)
--- a/
Main.hs
+++ b/
Main.hs
@@
-58,7
+58,7
@@
scanPkgs runQuery = mapM_ scanPkg
name = extractPkgName distname
ver = extractPkgVersion distname
pkgId = PackageIdentifier name ver
name = extractPkgName distname
ver = extractPkgVersion distname
pkgId = PackageIdentifier name ver
- query = Id (
sameName pkgId) :& Id (newerVers pkgId
)
+ query = Id (
(`isNewerThan` pkgId) . package
)
in
case runQuery query of
[] -> putStrLn (distname ++ ": is the LATEST")
in
case runQuery query of
[] -> putStrLn (distname ++ ": is the LATEST")
@@
-69,11
+69,10
@@
scanPkgs runQuery = mapM_ scanPkg
putStrLn (distname ++ ": has a newer version " ++ showVersion lVer)
_ -> return ()
putStrLn (distname ++ ": has a newer version " ++ showVersion lVer)
_ -> return ()
- sameName :: PackageIdentifier -> PackageIdentifier -> Bool
- sameName a b = pkgName a == pkgName b
-
- newerVers :: PackageIdentifier -> PackageIdentifier -> Bool
- newerVers a b = pkgVersion a < pkgVersion b
+ isNewerThan :: PackageIdentifier -> PackageIdentifier -> Bool
+ isNewerThan a b
+ = pkgName a == pkgName b &&
+ pkgVersion a > pkgVersion b
cmpVers :: PackageDescription -> PackageDescription -> Ordering
cmpVers a b = (pkgVersion . package) a `compare` (pkgVersion . package) b
cmpVers :: PackageDescription -> PackageDescription -> Ordering
cmpVers a b = (pkgVersion . package) a `compare` (pkgVersion . package) b