Skip to content

Commit

Permalink
Merge pull request #3715 from rjbou/2.0.3
Browse files Browse the repository at this point in the history
2.0.3 backported commits
  • Loading branch information
AltGr committed Jan 21, 2019
2 parents 1109a14 + c0fcd27 commit 5f5e8bd
Show file tree
Hide file tree
Showing 17 changed files with 63 additions and 33 deletions.
6 changes: 6 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@ Changes prefixed with "(*)" are potentially breaking to scripts or existing
repositories (changes that are automatically handled by the format upgrade tools
are not marked).

2.0.3:
* Fix manpage remaining $ (OPAMBESTEFFORT)
* Fix OPAMROOTISOK handling
* Regenerate missing environment file

2.0.2:
* Update build from jbuilder to dune
* Doc:
* update man page
* add message for deprecated options
Expand Down
18 changes: 9 additions & 9 deletions configure
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for opam 2.0.2.
# Generated by GNU Autoconf 2.69 for opam 2.0.3.
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
Expand Down Expand Up @@ -578,8 +578,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='opam'
PACKAGE_TARNAME='opam'
PACKAGE_VERSION='2.0.2'
PACKAGE_STRING='opam 2.0.2'
PACKAGE_VERSION='2.0.3'
PACKAGE_STRING='opam 2.0.3'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''

Expand Down Expand Up @@ -1264,7 +1264,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures opam 2.0.2 to adapt to many kinds of systems.
\`configure' configures opam 2.0.3 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
Expand Down Expand Up @@ -1326,7 +1326,7 @@ fi

if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of opam 2.0.2:";;
short | recursive ) echo "Configuration of opam 2.0.3:";;
esac
cat <<\_ACEOF
Expand Down Expand Up @@ -1429,7 +1429,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
opam configure 2.0.2
opam configure 2.0.3
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
Expand Down Expand Up @@ -1524,7 +1524,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by opam $as_me 2.0.2, which was
It was created by opam $as_me 2.0.3, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
Expand Down Expand Up @@ -6001,7 +6001,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by opam $as_me 2.0.2, which was
This file was extended by opam $as_me 2.0.3, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
Expand Down Expand Up @@ -6054,7 +6054,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
opam config.status 2.0.2
opam config.status 2.0.3
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
dnl The line below must be formatted AC_INIT(opam,VERSION) with no extra spaces
AC_INIT(opam,2.0.2)
AC_INIT(opam,2.0.3)
AC_COPYRIGHT(Copyright 2012-2017 OcamlPro SAS)

AC_CONFIG_MACRO_DIR([m4])
Expand Down
6 changes: 3 additions & 3 deletions opam-client.opam
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
opam-version: "1.2"
version: "2.0.2"
version: "2.0.3"
maintainer: "opam-devel@lists.ocaml.org"
authors: [
"Vincent Bernardoff <vb@luminar.eu.org>"
Expand All @@ -21,8 +21,8 @@ build: [
[make "%{name}%.install"]
]
depends: [
"opam-state" {= "2.0.2"}
"opam-solver" {= "2.0.2"}
"opam-state" {= "2.0.3"}
"opam-solver" {= "2.0.3"}
"re" {>= "1.7.2"}
"cmdliner" {>= "0.9.8"}
"dune" {build & >= "1.2.1"}
Expand Down
2 changes: 1 addition & 1 deletion opam-core.opam
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
opam-version: "1.2"
version: "2.0.2"
version: "2.0.3"
maintainer: "opam-devel@lists.ocaml.org"
authors: [
"Vincent Bernardoff <vb@luminar.eu.org>"
Expand Down
4 changes: 2 additions & 2 deletions opam-devel.opam
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
opam-version: "1.2"
version: "2.0.2"
version: "2.0.3"
maintainer: "opam-devel@lists.ocaml.org"
authors: [
"Vincent Bernardoff <vb@luminar.eu.org>"
Expand All @@ -22,7 +22,7 @@ build: [
]
build-test: [make "tests"]
depends: [
"opam-client" {= "2.0.2"}
"opam-client" {= "2.0.3"}
"cmdliner" {>= "0.9.8"}
"dune" {build & >= "1.2.1"}
]
Expand Down
4 changes: 2 additions & 2 deletions opam-format.opam
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
opam-version: "1.2"
version: "2.0.2"
version: "2.0.3"
maintainer: "opam-devel@lists.ocaml.org"
authors: [
"Vincent Bernardoff <vb@luminar.eu.org>"
Expand All @@ -21,7 +21,7 @@ build: [
[make "%{name}%.install"]
]
depends: [
"opam-core" {= "2.0.2"}
"opam-core" {= "2.0.3"}
"opam-file-format" {>= "2.0.0~rc2"}
"dune" {build & >= "1.2.1"}
]
Expand Down
4 changes: 2 additions & 2 deletions opam-installer.opam
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
opam-version: "1.2"
version: "2.0.2"
version: "2.0.3"
maintainer: "opam-devel@lists.ocaml.org"
authors: [
"Vincent Bernardoff <vb@luminar.eu.org>"
Expand All @@ -21,7 +21,7 @@ build: [
[make "%{name}%.install"]
]
depends: [
"opam-format" {= "2.0.2"}
"opam-format" {= "2.0.3"}
"cmdliner" {>= "0.9.8"}
"dune" {build & >= "1.2.1"}
]
Expand Down
4 changes: 2 additions & 2 deletions opam-repository.opam
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
opam-version: "1.2"
version: "2.0.2"
version: "2.0.3"
maintainer: "opam-devel@lists.ocaml.org"
authors: [
"Vincent Bernardoff <vb@luminar.eu.org>"
Expand All @@ -21,7 +21,7 @@ build: [
[make "%{name}%.install"]
]
depends: [
"opam-format" {= "2.0.2"}
"opam-format" {= "2.0.3"}
"dune" {build & >= "1.2.1"}
]
available: ocaml-version >= "4.02.3"
4 changes: 2 additions & 2 deletions opam-solver.opam
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
opam-version: "1.2"
version: "2.0.2"
version: "2.0.3"
maintainer: "opam-devel@lists.ocaml.org"
authors: [
"Vincent Bernardoff <vb@luminar.eu.org>"
Expand All @@ -21,7 +21,7 @@ build: [
[make "%{name}%.install"]
]
depends: [
"opam-format" {= "2.0.2"}
"opam-format" {= "2.0.3"}
"mccs" {>= "1.1+9"}
"dose3" {>= "5"}
"cudf" {>= "0.7"}
Expand Down
4 changes: 2 additions & 2 deletions opam-state.opam
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
opam-version: "1.2"
version: "2.0.2"
version: "2.0.3"
maintainer: "opam-devel@lists.ocaml.org"
authors: [
"Vincent Bernardoff <vb@luminar.eu.org>"
Expand All @@ -21,7 +21,7 @@ build: [
[make "%{name}%.install"]
]
depends: [
"opam-repository" {= "2.0.2"}
"opam-repository" {= "2.0.3"}
"dune" {build & >= "1.2.1"}
]
available: ocaml-version >= "4.02.3"
2 changes: 1 addition & 1 deletion shell/bundle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set -ue

OCAMLV=4.04.1
OPAMV=2.0.2
OPAMV=2.0.3
OPAM_REPO=https://opam.ocaml.org/2.0
DEBUG=
MAKESELF=
Expand Down
2 changes: 1 addition & 1 deletion src/client/opamArg.ml
Original file line number Diff line number Diff line change
Expand Up @@ -979,7 +979,7 @@ let global_options =
"Don't fail if all requested packages can't be installed: try to install \
as many as possible. Note that not all external solvers may support \
this option (recent versions of $(i,aspcud) or $(i,mccs) should). This \
is equivalent to setting $($b,\\$OPAMBESTEFFORT) environment variable."
is equivalent to setting $(b,\\$OPAMBESTEFFORT) environment variable."
in
let safe_mode =
mk_flag ~section ["readonly"; "safe"]
Expand Down
5 changes: 4 additions & 1 deletion src/client/opamCommands.ml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,10 @@ let global_options =
OpamStd.Option.Op.(options.debug_level ++
OpamStd.Config.env_level "DEBUG" +! 0 > 0)
(OpamStateConfig.opamroot ?root_dir:options.opt_root ());
if not (options.safe_mode || OpamClientConfig.(!r.root_is_ok)) &&
let root_is_ok =
OpamStd.Option.default false (OpamStd.Config.env_bool "ROOTISOK")
in
if not (options.safe_mode || root_is_ok) &&
Unix.getuid () = 0 then
OpamConsole.warning "Running as root is not recommended";
options, self_upgrade_status
Expand Down
21 changes: 18 additions & 3 deletions src/client/opamConfigCommand.ml
Original file line number Diff line number Diff line change
Expand Up @@ -224,10 +224,25 @@ let env gt switch ?(set_opamroot=false) ?(set_opamswitch=false)
(OpamSwitch.to_string switch)
(OpamConsole.colorise `bold "--set-switch")
(OpamConsole.colorise `bold "OPAMSWITCH");
let force_path = not inplace_path in
let env =
OpamEnv.get_opam_raw
~set_opamroot ~set_opamswitch ~force_path:(not inplace_path)
gt.root switch
let env_file = OpamPath.Switch.environment gt.root switch in
if not (OpamFile.exists env_file) then
(OpamSwitchState.with_ `Lock_none gt @@ fun st ->
let upd =
OpamEnv.updates ~set_opamroot ~set_opamswitch ~force_path st
in
log "Missing environment file, regenerates it";
if not (OpamCoreConfig.(!r.safe_mode)) then
(let _st =
OpamSwitchState.with_write_lock st @@ fun _st ->
(OpamFile.Environment.write env_file upd), _st
in ());
OpamEnv.add [] upd)
else
OpamEnv.get_opam_raw
~set_opamroot ~set_opamswitch ~force_path
gt.root switch
in
print_eval_env ~csh ~sexp ~fish env

Expand Down
2 changes: 1 addition & 1 deletion src/state/opamEnv.ml
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ let updates_common ~set_opamroot ~set_opamswitch root switch =
else [] in
root @ switch

let updates ~set_opamroot ~set_opamswitch ?force_path st =
let updates ?(set_opamroot=false) ?(set_opamswitch=false) ?force_path st =
updates_common ~set_opamroot ~set_opamswitch st.switch_global.root st.switch @
compute_updates ?force_path st

Expand Down
6 changes: 6 additions & 0 deletions src/state/opamEnv.mli
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ val get_pure: ?updates:env_update list -> unit -> env
returned by e.g. [get_full]!) *)
val add: env -> env_update list -> env

(** Like [get_opam] computes environment modification by OPAM , but returns
these [updates] instead of the new environment. *)
val updates:
?set_opamroot:bool -> ?set_opamswitch:bool -> ?force_path:bool ->
'a switch_state -> env_update list

(** Check if the shell environment is in sync with the current OPAM switch (or
if OPAMNOENVNOTICE has been set, in which case we just assume it's up to
date) *)
Expand Down

0 comments on commit 5f5e8bd

Please sign in to comment.