Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle line feed in META files #183

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion obuild/build.ml
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ let link_ task_index bstate cstate pkgDeps target dag compiled useThreadLib ccli
if (satisfy_preds dep preds) then
let archives = Meta.Pkg.get_archive_with_filter meta dep preds in
List.fold_left (fun acc (_,a) ->
let files = string_split ' ' a in
let files = Meta.string_split_words a in
acc @ (List.map (fun f -> in_current_dir $ fn f) files)
) [] archives
else
Expand Down
7 changes: 5 additions & 2 deletions obuild/meta.ml
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,10 @@ type t = filepath * Pkg.t

let path_warning = ref false

let string_split_words s =
List.filter (fun x -> x <> "") $
string_split_pred (fun c -> List.mem c [','; ' '; '\n']) s

module Token = struct
(* mini lexer *)
type t =
Expand Down Expand Up @@ -346,8 +350,7 @@ module Token = struct
match xs2 with
| PLUSEQ :: S reqs :: xs3
| EQ :: S reqs :: xs3 ->
let deps = List.map (fun r -> Libname.of_string r)
$ (List.filter (fun x -> x <> "") $ string_split_pred (fun c -> List.mem c [',';' ']) reqs)
let deps = List.map (fun r -> Libname.of_string r) $ string_split_words reqs
in
parse pkg_name { acc with Pkg.requires = (preds, (List.rev deps)) :: acc.Pkg.requires } xs3
| _ -> raise (MetaParseError (pkg_name, "parsing requires failed"))
Expand Down