fix: skip projects with untracked states

This commit is contained in:
Ben Grande 2024-10-14 16:18:40 +02:00
parent 648bccd2d3
commit d5b4190d3e
No known key found for this signature in database
GPG Key ID: 00C64E14F51F9E56
2 changed files with 8 additions and 5 deletions

View File

@ -21,7 +21,6 @@ host:
- rpm_spec/qusal-fedora-minimal.spec
- rpm_spec/qusal-fedora-xfce.spec
- rpm_spec/qusal-fetcher.spec
- rpm_spec/qusal-grafana.spec
- rpm_spec/qusal-kicksecure-minimal.spec
- rpm_spec/qusal-mail.spec
- rpm_spec/qusal-media.spec

View File

@ -25,7 +25,8 @@ fi
ignored="$(git ls-files --exclude-standard --others --ignored salt/)"
untracked="$(git ls-files --exclude-standard --others salt/)"
unwanted="$(printf '%s\n%s\n' "${ignored}" "${untracked}" |
grep -e "^salt/\S\+/README.md" | cut -d "/" -f2 | sort -u)"
grep -E "^salt/\S+/(README.md|.*\.sls|files/.*)$" | cut -d "/" -f2 |
sort -u)"
group="$(./scripts/spec-get.sh dom0 group)"
projects="$(find salt/ -mindepth 1 -maxdepth 1 -type d | sort -d |
sed -e "s|^salt/\(\S\+\)| - rpm_spec/${group}-\1.spec|")"
@ -42,11 +43,14 @@ fi
sed -e "/@SPEC@/d" -- "${template}" | tee -- "${target}" >/dev/null
printf '%s\n' "${projects}" | tee -a -- "${target}" >/dev/null
if test "${1-}" = "test"; then
if ! cmp -s -- "${target}" "${intended_target}"; then
if diff --help | grep " --color\[" >/dev/null 2>&1; then
diff_args="--color=auto"
fi
# shellcheck disable=SC2086
if ! diff ${diff_args} -- "${intended_target}" "${target}"; then
echo "${0##*/}: $ diff ${diff_args} -- '${intended_target}' '${target}'"
err_msg="${0##*/}: error: File ${intended_target} is not up to date"
printf '%s\n' "${err_msg}" >&2
err_msg="${0##*/}: error: Update the builder file with: ${0##/*}"
printf '%s\n' "${err_msg}" >&2
exit 1
fi
fi