N0REP0
### OPAMYES=1
### : --current option :
### opam switch create pinning --empty
### opam pin --current foo
[ERROR] foo is not installed, invalid flag `--current'
# Return code 2 #
### <pkg:foo.1>
opam-version:"2.0"
build: [ "echo" "foo" ]
### opam pin --current foo
[ERROR] foo is not installed, invalid flag `--current'
# Return code 2 #
### opam install foo
The following actions will be performed:
=== install 1 package
  - install foo 1

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
-> installed foo.1
Done.
### opam pin --current foo.2
[ERROR] foo.2 is not installed (version 1 is), invalid flag `--current'
# Return code 2 #
### opam pin --current foo
foo is now pinned locally (version 1)
### opam unpin foo
Ok, foo is no longer pinned locally (version 1)
Nothing to do.
### rm -rf REPO/packages/foo
### opam update

<><> Updating package repositories ><><><><><><><><><><><><><><><><><><><><><><>
[default] synchronised from file://${BASEDIR}/REPO
Now run 'opam upgrade' to apply any package updates.
### opam list --available --repo=default
# Packages matching: from-repository(default) & available
# No matches found
### opam list -A
# Packages matching: any
# Name # Installed # Synopsis
foo    1
### opam pin --current foo
foo is now pinned locally (version 1)
### : check no repin in case of double 'install .' :
### <pin:nip/nip.opam>
opam-version: "2.0"
### opam install ./nip
Package nip does not exist, create as a NEW package? [y/n] y
nip is now pinned to file://${BASEDIR}/nip (version dev)
The following actions will be performed:
=== install 1 package
  - install nip dev (pinned)

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
-> retrieved nip.dev  (file://${BASEDIR}/nip)
-> installed nip.dev
Done.
### opam remove nip
The following actions will be performed:
=== remove 1 package
  - remove nip dev (pinned)

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
-> removed   nip.dev
Done.
### opam install ./nip
[nip.dev] synchronised (no changes)
The following actions will be performed:
=== install 1 package
  - install nip dev (pinned)

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
-> retrieved nip.dev  (file://${BASEDIR}/nip)
-> installed nip.dev
Done.
### : depext update :
### OPAMNODEPEXTS=0 OPAMCONFIRMLEVEL=unsafe-yes
### opam var --global os-family=dummy-success
Added '[os-family "dummy-success" "Set through 'opam var'"]' to field global-variables in global configuration
### <pin:bar/bar.opam>
opam-version: "2.0"
depends: "qux"
depexts: [ "inexistant" ]
### <add_pin_depends.sh>
basedir=`echo $BASEDIR | sed "s/\\\\\\\\/\\\\\\\\\\\\\\\\/g"`
echo "pin-depends: [ \"qux.dev\" \"file://$basedir/qux\" ]" >> bar/bar.opam
### sh add_pin_depends.sh
### <pin:qux/qux.opam>
opam-version: "2.0"
depexts: [ "another-inexistant" ]
### opam pin ./bar | '.*(/|\\|")echo(\.exe)?"? "' -> 'echo "'
Package bar does not exist, create as a NEW package? [y/n] y
The following additional pinnings are required by bar.dev:
  - qux.dev at file://${BASEDIR}/qux
Pin and install them? [y/n] y
Package qux does not exist, create as a NEW package? [y/n] y
[qux.dev] synchronised (no changes)
qux is now pinned to file://${BASEDIR}/qux (version dev)
bar is now pinned to file://${BASEDIR}/bar (version dev)

The following actions will be performed:
=== install 2 packages
  - install bar dev (pinned)
  - install qux dev (pinned)

The following system packages will first need to be installed:
    another-inexistant inexistant

<><> Handling external dependencies <><><><><><><><><><><><><><><><><><><><><><>

opam believes some required external dependencies are missing. opam can:
> 1. Run echo to install them (may need root/sudo access)
  2. Display the recommended echo command and wait while you run it manually (e.g. in another terminal)
  3. Continue anyway, and, upon success, permanently register that this external dependency is present, but not detectable
  4. Abort the installation

[1/2/3/4] 1

echo "another-inexistant" "inexistant"
- another-inexistant inexistant

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
-> retrieved bar.dev  (file://${BASEDIR}/bar)
-> retrieved qux.dev  (file://${BASEDIR}/qux)
-> installed qux.dev
-> installed bar.dev
Done.
### opam unpin bar qux
Ok, qux is no longer pinned to file://${BASEDIR}/qux (version dev)
Ok, bar is no longer pinned to file://${BASEDIR}/bar (version dev)
[WARNING] Opam packages bar.dev and qux.dev depend on the following system packages that are no longer installed: another-inexistant inexistant
The following actions will be performed:
=== remove 2 packages
  - remove bar dev
  - remove qux dev

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
-> removed   bar.dev
-> removed   qux.dev
Done.
### opam install ./bar | '.*(/|\\|")echo(\.exe)?"? "' -> 'echo "'
Package bar does not exist, create as a NEW package? [y/n] y
The following additional pinnings are required by bar.dev:
  - qux.dev at file://${BASEDIR}/qux
Pin and install them? [y/n] y
Package qux does not exist, create as a NEW package? [y/n] y
[qux.dev] synchronised (no changes)
qux is now pinned to file://${BASEDIR}/qux (version dev)
bar is now pinned to file://${BASEDIR}/bar (version dev)
The following actions will be performed:
=== install 2 packages
  - install bar dev (pinned)
  - install qux dev (pinned) [required by bar]

The following system packages will first need to be installed:
    another-inexistant inexistant

<><> Handling external dependencies <><><><><><><><><><><><><><><><><><><><><><>

opam believes some required external dependencies are missing. opam can:
> 1. Run echo to install them (may need root/sudo access)
  2. Display the recommended echo command and wait while you run it manually (e.g. in another terminal)
  3. Continue anyway, and, upon success, permanently register that this external dependency is present, but not detectable
  4. Abort the installation

[1/2/3/4] 1

echo "another-inexistant" "inexistant"
- another-inexistant inexistant

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
-> retrieved bar.dev  (file://${BASEDIR}/bar)
-> retrieved qux.dev  (file://${BASEDIR}/qux)
-> installed qux.dev
-> installed bar.dev
Done.
### : Test opam pin remove <pkg>.<version>
### opam pin remove --no-action bar.dev
Ok, bar is no longer pinned to file://${BASEDIR}/bar (version dev)
### opam pin remove --no-action nip.wrong-version
[ERROR] nip is pinned but not to version wrong-version. Skipping.
# Return code 2 #
### : Test opam pin remove --all
### OPAMNODEPEXTS=1
### opam pin add --no-action bar.dev ./bar
[bar.dev] synchronised (file://${BASEDIR}/bar)
bar is now pinned to file://${BASEDIR}/bar (version dev)
### opam pin
bar.dev    rsync             file://${BASEDIR}/bar
foo.1      local definition
nip.dev    rsync             file://${BASEDIR}/nip
qux.dev    rsync             file://${BASEDIR}/qux
### opam pin remove --no-action --all
Ok, qux is no longer pinned to file://${BASEDIR}/qux (version dev)
Ok, nip is no longer pinned to file://${BASEDIR}/nip (version dev)
Ok, foo is no longer pinned locally (version 1)
Ok, bar is no longer pinned to file://${BASEDIR}/bar (version dev)
### opam pin
### opam pin ./bar
The following additional pinnings are required by bar.dev:
  - qux.dev at file://${BASEDIR}/qux
Pin and install them? [y/n] y
[qux.dev] synchronised (no changes)
qux is now pinned to file://${BASEDIR}/qux (version dev)
bar is now pinned to file://${BASEDIR}/bar (version dev)

Already up-to-date.
Nothing to do.
### opam pin --current foo
foo is now pinned locally (version 1)
### opam pin
bar.dev    rsync             file://${BASEDIR}/bar
foo.1      local definition
qux.dev    rsync             file://${BASEDIR}/qux
### opam pin remove --all foo
opam: opamMain.exe: Too many arguments.
      Usage: opamMain.exe pin [OPTION]... remove PACKAGES...|TARGET
      
# Return code 2 #
### opam pin remove --all
Ok, qux is no longer pinned to file://${BASEDIR}/qux (version dev)
Ok, foo is no longer pinned locally (version 1)
Ok, bar is no longer pinned to file://${BASEDIR}/bar (version dev)
The following actions will be performed:
=== remove 3 packages
  - remove bar dev
  - remove foo 1
  - remove qux dev

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
-> removed   bar.dev
-> removed   foo.1
-> removed   qux.dev
Done.
### opam pin
### : Error retrieving git pin :
### mkdir pin-empty
### git -C pin-empty init -q --initial-branch=master
### git -C pin-empty config core.autocrlf false
### <pin:pin-empty/opam>
opam-version: "2.0"
### opam pin --no-action ./pin-empty
[ERROR] Could not synchronize ${BASEDIR}/OPAM/pinning/.opam-switch/sources/pin-empty from "git+file://${BASEDIR}/pin-empty#master":
        Git repository seems just initialized, try again after your first commit
Could not retrieve some package sources, they will not be pinned nor installed:
  - pin-empty:git+file://${BASEDIR}/pin-empty#master

Continue anyway? [y/n] y
### opam pin
### git -C pin-empty add -A
### git -C pin-empty commit -qm 'opam'
### opam pin --no-action ./pin-empty
Package pin-empty does not exist, create as a NEW package? [y/n] y
pin-empty is now pinned to git+file://${BASEDIR}/pin-empty#master (version dev)
### opam unpin pin-empty
Ok, pin-empty is no longer pinned to git+file://${BASEDIR}/pin-empty#master (version dev)
### opam pin --no-action ./pin-empty#inexistant
[ERROR] Could not synchronize ${BASEDIR}/OPAM/pinning/.opam-switch/sources/pin-empty from "git+file://${BASEDIR}/pin-empty#inexistant":
        Branch inexistant not found
Could not retrieve some package sources, they will not be pinned nor installed:
  - pin-empty:git+file://${BASEDIR}/pin-empty#inexistant

Continue anyway? [y/n] y
### opam pin
