Skip to content

Commit 5fb5516

Browse files
committed
No x-maintenance-intent in opam files for dune<3.18
Signed-off-by: ArthurW <[email protected]>
1 parent 5353bb8 commit 5fb5516

File tree

10 files changed

+11
-22
lines changed

10 files changed

+11
-22
lines changed

otherlibs/dune-site/test/run.t

-1
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,6 @@ Test with an opam like installation
169169
]
170170
["dune" "install" "-p" name "--create-install-files" name]
171171
]
172-
x-maintenance-intent: ["(latest)"]
173172

174173
$ dune build -p a --promote-install-files=false @install
175174

otherlibs/dune-site/test/run_2_9.t

-1
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,6 @@ Test with an opam like installation
157157
]
158158
["dune" "install" "-p" name "--create-install-files" name]
159159
]
160-
x-maintenance-intent: ["(latest)"]
161160

162161
$ dune build -p a --promote-install-files="false" @install
163162

src/dune_rules/opam_create.ml

+10-4
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,15 @@ let insert_odoc_dep depends =
196196
loop [] depends
197197
;;
198198

199+
let maintenance_intent dune_version info =
200+
if dune_version < (3, 18)
201+
then None
202+
else (
203+
match Package_info.maintenance_intent info with
204+
| None -> Some [ "(latest)" ]
205+
| x -> x)
206+
;;
207+
199208
let opam_fields project (package : Package.t) =
200209
let dune_version = Dune_project.dune_version project in
201210
let package_name = Package.name package in
@@ -228,10 +237,7 @@ let opam_fields project (package : Package.t) =
228237
in
229238
let list_fields =
230239
[ "maintainer", Package_info.maintainers info
231-
; ( "x-maintenance-intent"
232-
, match Package_info.maintenance_intent info with
233-
| None -> Some [ "(latest)" ]
234-
| x -> x )
240+
; "x-maintenance-intent", maintenance_intent dune_version info
235241
; "authors", Package_info.authors info
236242
; ( "license"
237243
, match Package_info.license info with

test/blackbox-tests/test-cases/describe/describe.t

-1
Original file line numberDiff line numberDiff line change
@@ -1373,5 +1373,4 @@ opam file listing
13731373
\"@doc\" {with-doc}
13741374
]
13751375
]
1376-
x-maintenance-intent: [\"(latest)\"]
13771376
"))

test/blackbox-tests/test-cases/dune-package.t/run.t

-1
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,6 @@ Install as opam does
177177
"@doc" {with-doc}
178178
]
179179
]
180-
x-maintenance-intent: ["(latest)"]
181180

182181
$ (cd a; "dune" "build" "-p" a "@install")
183182

test/blackbox-tests/test-cases/dune-project-meta/basic-generate.t

+1-8
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,19 @@ Simple test
44
The `dune build` should generate the opam file
55

66
$ cat >dune-project <<EOF
7-
> (lang dune 3.18)
7+
> (lang dune 1.10)
88
> (version 1.0.0)
99
> (name cohttp)
1010
> (source (github mirage/ocaml-cohttp))
1111
> (license ISC)
1212
> (authors "Anil Madhavapeddy" "Rudi Grinberg")
13-
> (maintenance_intent "(latest)")
1413
>
1514
> (generate_opam_files true)
1615
>
1716
> (package
1817
> (name cohttp)
1918
> (synopsis "An OCaml library for HTTP clients and servers")
2019
> (description "A longer description")
21-
> (allow_empty)
2220
> (depends
2321
> (alcotest :with-test)
2422
> (foo (and :dev (> 1.5) (< 2.0)))
@@ -34,7 +32,6 @@ The `dune build` should generate the opam file
3432
> A really long multi line description that spans across lines to
3533
> make sure that the rendering of long strings stays compatible.
3634
> ")
37-
> (allow_empty)
3835
> (depends
3936
> (cohttp (>= 1.0.2))
4037
> (conduit-async (>= 1.0.3))
@@ -48,7 +45,6 @@ The `dune build` should generate the opam file
4845
> A really long description that is supposed to start with a
4946
> newline since it doesn't escape the line break.
5047
> ")
51-
> (allow_empty)
5248
> (depends
5349
> (cohttp (>= 1.0.2))
5450
> (conduit-lwt (>= 1.0.3))
@@ -93,7 +89,6 @@ The `dune build` should generate the opam file
9389
]
9490
]
9591
dev-repo: "git+https://github.com/mirage/ocaml-cohttp.git"
96-
x-maintenance-intent: ["(latest)"]
9792

9893
$ cat cohttp-async.opam
9994
# This file is generated by dune, edit dune-project instead
@@ -131,7 +126,6 @@ The `dune build` should generate the opam file
131126
]
132127
]
133128
dev-repo: "git+https://github.com/mirage/ocaml-cohttp.git"
134-
x-maintenance-intent: ["(latest)"]
135129

136130
$ cat cohttp-lwt.opam
137131
# This file is generated by dune, edit dune-project instead
@@ -170,4 +164,3 @@ The `dune build` should generate the opam file
170164
]
171165
]
172166
dev-repo: "git+https://github.com/mirage/ocaml-cohttp.git"
173-
x-maintenance-intent: ["(latest)"]

test/blackbox-tests/test-cases/dune-project-meta/dune-dep.t

-3
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,6 @@ the doc dependencies:
191191
]
192192
["dune" "install" "-p" name "--create-install-files" name]
193193
]
194-
x-maintenance-intent: ["(latest)"]
195194

196195
$ cat > dune-project <<EOF
197196
> (lang dune 3.0)
@@ -216,7 +215,6 @@ the doc dependencies:
216215
"@doc" {with-doc}
217216
]
218217
]
219-
x-maintenance-intent: ["(latest)"]
220218

221219
$ cat > dune-project <<EOF
222220
> (lang dune 3.0)
@@ -242,4 +240,3 @@ the doc dependencies:
242240
"@doc" {with-doc}
243241
]
244242
]
245-
x-maintenance-intent: ["(latest)"]

test/blackbox-tests/test-cases/dune-project-meta/github2927.t

-1
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,3 @@ Reproduction case for #2927
3030
"@doc" {with-doc}
3131
]
3232
]
33-
x-maintenance-intent: ["(latest)"]

test/blackbox-tests/test-cases/dune-project-meta/v11-1.t

-1
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,3 @@ Generation of opam files with lang dune >= 1.11
2929
"@doc" {with-doc}
3030
]
3131
]
32-
x-maintenance-intent: ["(latest)"]

test/blackbox-tests/test-cases/opam-constraints.t

-1
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,3 @@ constraints.
6767
"@doc" {with-doc}
6868
]
6969
]
70-
x-maintenance-intent: ["(latest)"]

0 commit comments

Comments
 (0)