aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/program
diff options
context:
space:
mode:
authorEduardo Julian2021-09-01 01:01:22 -0400
committerEduardo Julian2021-09-01 01:01:22 -0400
commit4051a1cbe0999ee22bc395b059ea1556bcc002a0 (patch)
treeb8a5a4ca830285eb83dfa84c9b7eecf82e2149b0 /stdlib/source/program
parent834ed92e323fd274c2da08c82a7d8785663e10be (diff)
Updates to the JS compiler.
Diffstat (limited to 'stdlib/source/program')
-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