Skip to content

Commit

Permalink
[aura] Show parent pkg name when dep can't be found - fixes #513
Browse files Browse the repository at this point in the history
  • Loading branch information
fosskers committed Apr 23, 2020
1 parent 8348ff8 commit 80aee8a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
3 changes: 3 additions & 0 deletions aura/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
[#541](https://github.com/fosskers/aura/issues/541)
- A bug involving the `+` character appearing in package names, like `crypto++`.
[#520](https://github.com/fosskers/aura/issues/520)
- A regression where the name of a parent package wouldn't be displayed when a
dependency couldn't be found.
[#513](https://github.com/fosskers/aura/issues/513)

## 2.2.1 (2020-03-01)

Expand Down
4 changes: 2 additions & 2 deletions aura/lib/Aura/Dependencies.hs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ resolveDeps' ss repo ps = resolve (Resolution mempty mempty) ps
-- | Only searches for packages that we haven't checked yet.
resolve :: Resolution -> NonEmpty Package -> IO Resolution
resolve r@(Resolution m _) xs = maybe' (pure r) (NEL.nonEmpty goods) $ \goods' -> do
let m' = M.fromList (map (pname &&& id) $ toList goods')
let m' = M.fromList . map (pname &&& id) $ toList goods'
r' = r & toInstallL %~ (<> m')
these (const $ pure r') (satisfy r') (const $ satisfy r') $ dividePkgs goods'
where
Expand Down Expand Up @@ -124,7 +124,7 @@ conflicts ss m s = foldMap f m
-- the system.
in if S.member dn s then Nothing
else case M.lookup dn m <|> M.lookup dn pm of
Nothing -> Just $ NonExistant dn
Nothing -> Just . NonExistant dn $ bName b
Just p -> realPkgConflicts ss (bName b) p d

sortInstall :: Map PkgName Package -> Either Failure (NonEmpty (NonEmpty Package))
Expand Down
6 changes: 3 additions & 3 deletions aura/lib/Aura/Languages.hs
Original file line number Diff line number Diff line change
Expand Up @@ -368,14 +368,14 @@ missingPkg_2 ps l = vsep $ map (depError l) ps
depError :: Language -> DepError -> Doc AnsiStyle
depError _ (VerConflict s) = s
depError _ (Ignored s) = s
depError l (NonExistant (PkgName s)) = case l of
depError l (NonExistant (PkgName s) (PkgName par)) = case l of
Spanish -> "La dependencia " <> bt s <> " no pudo ser encontrada."
Portuguese -> "A dependência " <> bt s <> " não foi encontrada."
Russian -> "Зависимость " <> bt s <> " не найдена."
Italian -> "Non è stato possibile trovare la dipendenza " <> bt s <> "."
Esperanto -> "La dependeco " <> bt s <> " ne povis troviĝi."
Esperanto -> "La dependeco " <> bt s <> " de " <> bt par <> " ne povis troviĝi."
Dutch -> "Het afhankelijkheid " <> bt s <> "kan niet worden gevonden."
_ -> "The dependency " <> bt s <> " couldn't be found."
_ -> "The dependency " <> bt s <> " of " <> bt par <> " couldn't be found."
depError l (BrokenProvides (PkgName pkg) (Provides (PkgName pro)) (PkgName n)) = case l of
Spanish -> "El paquete " <> bt pkg <> " necesita " <> bt n <> " que proporciona " <> bt pro <> "."
Russian -> "Пакету " <> bt pkg <> " требуется " <> bt n <> ", предоставляющий " <> bt pro <> "."
Expand Down
2 changes: 1 addition & 1 deletion aura/lib/Aura/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ data Language = English
deriving (Eq, Enum, Bounded, Ord, Show)

-- | The various ways that dependency resolution can fail.
data DepError = NonExistant PkgName
data DepError = NonExistant PkgName PkgName
| VerConflict (Doc AnsiStyle)
| Ignored (Doc AnsiStyle)
| BrokenProvides PkgName Provides PkgName
Expand Down

0 comments on commit 80aee8a

Please sign in to comment.