Commit 31a59d15 authored by Sönke Hahn's avatar Sönke Hahn
Browse files

fix printing of latest versions for packages that are not on hackage

parent 0455ff5a
......@@ -506,15 +506,20 @@ printPlan dryRun verbosity plan sourcePkgDb = case plan of
diff -> " changes: " ++ intercalate ", " (map change diff)
showLatest :: ConfiguredPackage -> String
showLatest pkg = if pkgVersion /= latestVersion
then (" (latest: " ++ display latestVersion ++ ")")
else ""
showLatest pkg = case mLatestVersion of
Just latestVersion ->
if pkgVersion /= latestVersion
then (" (latest: " ++ display latestVersion ++ ")")
else ""
Nothing -> ""
where
pkgVersion = packageVersion pkg
latestVersion =
packageVersion . last
. SourcePackageIndex.lookupPackageName (packageIndex sourcePkgDb)
$ (packageName pkg)
mLatestVersion :: Maybe Version
mLatestVersion = case SourcePackageIndex.lookupPackageName
(packageIndex sourcePkgDb)
(packageName pkg) of
[] -> Nothing
x -> Just $ packageVersion $ last x
toFlagAssignment :: [Flag] -> FlagAssignment
toFlagAssignment = map (\ f -> (flagName f, flagDefault f))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment