Skip to content

Commit

Permalink
Still use showOption when linked
Browse files Browse the repository at this point in the history
  • Loading branch information
philderbeast committed Apr 12, 2024
1 parent d14aaf1 commit 911b32b
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions cabal-install-solver/src/Distribution/Solver/Modular/Message.hs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import Data.Map (Map)
import qualified Data.Map as M
import Data.Set (Set)
import qualified Data.Set as S
import Data.Maybe (catMaybes, mapMaybe)
import Data.Maybe (catMaybes, mapMaybe, isJust)
import Prelude hiding (pi)

import Distribution.Pretty (prettyShow) -- from Cabal
Expand Down Expand Up @@ -259,8 +259,13 @@ showOption qpn@(Q _pp pn) (POption i linkedTo) =
-- "unexpected empty list of versions"
showIsOrVs :: QPN -> [POption] -> String
showIsOrVs _ [] = "unexpected empty list of versions"
showIsOrVs q [x] = let POption i _ = x in showPI (PI q i)
showIsOrVs q xs = showQPN q ++ "; " ++ (L.intercalate ", " [showI i | POption i _ <- xs])
showIsOrVs q [x] = showOption q x
showIsOrVs q xs = showQPN q ++ "; " ++ (L.intercalate ", "
[if isJust linkedTo
then showOption q x
else showI i -- Don't show the package, just the version
| x@(POption i linkedTo) <- xs
])

showGR :: QGoalReason -> String
showGR UserGoal = " (user goal)"
Expand Down

0 comments on commit 911b32b

Please sign in to comment.