src/check-commit: make the script more readable
This commit is contained in:
parent
f276798372
commit
7e22a6ba14
@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
# Check if we are in a git repo
|
# Check if we are in a git repo
|
||||||
if ! git status >/dev/null; then
|
if ! git status >/dev/null; then
|
||||||
echo Stop
|
echo "Stop"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -18,6 +18,11 @@ fi
|
|||||||
[ -z "${ARCH}" ] && export ARCH=x86_64
|
[ -z "${ARCH}" ] && export ARCH=x86_64
|
||||||
[ -z "${ACCEPT_KEYWORDS}" ] && export ACCEPT_KEYWORDS='**'
|
[ -z "${ACCEPT_KEYWORDS}" ] && export ACCEPT_KEYWORDS='**'
|
||||||
|
|
||||||
|
# create "eclass"
|
||||||
|
# apparently pkgcheck needs it
|
||||||
|
# "pkgcheck scan: error: failed running git: fatal: eclass: no such path in the working tree."
|
||||||
|
[ -d eclass ] || mkdir eclass
|
||||||
|
|
||||||
|
|
||||||
# First test for a whole repo
|
# First test for a whole repo
|
||||||
# This will likely exit firh error, because repoman
|
# This will likely exit firh error, because repoman
|
||||||
@ -28,12 +33,6 @@ repoman -Idix
|
|||||||
pkgcheck scan
|
pkgcheck scan
|
||||||
|
|
||||||
|
|
||||||
# create "eclass"
|
|
||||||
# apparently pkgcheck needs it
|
|
||||||
# "pkgcheck scan: error: failed running git: fatal: eclass: no such path in the working tree."
|
|
||||||
[ -d eclass ] || mkdir eclass
|
|
||||||
|
|
||||||
|
|
||||||
echo ">>> Starting latest commit test"
|
echo ">>> Starting latest commit test"
|
||||||
|
|
||||||
test_success=true
|
test_success=true
|
||||||
@ -48,12 +47,16 @@ pkgcheck scan --commits || test_success=false
|
|||||||
for file in $(git diff --name-only HEAD HEAD~1)
|
for file in $(git diff --name-only HEAD HEAD~1)
|
||||||
do
|
do
|
||||||
commit_dir="$(dirname "${file}")"
|
commit_dir="$(dirname "${file}")"
|
||||||
|
|
||||||
|
# skip these directories
|
||||||
[[ "${commit_dir}" = *eclass ]] && continue
|
[[ "${commit_dir}" = *eclass ]] && continue
|
||||||
[[ "${commit_dir}" = *files ]] && continue
|
[[ "${commit_dir}" = *files ]] && continue
|
||||||
[[ "${commit_dir}" = *licenses* ]] && continue
|
[[ "${commit_dir}" = *licenses* ]] && continue
|
||||||
[[ "${commit_dir}" = *metadata* ]] && continue
|
[[ "${commit_dir}" = *metadata* ]] && continue
|
||||||
[[ "${commit_dir}" = *profiles ]] && continue
|
[[ "${commit_dir}" = *profiles ]] && continue
|
||||||
if cd "${commit_dir}"; then
|
|
||||||
|
if cd "${commit_dir}"
|
||||||
|
then
|
||||||
echo
|
echo
|
||||||
echo "Directory $(pwd):"
|
echo "Directory $(pwd):"
|
||||||
repoman -Idix || test_success=false
|
repoman -Idix || test_success=false
|
||||||
|
Loading…
x
Reference in New Issue
Block a user