diff --git a/master_changes.md b/master_changes.md index 5247c0c2808..416a5a20de7 100644 --- a/master_changes.md +++ b/master_changes.md @@ -172,6 +172,7 @@ users) # API updates ## opam-client * `OpamArg.InvalidCLI`: export exception [#6150 @rjbou] + * `OpamArg`: export `require_checksums` and `no_checksums`, that are shared with `build_options` [#5563 @rjbou] ## opam-repository * `OpamDownload.get_output`: fix `wget` option for `POST` requests [#6036 @rjbou] diff --git a/src/client/opamArg.ml b/src/client/opamArg.ml index 4c978609738..14c25057846 100644 --- a/src/client/opamArg.ml +++ b/src/client/opamArg.ml @@ -1412,6 +1412,17 @@ let lock_suffix ?section cli = "Set locked files suffix to $(i,SUFFIX)." Arg.(string) ("locked") +(* Checksums options *) +let no_checksums ?section cli from_cli = + mk_flag ~cli from_cli ?section ["no-checksums"] + "Do not verify the checksum of downloaded archives.\ + This is equivalent to setting $(b,\\$OPAMNOCHECKSUMS) to \"true\"." +let require_checksums ?section cli from_cli = + mk_flag ~cli from_cli ?section ["require-checksums"] + "Reject the installation of packages that don't provide a checksum for\ + the upstream archives. This is equivalent to setting \ + $(b,\\$OPAMREQUIRECHECKSUMS) to \"true\"." + (* Options common to all build commands *) let build_option_section = "PACKAGE BUILD OPTIONS" let man_build_option_section = @@ -1440,14 +1451,8 @@ let build_options cli = affects packages that are explicitly listed on the command-line. \ This is equivalent to setting $(b,\\$OPAMINPLACEBUILD) to \"true\"." in - let no_checksums = - mk_flag ~cli cli_original ~section ["no-checksums"] - "Do not verify the checksum of downloaded archives.\ - This is equivalent to setting $(b,\\$OPAMNOCHECKSUMS) to \"true\"." in - let req_checksums = - mk_flag ~cli cli_original ~section ["require-checksums"] - "Reject the installation of packages that don't provide a checksum for the upstream archives. \ - This is equivalent to setting $(b,\\$OPAMREQUIRECHECKSUMS) to \"true\"." in + let no_checksums = no_checksums ~section cli cli_original in + let req_checksums = require_checksums ~section cli cli_original in let build_test = mk_flag_replaced ~cli ~section [ cli_between cli2_0 cli2_1 ~replaced:"--with-test", ["build-test"]; diff --git a/src/client/opamArg.mli b/src/client/opamArg.mli index 75a31250362..03dfea6a62b 100644 --- a/src/client/opamArg.mli +++ b/src/client/opamArg.mli @@ -213,6 +213,12 @@ val apply_build_options: OpamCLIVersion.Sourced.t -> build_options -> unit val locked: ?section:string -> OpamCLIVersion.Sourced.t -> bool Term.t val lock_suffix: ?section:string -> OpamCLIVersion.Sourced.t -> string Term.t +(** Checksum options *) +val no_checksums: + ?section:string -> OpamCLIVersion.Sourced.t -> validity -> bool Term.t +val require_checksums: + ?section:string -> OpamCLIVersion.Sourced.t -> validity -> bool Term.t + (** {3 Package listing and filtering options} *) (** Man section name *)