Ignore <package>.opam when <package> is empty
This commit is contained in:
parent
6ac0200d95
commit
74e015923a
|
@ -70,7 +70,7 @@ let find_root () =
|
||||||
if String_set.mem "jbuild-workspace" files then
|
if String_set.mem "jbuild-workspace" files then
|
||||||
cont counter ~candidates:((0, dir, to_cwd) :: candidates) dir ~to_cwd
|
cont counter ~candidates:((0, dir, to_cwd) :: candidates) dir ~to_cwd
|
||||||
else if String_set.exists files ~f:(fun fn ->
|
else if String_set.exists files ~f:(fun fn ->
|
||||||
String.is_suffix fn ~suffix:".opam") then
|
String.is_suffix fn ~suffix:".opam" && fn <> ".opam") then
|
||||||
cont counter ~candidates:((1, dir, to_cwd) :: candidates) dir ~to_cwd
|
cont counter ~candidates:((1, dir, to_cwd) :: candidates) dir ~to_cwd
|
||||||
else if String_set.mem ".git" files || String_set.mem ".hg" files then
|
else if String_set.mem ".git" files || String_set.mem ".hg" files then
|
||||||
cont counter ~candidates:((2, dir, to_cwd) :: candidates) dir ~to_cwd
|
cont counter ~candidates:((2, dir, to_cwd) :: candidates) dir ~to_cwd
|
||||||
|
|
|
@ -152,6 +152,9 @@ only declare parts of the packages in this subtree. Typically your
|
||||||
=<package>.opam= files should be at the root of your project, since
|
=<package>.opam= files should be at the root of your project, since
|
||||||
this is where =opam pin ...= will look for them.
|
this is where =opam pin ...= will look for them.
|
||||||
|
|
||||||
|
Note that =<package>= must be non empty, so in particular =.opam=
|
||||||
|
files are ignored.
|
||||||
|
|
||||||
*** Package version
|
*** Package version
|
||||||
|
|
||||||
Note that Jbuilder will try to determine the version number of
|
Note that Jbuilder will try to determine the version number of
|
||||||
|
@ -985,7 +988,7 @@ Jbuilder looks for the following entries in all these directories, in
|
||||||
order of precedences:
|
order of precedences:
|
||||||
|
|
||||||
1. =jbuild-workspace=
|
1. =jbuild-workspace=
|
||||||
2. any file ending with =.opam=
|
2. any file ending with =.opam=, except =.opam= itself
|
||||||
3. =.git= or =.hg=
|
3. =.git= or =.hg=
|
||||||
|
|
||||||
The first entry to match in this list will determine the root. If this
|
The first entry to match in this list will determine the root. If this
|
||||||
|
|
|
@ -148,7 +148,7 @@ let load () =
|
||||||
let path = File_tree.Dir.path dir in
|
let path = File_tree.Dir.path dir in
|
||||||
String_set.fold (File_tree.Dir.files dir) ~init:acc ~f:(fun fn acc ->
|
String_set.fold (File_tree.Dir.files dir) ~init:acc ~f:(fun fn acc ->
|
||||||
match Filename.split_ext fn with
|
match Filename.split_ext fn with
|
||||||
| Some (pkg, ".opam") ->
|
| Some (pkg, ".opam") when pkg <> "" ->
|
||||||
let version_from_opam_file =
|
let version_from_opam_file =
|
||||||
let lines = lines_of_file (Path.relative path fn |> Path.to_string) in
|
let lines = lines_of_file (Path.relative path fn |> Path.to_string) in
|
||||||
List.find_map lines ~f:(fun s ->
|
List.find_map lines ~f:(fun s ->
|
||||||
|
|
Loading…
Reference in New Issue