- let ic = open_in ma_file in
- let istream = Ulexing.from_utf8_channel ic in
- let dependencies = DependenciesParser.parse_dependencies istream in
- close_in ic;
- List.iter
- (function
- | DependenciesParser.UriDep uri ->
- let uri = UriManager.string_of_uri uri in
- if not (Http_getter_storage.is_legacy uri) then
- Hashtbl.add uri_deps ma_file uri
- | DependenciesParser.BaseuriDep uri ->
- let uri = Http_getter_misc.strip_trailing_slash uri in
- Hashtbl.add baseuri_of ma_file uri;
- Hashtbl.add baseuri_of_inv uri ma_file
- | DependenciesParser.IncludeDep path ->
- try
- let baseuri = baseuri_of_script path in
- if not (Http_getter_storage.is_legacy baseuri) then
- (let moo_file = obj_file_of_baseuri false baseuri in
- Hashtbl.add include_deps ma_file moo_file;
- Hashtbl.add include_deps_dot ma_file baseuri)
- with Sys_error _ ->
- HLog.warn
- ("Unable to find " ^ path ^ " that is included in " ^ ma_file))
- dependencies)
+ let ma_baseuri = baseuri_of_script ma_file in
+ let dependencies = DependenciesParser.deps_of_file ma_file in
+ List.iter
+ (function
+ | DependenciesParser.UriDep uri ->
+ let uri = UriManager.string_of_uri uri in
+ if not (Http_getter_storage.is_legacy uri) then
+ let dep = resolve uri ma_baseuri in
+ (match dep with
+ | None -> ()
+ | Some u ->
+ match script_of_baseuri ma_file u with
+ | Some d -> Hashtbl.add include_deps ma_file d
+ | None -> ())
+ | DependenciesParser.IncludeDep path ->
+ ignore (baseuri_of_script path);
+ Hashtbl.add include_deps ma_file path)
+ dependencies)