-
Notifications
You must be signed in to change notification settings - Fork 416
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pkg: copy files from opam repository to lock dir (#8648)
Signed-off-by: Ali Caglayan <[email protected]>
- Loading branch information
Showing
10 changed files
with
142 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
test/blackbox-tests/test-cases/pkg/opam-package-files-unix-error.t
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
This test demonstrates the behaviour when a Unix error is encountered when copying the | ||
files/ directory from a package directory inside an opam repostory. | ||
|
||
$ . ./helpers.sh | ||
|
||
Generate a mock opam repository | ||
$ mkdir -p mock-opam-repository | ||
$ cat >mock-opam-repository/repo <<EOF | ||
> opam-version: "2.0" | ||
> EOF | ||
|
||
|
||
Make a package with a patch | ||
$ mkpkg with-patch <<EOF | ||
> opam-version: "2.0" | ||
> EOF | ||
|
||
$ fname1="foo.patch" | ||
$ fname2="dir/bar.patch" | ||
$ opam_repo="mock-opam-repository/packages/with-patch/with-patch.0.0.1" | ||
$ mkdir -p $opam_repo/files/dir | ||
$ cat >$opam_repo/files/$fname1 <<EOF | ||
> foo | ||
> EOF | ||
$ cat >$opam_repo/files/$fname2 <<EOF | ||
> bar | ||
> EOF | ||
We remove the read permissions for dir/ | ||
|
||
$ chmod -r $opam_repo/files/dir | ||
|
||
The error message should have a location for the opam repository. | ||
|
||
This does not currently seem to be the case. | ||
|
||
$ solve_project <<EOF | ||
> (lang dune 3.8) | ||
> (package | ||
> (name x) | ||
> (allow_empty) | ||
> (depends with-patch)) | ||
> EOF | ||
Error: Unable to read file in opam repository: | ||
opendir($TESTCASE_ROOT/mock-opam-repository/packages/with-patch/with-patch.0.0.1/files/dir): Permission denied | ||
[1] | ||
|
||
Make sure to set permissions back so the sandbox can be cleaned up. | ||
|
||
$ chmod +r $opam_repo/files/dir |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters