Commit 12c15ddf authored by Johannes Löthberg's avatar Johannes Löthberg
Browse files

db-move: Clarify error message when the specified repo isn't correct for the...


db-move: Clarify error message when the specified repo isn't correct for the current dbscripts instance

It's not entirely clear what a "configured repository" is, but hopefully
saying that the given repo isn't a "valid repository" is clearer.

In typical use this will result in an error like this:

    ==> ERROR: extra is not a valid repository for /community/db-move

or this:

    ==> ERROR: community-testing is not a valid repository for /packages/db-move

Signed-off-by: Johannes Löthberg's avatarJohannes Löthberg <johannes@kyriasis.com>
parent 9dcd82a6
Pipeline #12645 passed with stage
in 9 minutes and 3 seconds
......@@ -20,9 +20,9 @@ if in_array "${repo_from}" "${STAGING_REPOS[@]}" && in_array "${repo_to}" "${STA
fi
if ! check_repo_configured "$repo_from"; then
die "%s is not a configured repository" "$repo_from"
die "%s is not a valid repository for %s" "$repo_from" "$0"
elif ! check_repo_configured "$repo_to"; then
die "%s is not a configured repository" "$repo_to"
die "%s is not a valid repository for %s" "$repo_to" "$0"
fi
if ! check_repo_permission "$repo_to" || ! check_repo_permission "$repo_from"; then
......
......@@ -124,15 +124,15 @@ load ../lib/common
checkPackage testing pkg-split-b 1-1
}
@test "move not configured repo" {
@test "move not valid repo" {
releasePackage extra pkg-any-a
db-update
run db-move extra community pkg-any-a
[ "$status" -ne 0 ]
[[ $output == *'community is not a configured'* ]]
[[ $output == *'community is not a valid'* ]]
run db-move notconfigured community pkg-any-a
[ "$status" -ne 0 ]
[[ $output == *'notconfigured is not a configured'* ]]
[[ $output == *'notconfigured is not a valid'* ]]
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment