Skip to content

Commit

Permalink
update after the real purpose of the PR
Browse files Browse the repository at this point in the history
  • Loading branch information
rjbou committed Aug 28, 2024
1 parent 4340735 commit 70d1cf7
Show file tree
Hide file tree
Showing 5 changed files with 104 additions and 27 deletions.
2 changes: 1 addition & 1 deletion tests/reftests/admin.test
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,7 @@ opam-version: "2.0"
### <packages/no-extra/no-extra.1/files/missing-file>
nothing here
### OPAMDEBUGSECTIONS="opam-file" OPAMDEBUG=-2 opam admin list
opam-file Missing extra-files field for missing-file for no-extra.1, adding them.
opam-file Missing extra-files field for missing-file for no-extra.1, ignoring them.
# Packages matching: available
# Name # Installed # Synopsis
no-extra --
Expand Down
78 changes: 52 additions & 26 deletions tests/reftests/extrafile.test
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,9 @@ Now run 'opam upgrade' to apply any package updates.
### :::::::::::::::::
### sh -c "rm OPAM/repo/state-*.cache"
### OPAMDEBUGSECTIONS="opam-file" OPAMDEBUG=-2 opam list good-md5 -s | unordered
opam-file Missing extra-files field for p.patch for no-checksum.1, ignoring them.
opam-file Missing extra-files field for p.patch for not-mentioned.1, ignoring them.
opam-file Missing expected extra files ../../../no-checksum/no-checksum.1/files/p.patch at ${BASEDIR}/OPAM/repo/default/packages/escape-good-md5/escape-good-md5.1/files
opam-file Missing extra-files field for p.patch for no-checksum.1, adding them.
opam-file Missing extra-files field for p.patch for not-mentioned.1, adding them.
opam-file Missing expected extra files p.patch at ${BASEDIR}/OPAM/repo/default/packages/not-present/not-present.1/files
opam-file Mismatching extra-files at ${BASEDIR}/OPAM/repo/default/packages/good-md5-good-sha256/good-md5-good-sha256.1: missing from 'files' directory (1)
opam-file Missing expected extra files /etc/passwdd at ${BASEDIR}/OPAM/repo/default/packages/escape-absolute/escape-absolute.1/files
Expand Down Expand Up @@ -355,20 +355,21 @@ The following actions will be performed:
- install no-checksum 1

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
-> installed no-checksum.1
Done.
[ERROR] The compilation of no-checksum.1 failed at "test -f p.patch".




<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
+- The following actions failed
| - build no-checksum 1
+-
- No changes have been performed
# Return code 31 #
### opam remove no-checksum
[ERROR] In the opam file for no-checksum.1:
- At ${BASEDIR}/OPAM/repo/default/packages/no-checksum/no-checksum.1/opam:11:2-11:13::
expected [file checksum]
'extra-files' has been ignored.
The following actions will be performed:
=== remove 1 package
- remove no-checksum 1
[NOTE] no-checksum is not installed.

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
-> removed no-checksum.1
Done.
Nothing to do.
### opam install no-checksum --require-checksums
[ERROR] In the opam file for no-checksum.1:
- At ${BASEDIR}/OPAM/repo/default/packages/no-checksum/no-checksum.1/opam:11:2-11:13::
Expand All @@ -379,11 +380,21 @@ The following actions will be performed:
- install no-checksum 1

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
-> installed no-checksum.1
Done.
[ERROR] The compilation of no-checksum.1 failed at "test -f p.patch".




<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
+- The following actions failed
| - build no-checksum 1
+-
- No changes have been performed
# Return code 31 #
### opam source no-checksum
Successfully extracted to ${BASEDIR}/no-checksum.1
### test -f no-checksum.1/p.patch
# Return code 1 #
### opam clean --download-cache
Clearing cache of downloaded files
### :::::::::::::::::
Expand All @@ -400,27 +411,42 @@ The following actions will be performed:
- install not-mentioned 1

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
-> installed not-mentioned.1
Done.
[ERROR] The compilation of not-mentioned.1 failed at "test -f p.patch".




<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
+- The following actions failed
| - build not-mentioned 1
+-
- No changes have been performed
# Return code 31 #
### opam remove not-mentioned
The following actions will be performed:
=== remove 1 package
- remove not-mentioned 1
[NOTE] not-mentioned is not installed.

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
-> removed not-mentioned.1
Done.
Nothing to do.
### opam install not-mentioned --require-checksums
The following actions will be performed:
=== install 1 package
- install not-mentioned 1

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
-> installed not-mentioned.1
Done.
[ERROR] The compilation of not-mentioned.1 failed at "test -f p.patch".




<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
+- The following actions failed
| - build not-mentioned 1
+-
- No changes have been performed
# Return code 31 #
### opam source not-mentioned
Successfully extracted to ${BASEDIR}/not-mentioned.1
### test -f not-mentioned.1/p.patch
# Return code 1 #
### opam clean --download-cache
Clearing cache of downloaded files
### :II:2: not present
Expand Down
15 changes: 15 additions & 0 deletions tests/reftests/legacy-git.test
Original file line number Diff line number Diff line change
Expand Up @@ -652,6 +652,21 @@ Testing optional dependencies
### cp packages/P5.opam REPO/packages/P5.1/opam
### cp packages/P5/README REPO/packages/P5.1/descr
### sh mkurl.sh P5.1 P5.tar.gz
### <hash.sh>
set -ue
for nv in REPO/packages/*; do
nv=`echo $nv | cut -f3 -d/`
n=`echo $nv | cut -f1 -d.`
path=REPO/packages/$nv
if [ -d $path/files ]; then
echo "extra-files:[" >> $path/opam
for file in `ls $path/files`; do
echo " [\"$file\" \"md5=`openssl md5 $path/files/$file | cut -f2 -d' '`\"]" >> $path/opam
done
echo "]" >> $path/opam
fi
done
### sh hash.sh
### git -C REPO/packages/ocaml.system add *
### git -C REPO/packages/ocaml.system commit -qm "Adding ocaml.system"
### git -C REPO/packages/ocaml.20 add *
Expand Down
15 changes: 15 additions & 0 deletions tests/reftests/legacy-local.test
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,21 @@ Testing optional dependencies
### cp packages/P5.opam REPO/packages/P5.1/opam
### cp packages/P5/README REPO/packages/P5.1/descr
### sh mkurl.sh P5.1 P5.tar.gz
### <hash.sh>
set -ue
for nv in REPO/packages/*; do
nv=`echo $nv | cut -f3 -d/`
n=`echo $nv | cut -f1 -d.`
path=REPO/packages/$nv
if [ -d $path/files ]; then
echo "extra-files:[" >> $path/opam
for file in `ls $path/files`; do
echo " [\"$file\" \"md5=`openssl md5 $path/files/$file | cut -f2 -d' '`\"]" >> $path/opam
done
echo "]" >> $path/opam
fi
done
### sh hash.sh
### <REPO/repo>
archive-mirrors: "cache"
### opam update
Expand Down
21 changes: 21 additions & 0 deletions tests/reftests/repository.test
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
N0REP0
### <hash.sh>
set -ue
repo=$1
nv=$2
n=`echo $nv | cut -f1 -d.`
path=$repo/packages/$n/$nv
echo "extra-files:[" >> $path/opam
for file in `ls $path/files`; do
echo " [\"$file\" \"md5=`openssl md5 $path/files/$file | cut -f2 -d' '`\"]" >> $path/opam
done
echo "]" >> $path/opam
### <REPO/packages/foo/foo.1/opam>
opam-version: "2.0"
build: ["test" "-f" "bar"]
### <REPO/packages/foo/foo.1/files/bar>
some content
### sh hash.sh REPO foo.1
### : Internal repository storage as archive or plain directory :
### opam switch create tarring --empty
### opam update -vv | grep '^\+' | sed-cmd diff | sed-cmd patch | 'patch-[^"]+' -> 'patch'
Expand All @@ -25,6 +37,7 @@ opam-version: "2.0"
build: ["test" "-f" "baz"]
### <REPO/packages/foo/foo.2/files/baz>
some content
### sh hash.sh REPO foo.2
### opam update default -vv | grep '^\+' | sed-cmd tar | sed-cmd diff | sed-cmd patch | 'patch-[^"]+' -> 'patch'
+ diff "-ruaN" "default" "default.new" (CWD=${BASEDIR}/OPAM/repo)
+ patch "--version"
Expand All @@ -45,6 +58,7 @@ opam-version: "2.0"
build: ["test" "-f" "baz"]
### <REPO/packages/foo/foo.3/files/baz>
some content
### sh hash.sh REPO foo.3
### opam repository add tarred ./REPO --this-switch
[tarred] Initialised
### : New tarred repositories does not change already unchanged existing ones
Expand All @@ -63,6 +77,7 @@ opam-version: "2.0"
build: ["test" "-f" "baz"]
### <REPO/packages/foo/foo.4/files/baz>
some content
### sh hash.sh REPO foo.4
### opam update -vv | grep '^\+' | sed-cmd tar | sed-cmd diff | sed-cmd patch | 'patch-[^"]+' -> 'patch'
+ tar "xfz" "${BASEDIR}/OPAM/repo/tarred.tar.gz" "-C" "${OPAMTMP}"
+ diff "-ruaN" "tarred" "tarred.new" (CWD=${OPAMTMP})
Expand All @@ -86,6 +101,7 @@ opam-version: "2.0"
build: ["test" "-f" "quux"]
### <REPO/packages/foo/foo.5/files/quux>
some content
### sh hash.sh REPO foo.5
### opam update -vv | grep '^\+' | sed-cmd tar | sed-cmd diff | sed-cmd patch | 'patch-[^"]+' -> 'patch'
+ tar "xfz" "${BASEDIR}/OPAM/repo/tarred.tar.gz" "-C" "${OPAMTMP}"
+ diff "-ruaN" "tarred" "tarred.new" (CWD=${OPAMTMP})
Expand All @@ -107,6 +123,7 @@ opam-version: "2.0"
build: ["test" "-f" "rab"]
### <REPO/packages/foo/foo.4/files/rab>
some content
### sh hash.sh REPO foo.4
### OPAMDEBUGSECTIONS="FILE(opam) FILE(repo) FILE(repos-config) CACHE(repository)"
### opam update --debug-level=-3 | "state-[0-9A-Z]{8}" -> "state-hash" | unordered
FILE(config) Read ${BASEDIR}/OPAM/config in 0.000s
Expand Down Expand Up @@ -168,6 +185,7 @@ opam-version: "2.0"
build: ["test" "-f" "oof"]
### <REPO2/packages/bar/bar.1/files/oof>
some content
### sh hash.sh REPO2 bar.1
### opam repository add repo2 ./REPO2 --this-switch
[repo2] Initialised
### opam update --debug-level=-3 | "state-[0-9A-Z]{8}" -> "state-hash"
Expand All @@ -192,6 +210,7 @@ opam-version: "2.0"
build: ["test" "-f" "oof"]
### <REPO2/packages/bar/bar.2/files/oof>
some content
### sh hash.sh REPO2 bar.2
### opam update --debug-level=-3 | "state-[0-9A-Z]{8}" -> "state-hash" | unordered
FILE(config) Read ${BASEDIR}/OPAM/config in 0.000s
FILE(repos-config) Read ${BASEDIR}/OPAM/repo/repos-config in 0.000s
Expand Down Expand Up @@ -221,11 +240,13 @@ opam-version: "2.0"
build: ["test" "-f" "rab"]
### <REPO/packages/foo/foo.6/files/rab>
some content
### sh hash.sh REPO foo.6
### <REPO2/packages/bar/bar.3/opam>
opam-version: "2.0"
build: ["test" "-f" "oof"]
### <REPO2/packages/bar/bar.3/files/oof>
some content
### sh hash.sh REPO2 bar.3
### opam update --debug-level=-3 | "state-[0-9A-Z]{8}" -> "state-hash" | unordered
FILE(config) Read ${BASEDIR}/OPAM/config in 0.000s
FILE(repos-config) Read ${BASEDIR}/OPAM/repo/repos-config in 0.000s
Expand Down

0 comments on commit 70d1cf7

Please sign in to comment.