From 4051a1cbe0999ee22bc395b059ea1556bcc002a0 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Wed, 1 Sep 2021 01:01:22 -0400 Subject: Updates to the JS compiler. --- .../program/aedifex/dependency/resolution.lux | 25 +++++++++++----------- 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'stdlib/source/program') 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 -- cgit v1.2.3