From effdaf06f6f002d930bdabcab0fd47d3cfc36c04 Mon Sep 17 00:00:00 2001 From: Enrico Tassi Date: Mon, 14 Jan 2008 09:03:01 +0000 Subject: [PATCH] better parsing of the root file --- helm/software/components/library/librarian.ml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/helm/software/components/library/librarian.ml b/helm/software/components/library/librarian.ml index da5136934..b765f64b6 100644 --- a/helm/software/components/library/librarian.ml +++ b/helm/software/components/library/librarian.ml @@ -40,7 +40,10 @@ let remove_trailing_slash s = let load_root_file rootpath = let data = HExtlib.input_file rootpath in let lines = Str.split (Str.regexp "\n") data in - let clean s = Pcre.replace ~pat:"^ *" (Pcre.replace ~pat:" *$" s) in + let clean s = + Pcre.replace ~pat:"[ \t]+" ~templ:" " + (Pcre.replace ~pat:"^ *" (Pcre.replace ~pat:" *$" s)) + in List.map (fun l -> match Str.split (Str.regexp "=") l with -- 2.39.2