Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

  • Loading branch information...
commit 31a59d1518484e18675f7a9c6c7b850a354626e6 1 parent 0455ff5
@soenkehahn soenkehahn authored
Showing with 12 additions and 7 deletions.
  1. +12 −7 cabal-install/Distribution/Client/Install.hs
View
19 cabal-install/Distribution/Client/Install.hs
@@ -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))
Please sign in to comment.
Something went wrong with that request. Please try again.