N0REP0
### OPAMYES=1
### :::::::::::::::::::::::
### :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)
### :::::::::::::::::::::::
### :2: 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.
### :::::::::::::::::::::::
### :3: 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.
### :::::::::::::::::::::::
### :4: 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 #
### opam pin remove --no-action bar.dev
[NOTE] bar is not pinned.
### :::::::::::::::::::::::
### :5: 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
### :::::::::::::::::::::::
### :6: 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
### :::::::::::::::::::::::
### :7: Parse error with future opam version field on pin
### :::::::::::::::::::::::
### :7:a: just the opam version that is a future
### <pin:pin-at-two-one/pin-at-two-one.opam>
opam-version: "2.1"
### opam install ./pin-at-two-one
[ERROR] In ${BASEDIR}/pin-at-two-one/pin-at-two-one.opam:
        unsupported or missing file format version; should be 2.0 or older [skipped]

[ERROR] Invalid opam file in pin-at-two-one source from file://${BASEDIR}/pin-at-two-one:
             error  2: File format error: unsupported or missing file format version; should be 2.0 or older
[ERROR] No package named pin-at-two-one found.
# Return code 5 #
### OPAMSTRICT=0 opam install ./pin-at-two-one
[ERROR] In ${BASEDIR}/pin-at-two-one/pin-at-two-one.opam:
        unsupported or missing file format version; should be 2.0 or older [skipped]

[ERROR] Invalid opam file in pin-at-two-one source from file://${BASEDIR}/pin-at-two-one:
             error  2: File format error: unsupported or missing file format version; should be 2.0 or older
[ERROR] No package named pin-at-two-one found.
# Return code 5 #
### <pin:pin-at-two-two/pin-at-two-two.opam>
opam-version: "2.2"
### 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 [skipped]

[ERROR] Invalid opam file in pin-at-two-two source from file://${BASEDIR}/pin-at-two-two:
             error  2: File format error: unsupported or missing file format version; should be 2.0 or older
[ERROR] No package named pin-at-two-two found.
# Return code 5 #
### OPAMSTRICT=0 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 [skipped]

[ERROR] Invalid opam file in pin-at-two-two source from file://${BASEDIR}/pin-at-two-two:
             error  2: File format error: unsupported or missing file format version; should be 2.0 or older
[ERROR] No package named pin-at-two-two found.
# Return code 5 #
### <pin:pin-at-two-three/pin-at-two-three.opam>
opam-version: "2.3"
### 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 [skipped]

[ERROR] Invalid opam file in pin-at-two-three source from file://${BASEDIR}/pin-at-two-three:
             error  2: File format error: unsupported or missing file format version; should be 2.0 or older
[ERROR] No package named pin-at-two-three found.
# Return code 5 #
### OPAMSTRICT=0 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 [skipped]

[ERROR] Invalid opam file in pin-at-two-three source from file://${BASEDIR}/pin-at-two-three:
             error  2: File format error: unsupported or missing file format version; should be 2.0 or older
[ERROR] No package named pin-at-two-three found.
# Return code 5 #
### <pin:pin-at-future/pin-at-future.opam>
opam-version: "50.0"
### opam install ./pin-at-future
[ERROR] In ${BASEDIR}/pin-at-future/pin-at-future.opam:
        unsupported or missing file format version; should be 2.0 or older [skipped]

[ERROR] Invalid opam file in pin-at-future source from file://${BASEDIR}/pin-at-future:
             error  2: File format error: unsupported or missing file format version; should be 2.0 or older
[ERROR] No package named pin-at-future found.
# Return code 5 #
### OPAMSTRICT=0 opam install ./pin-at-future
[ERROR] In ${BASEDIR}/pin-at-future/pin-at-future.opam:
        unsupported or missing file format version; should be 2.0 or older [skipped]

[ERROR] Invalid opam file in pin-at-future source from file://${BASEDIR}/pin-at-future:
             error  2: File format error: unsupported or missing file format version; should be 2.0 or older
[ERROR] No package named pin-at-future found.
# Return code 5 #
### :7:b: opam version is a future and there is a parse error
### <junk.sh>
echo GARBAGE>>"$1"
### sh junk.sh pin-at-two-one/pin-at-two-one.opam
### opam install ./pin-at-two-one
[ERROR] At ${BASEDIR}/pin-at-two-one/pin-at-two-one.opam:11:0-11:0::
        Parse error
[ERROR] Strict mode: aborting
# Return code 30 #
### OPAMSTRICT=0 opam install ./pin-at-two-one
[ERROR] At ${BASEDIR}/pin-at-two-one/pin-at-two-one.opam:11:0-11:0::
        Parse error [skipped]

[ERROR] Invalid opam file in pin-at-two-one source from file://${BASEDIR}/pin-at-two-one:
             error  2: File format error at line 11, column 0: Parse error
[ERROR] No package named pin-at-two-one found.
# Return code 5 #
### sh junk.sh pin-at-two-two/pin-at-two-two.opam
### opam install ./pin-at-two-two
[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 #
### OPAMSTRICT=0 opam install ./pin-at-two-two
[ERROR] At ${BASEDIR}/pin-at-two-two/pin-at-two-two.opam:11:0-11:0::
        Parse error [skipped]

[ERROR] Invalid opam file in pin-at-two-two source from file://${BASEDIR}/pin-at-two-two:
             error  2: File format error at line 11, column 0: Parse error
[ERROR] No package named pin-at-two-two found.
# Return code 5 #
### sh junk.sh pin-at-two-three/pin-at-two-three.opam
### opam install ./pin-at-two-three
[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 #
### OPAMSTRICT=0 opam install ./pin-at-two-three
[ERROR] At ${BASEDIR}/pin-at-two-three/pin-at-two-three.opam:11:0-11:0::
        Parse error [skipped]

[ERROR] Invalid opam file in pin-at-two-three source from file://${BASEDIR}/pin-at-two-three:
             error  2: File format error at line 11, column 0: Parse error
[ERROR] No package named pin-at-two-three found.
# Return code 5 #
### sh junk.sh pin-at-future/pin-at-future.opam
### opam install ./pin-at-future
[ERROR] In ${BASEDIR}/pin-at-future/pin-at-future.opam:
        unsupported or missing file format version; should be 2.0 or older [skipped]

[ERROR] Invalid opam file in pin-at-future source from file://${BASEDIR}/pin-at-future:
             error  2: File format error: unsupported or missing file format version; should be 2.0 or older
[ERROR] No package named pin-at-future found.
# Return code 5 #
### OPAMSTRICT=0 opam install ./pin-at-future
[ERROR] In ${BASEDIR}/pin-at-future/pin-at-future.opam:
        unsupported or missing file format version; should be 2.0 or older [skipped]

[ERROR] Invalid opam file in pin-at-future source from file://${BASEDIR}/pin-at-future:
             error  2: File format error: unsupported or missing file format version; should be 2.0 or older
[ERROR] No package named pin-at-future found.
# Return code 5 #
