Skip to content

dune subst can add a duplicate version field in opam #878

@samoht

Description

@samoht

It seems that jbuilder subst doesn't check if a version field is already present in the opam file before adding a new one. It should either: don't add a new field of already present or (probably better) replace the field with some new contents.

To reproduce:

$ cat foo.opam
version: "foo"
$ jbuilder subst
$ git diff
diff --git a/foo.opam b/foo.opam
index d228968..3711f0d 100644
--- a/foo.opam
+++ b/foo.opam
@@ -1 +1,2 @@
+version: "34185ff"
 version: "foo"

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueGood for contributing for the first time to the Dune codebasehelp wantedContributors are welcomed to submit a PR to solve the issue

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions