N0REP0
### :::::: do not rebuild packages when only unimportant constraint has been changed (#4647)
### <pkg:a.1>
opam-version: "2.0"
depends: ["b"]
### <pkg:b.1>
opam-version: "2.0"
### opam switch create default --empty
### opam install -y a
The following actions will be performed:
=== install 2 packages
  - install a 1
  - install b 1 [required by a]

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
-> installed b.1
-> installed a.1
Done.
### :::::: Check that nothing gets rebuild if only the synopsis and flags (verbose) changes
### <pkg:a.1>
opam-version: "2.0"
synopsis: "test"
flags: verbose
depends: ["b"]
### opam upgrade --show
Already up-to-date.
Nothing to do.
### :::::: Check that a rebuild occurs if only the flags (plugin) changes
### <pkg:a.1>
opam-version: "2.0"
flags: plugin
depends: ["b"]
### opam upgrade --show
The following actions would be performed:
=== recompile 1 package
  - recompile a 1 [upstream or system changes]
### :::::: Check that nothing gets rebuild if only a constraint – that is already installed – changes
### <pkg:a.1>
opam-version: "2.0"
depends: ["b" {= version}]
### opam upgrade --show
Already up-to-date.
Nothing to do.
### :::::: Check that a rebuild occurs if the build field changes
### <pkg:a.1>
opam-version: "2.0"
build: ["opam" "var" "switch"]
depends: ["b" {= version}]
### opam upgrade -y --verbose | sed-cmd opam
The following actions will be performed:
=== recompile 1 package
  - recompile a 1 [upstream or system changes]

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
Processing  2/4: [a: opam var]
+ opam "var" "switch" (CWD=${BASEDIR}/OPAM/default/.opam-switch/build/a.1)
- default
-> compiled  a.1
-> removed   a.1
-> installed a.1
Done.
### :::::: Check that the package gets removed if it is no longer installable
### <pkg:a.1>
opam-version: "2.0"
build: ["opam" "var" "switch"]
depends: ["b" {= "2"}]
### opam upgrade --show
The following actions would be performed:
=== remove 1 package
  - remove a 1
### :::::: Check that rebuilding a dependency correctly rebuilds the package requiring it
### <pkg:a.1>
opam-version: "2.0"
build: ["opam" "var" "switch"]
depends: ["b" {= version}]
### <pkg:b.1>
opam-version: "2.0"
depends: ["c"]
### <pkg:c.1>
opam-version: "2.0"
### opam upgrade --show
The following actions would be performed:
=== recompile 2 packages
  - recompile a 1
  - recompile b 1
=== install 1 package
  - install   c 1
### :::::: Check that reinstalling a non-installed package is equivalent to installing it
### <pkg:d.1>
opam-version: "2.0"
### opam reinstall d --cudf=reinstall --show --yes
d is not installed. Install it? [y/n] y
The following actions would be performed:
=== install 1 package
  - install d 1
### opam install d --cudf=install --show --yes
The following actions would be performed:
=== install 1 package
  - install d 1
### diff install-1.cudf reinstall-1.cudf
### :::::: Check again with one install and one non-installed
### opam reinstall d a --cudf=reinstall --show --yes
d is not installed. Install it? [y/n] y
The following actions would be performed:
=== recompile 2 packages
  - recompile a 1
  - recompile b 1
=== install 2 packages
  - install   c 1
  - install   d 1
### opam install d a --cudf=install --show --yes
[NOTE] Package a is already installed (current version is 1).
The following actions would be performed:
=== recompile 2 packages
  - recompile a 1
  - recompile b 1
=== install 2 packages
  - install   c 1
  - install   d 1
### diff install-1.cudf reinstall-1.cudf
20a21
> reinstall: true
54c55
< install: d , a
---
> install: d , a = 1
# Return code 1 #
### :::::: Check that we still get the reason for installing a package when using opam reinstall
### <pkg:e.1>
opam-version: "2.0"
depends: ["d"]
### opam reinstall e --yes --show
e is not installed. Install it? [y/n] y
The following actions would be performed:
=== install 2 packages
  - install d 1 [required by e]
  - install e 1
