diff --git a/src/format/opamFile.ml b/src/format/opamFile.ml index eb1d104b699..8ce547f4c72 100644 --- a/src/format/opamFile.ml +++ b/src/format/opamFile.ml @@ -1171,7 +1171,7 @@ module SyntaxFile(X: SyntaxFileArg) : IO_FILE with type t := X.t = struct let catch_future_syntax_error = function | {file_contents = [{pelem = Variable({pelem = "opam-version"; _}, {pelem = String ver; _}); _ }; {pelem = Section {section_kind = {pelem = "#"; _}; _}; pos}]; _} - when OpamVersion.(compare (nopatch (of_string ver)) (nopatch X.format_version)) <= 0 -> + when OpamVersion.(compare (nopatch (of_string ver)) (nopatch OpamVersion.current)) <= 0 -> raise (OpamPp.Bad_version (Some pos, "Parse error")) | opamfile -> opamfile diff --git a/tests/reftests/pin.test b/tests/reftests/pin.test index 7dbf20a8bad..ecbe4647b6a 100644 --- a/tests/reftests/pin.test +++ b/tests/reftests/pin.test @@ -301,14 +301,14 @@ echo GARBAGE>>"$1" # Return code 30 # ### sh junk.sh pin-at-two-two/pin-at-two-two.opam ### opam install ./pin-at-two-two -[ERROR] In ${BASEDIR}/pin-at-two-two/pin-at-two-two.opam: - unsupported or missing file format version; should be 2.0 or older +[ERROR] At ${BASEDIR}/pin-at-two-two/pin-at-two-two.opam:11:0-11:0:: + Parse error [ERROR] Strict mode: aborting # Return code 30 # ### sh junk.sh pin-at-two-three/pin-at-two-three.opam ### opam install ./pin-at-two-three -[ERROR] In ${BASEDIR}/pin-at-two-three/pin-at-two-three.opam: - unsupported or missing file format version; should be 2.0 or older +[ERROR] At ${BASEDIR}/pin-at-two-three/pin-at-two-three.opam:11:0-11:0:: + Parse error [ERROR] Strict mode: aborting # Return code 30 # ### sh junk.sh pin-at-future/pin-at-future.opam