repo-add: clarify exit messages

Clarify if repo-add does not create a new database due to failures
or due to there being nothing to do.

Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
Allan McRae 2023-09-30 23:27:04 +10:00
parent f91fa546f6
commit 332d2a1922

View file

@ -700,13 +700,17 @@ for arg in "${args[@]:1}"; do
done done
# if the whole operation was a success, re-zip and rotate databases # if the whole operation was a success, re-zip and rotate databases
if (( !fail )) && (( DB_MODIFIED )); then if (( fail )); then
msg "$(gettext "Package database was not modified due to errors.")"
exit 1
fi
if (( DB_MODIFIED )); then
msg "$(gettext "Creating updated database file '%s'")" "$REPO_DB_FILE" msg "$(gettext "Creating updated database file '%s'")" "$REPO_DB_FILE"
create_db create_db
rotate_db rotate_db
else else
msg "$(gettext "No packages modified, nothing to do.")" msg "$(gettext "No changes made to package database.")"
exit $(( fail != 0 ))
fi fi
exit 0 exit 0