Skip to content

Commit f31ed43

Browse files
committed
registry: Fix logic in matches-current-platform?
This was a pretty serious bug that didn't show up because it's rare outside of the opendylan repository to have multi-platform LID files. `deft update` in the opendylan repo was getting the wrong LID file (netbsd instead of darwin, for me) for the common-dylan library.
1 parent b4d63db commit f31ed43

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

sources/workspaces/lid.dylan

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,12 @@ end function;
8181
define function matches-current-platform?
8282
(lid :: <lid>) => (matches? :: <bool>)
8383
let current-platform = as(<string>, os/$platform-name);
84-
let platform = lid-value(lid, $platforms-key);
85-
// Assume that if the LID is included in another LID then it contains the
84+
let platforms = lid-values(lid, $platforms-key) | #[];
85+
// Assume that if the LID is included in another LID then it contains only the
8686
// platform-independent attributes of a multi-platform project and is not a top-level
8787
// library.
88-
platform = current-platform
89-
| (~platform & lid.library-name & empty?(lid.lid-included-in))
88+
member?(current-platform, platforms, test: \=)
89+
| (empty?(platforms) & lid.library-name & empty?(lid.lid-included-in))
9090
end function;
9191

9292
define function add-lid

0 commit comments

Comments
 (0)