commitpkg: error out if the repo is not configured to latest specs

This ensures the repository we try to commit and release from uses the
latest distro specs for its local git config. The check errors out early
before touching anything and prints a recommendation how to update the
repo.

Signed-off-by: Levente Polyak <anthraxx@archlinux.org>
This commit is contained in:
Levente Polyak 2023-01-20 01:11:02 +01:00
parent 1ae09b43af
commit 7954382401
No known key found for this signature in database
GPG Key ID: FC1B547C8D8172C8
1 changed files with 6 additions and 0 deletions

View File

@ -64,6 +64,12 @@ if [[ ! -f PKGBUILD ]]; then
die 'No PKGBUILD file'
fi
if ! repo_spec=$(git config --local devtools.version) || [[ ${repo_spec} != "${GIT_REPO_SPEC_VERSION}" ]]; then
error "repository specs are out of date, try:"
msg2 'pkgctl repo configure'
exit 1
fi
if [[ "$(git symbolic-ref --short HEAD)" != main ]]; then
die 'must be run from the main branch'
fi