check-commit: correct the exit status (was: always true)
This commit is contained in:
parent
7e75da2fa7
commit
c140f20c4e
@ -1,4 +1,4 @@
|
|||||||
#!/bin/sh
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
|
||||||
# CI Ebuild commit tester
|
# CI Ebuild commit tester
|
||||||
@ -19,8 +19,12 @@ fi
|
|||||||
[ -z "${ACCEPT_KEYWORDS}" ] && export ACCEPT_KEYWORDS='**'
|
[ -z "${ACCEPT_KEYWORDS}" ] && export ACCEPT_KEYWORDS='**'
|
||||||
|
|
||||||
|
|
||||||
|
test_success=true
|
||||||
|
|
||||||
|
|
||||||
# Use pkgchek
|
# Use pkgchek
|
||||||
pkgcheck scan --commits
|
pkgcheck scan --commits || test_success=false
|
||||||
|
|
||||||
|
|
||||||
# Iterate through changed files in last commit
|
# Iterate through changed files in last commit
|
||||||
# For each of these use dirname to change directory
|
# For each of these use dirname to change directory
|
||||||
@ -28,10 +32,16 @@ pkgcheck scan --commits
|
|||||||
# and run repoman in there
|
# and run repoman in there
|
||||||
for file in $(git diff --name-only HEAD HEAD~1)
|
for file in $(git diff --name-only HEAD HEAD~1)
|
||||||
do
|
do
|
||||||
if cd "$(dirname "${file}")"; then
|
commit_dir="$(dirname "${file}")"
|
||||||
|
[[ "${commit_dir}" = *files ]] && continue
|
||||||
|
[[ "${commit_dir}" = *eclass ]] && continue
|
||||||
|
if cd "${commit_dir}"; then
|
||||||
echo
|
echo
|
||||||
echo "Directory $(pwd):"
|
echo "Directory $(pwd):"
|
||||||
repoman -Idix
|
repoman -Idix || test_success=false
|
||||||
cd - >/dev/null || return
|
cd - >/dev/null || return
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# If any of the QA tools fail the test will fail
|
||||||
|
[ ${test_success} = false ] && ( echo "Exiting with failure due to previous errors..."; exit 1 )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user