Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Improve the error message when a directory is not available while fetching using rsync #6027

Merged
merged 1 commit into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions master_changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ users)

## Global CLI
* Add cli version 2.3 [#6045 #6151 @rjbou]
* Improve the error message when a directory is not available while fetching using rsync [#6027 @kit-ty-kate]

## Plugins

Expand Down
4 changes: 2 additions & 2 deletions src/repository/opamLocal.ml
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,9 @@ module B = struct
else
OpamFilename.mkdir quarantine;
pull_dir_quiet quarantine url) @@+ function
| Not_available _ ->
| Not_available (_, msg) ->
finalise ();
Done (OpamRepositoryBackend.Update_err (Failure "rsync failed"))
Done (OpamRepositoryBackend.Update_err (Failure ("rsync error: " ^ msg)))
| Up_to_date _ ->
finalise (); Done OpamRepositoryBackend.Update_empty
| Result _ ->
Expand Down
16 changes: 8 additions & 8 deletions tests/reftests/repository.test
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ first --
### <OPER/packages/fantom/fantom.0/opam>
opam-version: "2.0"
### opam repository set-url oper ./OPER4
[ERROR] Could not update repository "oper": rsync failed
[ERROR] Could not update repository "oper": rsync error: Directory ${BASEDIR}/OPER4/ does not exist
[ERROR] Fetching repository oper with file://${BASEDIR}/OPER4 fails, reverting to file://${BASEDIR}/OPER
# Return code 40 #
### opam list --available --repo=oper
Expand Down Expand Up @@ -329,7 +329,7 @@ first --
# Name # Installed # Synopsis
first --
### opam repository set-url oper ./OPER4
[ERROR] Could not update repository "oper": rsync failed
[ERROR] Could not update repository "oper": rsync error: Directory ${BASEDIR}/OPER4/ does not exist
[ERROR] Fetching repository oper with file://${BASEDIR}/OPER4 fails, reverting to git+file://${BASEDIR}/OPER
# Return code 40 #
### opam list --available --repo=oper
Expand Down Expand Up @@ -369,15 +369,15 @@ first --
[oper] Initialised
### :: Simply failing urls ::
### opam repository --this-switch add oper4 ./OPER4
[ERROR] Could not update repository "oper4": rsync failed
[ERROR] Could not update repository "oper4": rsync error: Directory ${BASEDIR}/OPER4/ does not exist
[ERROR] Initial repository fetch failed
# Return code 40 #
### opam repository --this-switch

<><> Repository configuration for switch repos ><><><><><><><><><><><><><><><><>
1 oper file://${BASEDIR}/OPER
### opam repository --this-switch set-url oper ./OPER4
[ERROR] Could not update repository "oper": rsync failed
[ERROR] Could not update repository "oper": rsync error: Directory ${BASEDIR}/OPER4/ does not exist
[ERROR] Fetching repository oper with file://${BASEDIR}/OPER4 fails, reverting to file://${BASEDIR}/OPER
# Return code 40 #
### opam repository --this-switch
Expand Down Expand Up @@ -456,7 +456,7 @@ first --
### <OPER/packages/fantom/fantom.0/opam>
opam-version: "2.0"
### opam repository set-url oper ./OPER4
[ERROR] Could not update repository "oper": rsync failed
[ERROR] Could not update repository "oper": rsync error: Directory ${BASEDIR}/OPER4/ does not exist
[ERROR] Fetching repository oper with file://${BASEDIR}/OPER4 fails, reverting to file://${BASEDIR}/OPER
# Return code 40 #
### opam list --available --repo=oper
Expand Down Expand Up @@ -495,7 +495,7 @@ first --
# Name # Installed # Synopsis
first --
### opam repository set-url oper ./OPER4
[ERROR] Could not update repository "oper": rsync failed
[ERROR] Could not update repository "oper": rsync error: Directory ${BASEDIR}/OPER4/ does not exist
[ERROR] Fetching repository oper with file://${BASEDIR}/OPER4 fails, reverting to git+file://${BASEDIR}/OPER
# Return code 40 #
### opam list --available --repo=oper
Expand Down Expand Up @@ -535,15 +535,15 @@ first --
[oper] Initialised
### ::: Simply failing urls :::
### opam repository --this-switch add oper4 ./OPER4
[ERROR] Could not update repository "oper4": rsync failed
[ERROR] Could not update repository "oper4": rsync error: Directory ${BASEDIR}/OPER4/ does not exist
[ERROR] Initial repository fetch failed
# Return code 40 #
### opam repository --this-switch

<><> Repository configuration for switch repos ><><><><><><><><><><><><><><><><>
1 oper file://${BASEDIR}/OPER
### opam repository --this-switch set-url oper ./OPER4
[ERROR] Could not update repository "oper": rsync failed
[ERROR] Could not update repository "oper": rsync error: Directory ${BASEDIR}/OPER4/ does not exist
[ERROR] Fetching repository oper with file://${BASEDIR}/OPER4 fails, reverting to file://${BASEDIR}/OPER
# Return code 40 #
### opam repository --this-switch
Expand Down
Loading