build: quiet build and verbose changelog

This commit is contained in:
Ben Grande 2024-06-13 14:03:16 +02:00
parent 7a70535553
commit 3c2bba2a9a
No known key found for this signature in database
GPG Key ID: 00C64E14F51F9E56
4 changed files with 14 additions and 7 deletions

View File

@ -5,15 +5,15 @@
set -eu
missing_program=0
requires_program=""
for pkg in "${@}"; do
if ! command -v "${pkg}" >/dev/null; then
missing_program=1
echo "Missing program: ${pkg}" >&2
requires_program="${requires_program:+"${requires_program} "}${pkg}"
continue
fi
done
if test "${missing_program}" = "1"; then
if test -n "${requires_program}"; then
echo "Missing program(s): ${requires_program}" >&2
exit 1
fi

View File

@ -45,7 +45,7 @@ build_rpm(){
done
## TODO: use qubes-builderv2 with mock or qubes executor
rpmbuild -ba -- "${spec}"
rpmbuild -ba --quiet --clean -- "${spec}"
if test -n "${key_id}"; then
rpm_basename="${build_dir}/RPMS/noarch/${group}-${project}-${version}-"
rpm_suffix=".noarch.rpm"

View File

@ -84,7 +84,7 @@ fi
## project per directory. The disadvantage of the changelog below is it
# #doesn't differentiate commits per version and release, but per commit id.
if test "${key}" = "changelog"; then
changelog="$(TZ=UTC0 git log -n 50 --format=format:"* %cd %an <%ae> - %h%n- %s%n%n" --date=format:"%a %b %d %Y" -- "${project_dir}" | sed -re "s/^- +- */- /;/^$/d")"
changelog="$(TZ=UTC0 git log -n 50 --format=format:"* %cd %an <%ae> - %h%n- %s%n" --date=format:"%a %b %d %Y" -- "${project_dir}" | sed -re "s/^- +- */- /")"
fi
if test "${key}" = "description"; then

View File

@ -21,7 +21,14 @@ yum_repo="${yum_repo_root}/${qubes_release}/${repo}/host/${dist}"
mkdir -p "${yum_repo}/rpm"
find "${build_dir}/RPMS/" -type f -name "*.rpm" \
-exec cp {} "${yum_repo}/rpm/" \;
createrepo_c --checksum sha512 "${yum_repo}"
createrepo_args=""
if test -d "${yum_repo}/repodata"; then
createrepo_args="--update"
fi
# shellcheck disable=SC2086
createrepo_c ${createrepo_args} --checksum sha512 "${yum_repo}"
if test -n "${key_id}"; then
rm -f -- "${yum_repo}/repodata/repomd.xml.asc"
gpg --batch --no-tty --detach-sign --armor --local-user "${key_id}" \