Skip to content

Commit

Permalink
Merge pull request #6027 from kit-ty-kate/improved-error-msg-rsync
Browse files Browse the repository at this point in the history
Improve the error message when a directory is not available while fetching using rsync
  • Loading branch information
kit-ty-kate authored Sep 16, 2024
2 parents ba40b36 + 656b860 commit a182327
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
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

0 comments on commit a182327

Please sign in to comment.