Fix `contrib/upgrade.sh` (#19222)
Fix `contrib/upgrade.sh` (#19222)

* fix idempotency of script (eg when aborting the downloads)
* improve readability (user facing variables first, definitions next, statements last)
* improve dependency checks
* fix ignored $giteaversion variable
* more logging
* print usage string on incorrect usage

go-gitea/gitea,go-gitea/gitea,go-gitea/gitea