From 79543824011ba51ddad6a4dda8c8c585ea8e5e0a Mon Sep 17 00:00:00 2001 From: Levente Polyak Date: Fri, 20 Jan 2023 01:11:02 +0100 Subject: 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 --- src/commitpkg.in | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/commitpkg.in b/src/commitpkg.in index 5f29881..7573d9b 100644 --- a/src/commitpkg.in +++ b/src/commitpkg.in @@ -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 -- cgit v1.2.3-70-g09d2