+let chop_extension file =
+ try F.chop_extension file
+ with Invalid_argument _ -> file
+
+let script devel = chop_extension devel ^ ".ma"
+
+let src_exists path = !O.no_devel || Y.file_exists path
+
+let is_obj base path =
+ if H.is_regular (F.concat base path) then
+ F.check_suffix path ".con.ng" ||
+ F.check_suffix path ".ind.ng" ||
+ F.check_suffix path ".var.ng"
+ else false
+
+let is_src base path =
+ H.is_regular (F.concat base path) &&
+ F.check_suffix path ".ng"
+
+let is_dir base path =
+ H.is_dir (F.concat base path)
+
+let is_script devel =
+ src_exists (script devel)