aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/program
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--stdlib/source/program/aedifex/dependency/resolution.lux25
1 files changed, 13 insertions, 12 deletions
diff --git a/stdlib/source/program/aedifex/dependency/resolution.lux b/stdlib/source/program/aedifex/dependency/resolution.lux
index a90712796..23a572506 100644
--- a/stdlib/source/program/aedifex/dependency/resolution.lux
+++ b/stdlib/source/program/aedifex/dependency/resolution.lux
@@ -7,7 +7,8 @@
[abstract
[codec (#+ Codec)]
[equivalence (#+ Equivalence)]
- [monad (#+ do)]]
+ [monad (#+ do)]
+ ["." predicate (#+ Predicate)]]
[control
["." maybe]
["." try (#+ Try) ("#\." functor)]
@@ -232,9 +233,13 @@
(case ?package
(#try.Success package)
(do !
- [.let [sub_dependencies (|> package
+ [.let [redundant? (: (Predicate Dependency)
+ (predicate.or (\ //.equivalence = head)
+ (dictionary.key? resolution)))
+ sub_dependencies (|> package
///package.dependencies
- (try\each set.list)
+ (try\each (|>> set.list
+ (list.only (|>> redundant? not))))
(try.else (list)))
... For security reasons, it's not a good idea to allow dependencies to introduce repositories.
... package_repositories (|> package
@@ -243,17 +248,13 @@
... (try.else (list))
... (list\each new_repository))
... sub_repositories (list\composite repositories package_repositories)
- sub_repositories repositories]
- [successes failures resolution] (recur sub_repositories
- (#.Item head successes)
- failures
- sub_dependencies
- (dictionary.has head package resolution))]
+ ]]
(recur repositories
- successes
+ (#.Item head successes)
failures
- tail
- resolution))
+ (set.list (set.union (set.of_list //.hash tail)
+ (set.of_list //.hash sub_dependencies)))
+ (dictionary.has head package resolution)))
(#try.Failure error)
(recur repositories