summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbin/build-packages43
-rwxr-xr-xbin/db-update61
-rwxr-xr-xbin/ii-answer8
-rwxr-xr-xbin/return-assignment13
-rwxr-xr-xbin/update-gpg-keys49
5 files changed, 142 insertions, 32 deletions
diff --git a/bin/build-packages b/bin/build-packages
index 46c1ef1..eebf8c8 100755
--- a/bin/build-packages
+++ b/bin/build-packages
@@ -650,14 +650,15 @@ while [ "${count}" -ne 0 ] && \
t
s/^See ['"'"'`]\([^'"'"'`]\+\)['"'"'`]\(\s.*\)\?$/\1/
t
+ s/^A full log can be found at\s\+\(\S\+\)\s*$/\1/
+ t
d
' "${log_file}" | \
while read -r extra_log_file; do
- grep -HF '' "${build_dir}/${extra_log_file}" || true
- if [ -n "${extra_log_file##*/*}" ]; then
+ if ! grep -HF '' "${build_dir}/${extra_log_file}"; then
find "${build_dir}" \
- -xdev -mindepth 2 \
- -type f -name "${extra_log_file}" \
+ -xdev \
+ -type f -name "${extra_log_file##*/}" \
-exec grep -HF '' {} + \
|| true
fi
@@ -677,8 +678,20 @@ while [ "${count}" -ne 0 ] && \
# machine, if need arises in the future). Note, that it is no
# error, if the above build command already produced a
# compressed package.
- find . -maxdepth 1 -type f -name '*.pkg.tar' \
- -execdir zstd --rm -T0 --ultra -20 '{}' -o '{}.zst' \;
+ # Since --ultra -20 seems too much for our i486 build vms, we
+ # silently fall back to lower compression levels if the higher
+ # level fails.
+
+ # beware: We must remove *.pkg.tar.zst after failed
+ # compression attempts, otherwise future compression attempts
+ # will refuse to overwrite them.
+
+ # shellcheck disable=SC2086
+ for options in '-T0 --ultra -20' '--ultra -20' {-19..-3}; do
+ find . -maxdepth 1 -type f -name '*.pkg.tar' \
+ -not -execdir zstd --rm ${options} '{}' -o '{}.zst' \; \
+ -exec rm -f '{}.zst' \;
+ done
# package files, that still exist, threw an error upon compression
errors=$(
find . -maxdepth 1 -type f -name '*.pkg.tar'
@@ -697,15 +710,15 @@ while [ "${count}" -ne 0 ] && \
# compressing successful
echo 'post-build' > "${tmp_dir}/.ping-build-master"
>&2 printf ' ok.\n'
- if [ "${build_command}" = 'makepkg' ]; then
- find . -maxdepth 1 -type f -name '*.pkg.tar.zst' \
- -exec sh -c 'namcap "$1" > "$1-namcap.log"' '_' '{}' \;
- else
- find . -maxdepth 1 -type f -name '*.pkg.tar-namcap.log' \
- | while read -r file; do
- mv "${file}" "${file%-namcap.log}.zst-namcap.log"
- done
- fi
+ find . -maxdepth 1 -type f -name '*.pkg.tar.zst' \
+ -exec sh -c '
+ pkg="${1%.pkg.tar.zst}"
+ if [ -f "${pkg}.pkg.tar-namcap.log" ]; then
+ mv "${pkg}.pkg.tar-namcap.log" "${pkg}.pkg.tar.zst-namcap.log"
+ elif [ ! -f "${pkg}.pkg.tar.zst-namcap.log" ]; then
+ namcap "$1" > "${pkg}.pkg.tar.zst-namcap.log"
+ fi
+ ' '_' '{}' \;
tar_content_dir=$(mktemp -d "${tmp_dir}/tar-content.XXXXXX")
# remove unexpected packages
if [ -n "${expected_packages}" ]; then
diff --git a/bin/db-update b/bin/db-update
index 7c5a8cf..9fbc544 100755
--- a/bin/db-update
+++ b/bin/db-update
@@ -27,6 +27,9 @@ usage() {
>&2 echo ' move possible packages from staging to testing.'
>&2 echo ''
>&2 echo 'possible options:'
+ >&2 echo ' -e|--everything $arch/$repo:'
+ >&2 echo ' Force movement of every package in the given repo and'
+ >&2 echo ' move nothing else.'
>&2 echo ' -f|--force $arch/$repo/$pkgname:'
>&2 echo ' Force movement of given package and move nothing else.'
>&2 echo ' -h|--help:'
@@ -56,8 +59,9 @@ usage() {
}
eval set -- "$(
- getopt -o f:hino:pw \
- --long force \
+ getopt -o e:f:hino:pw \
+ --long everything: \
+ --long force: \
--long help \
--long ignore-insanity \
--long no-action \
@@ -73,6 +77,7 @@ ignore_insanity=false
no_action_flag=''
progressive=false
force_pkgs=''
+force_every_pkgs=''
only=''
while true
@@ -86,6 +91,14 @@ do
printf '\n%s' "${force_pkgs}"
)
;;
+ -e|--everything)
+ shift
+ force_every_pkgs=$(
+ printf '%s' "$1" | \
+ base64 -w0
+ printf '\n%s' "${force_every_pkgs}"
+ )
+ ;;
-h|--help)
usage 0
;;
@@ -135,6 +148,18 @@ if ${progressive} && \
usage
fi
+if ${progressive} && \
+ [ -n "${force_every_pkgs}" ]; then
+ >&2 echo 'db-update: conflicting arguments'
+ usage
+fi
+
+if [ -n "${force_pkgs}" ] && \
+ [ -n "${force_every_pkgs}" ]; then
+ >&2 echo 'db-update: conflicting arguments'
+ usage
+fi
+
if [ -s "${work_dir}/build-master-sanity" ]; then
>&2 echo 'Build master is not sane.'
if ! ${ignore_insanity}; then
@@ -295,7 +320,8 @@ mysql_query_update_replaced_bpir() {
# are for the same architecture if we joined them via
# repository_moves, because only repositories with the same
# architectures should be listed there.
- if [ -n "${force_pkgs}" ]; then
+ if [ -n "${force_pkgs}" ] || \
+ [ -n "${force_every_pkgs}" ]; then
printf 'DROP TEMPORARY TABLE IF EXISTS `%s_bpir`;\n' \
'moveable' 'replaced'
printf 'CREATE TEMPORARY TABLE `replaced_bpir` (`id` BIGINT, `replaced_by` BIGINT, UNIQUE KEY (`id`));\n'
@@ -312,15 +338,26 @@ mysql_query_update_replaced_bpir() {
printf ' ON `binary_packages`.`build_assignment`=`f_bp`.`build_assignment`'
mysql_join_binary_packages_binary_packages_in_repositories 'f_bp' 'f_bpir'
printf ' AND `f_bpir`.`repository`=`repositories`.`id`'
- printf ' WHERE CONCAT('
- printf '`architectures`.`name`,"/",'
- printf '`repositories`.`name`,"/",'
- printf '`f_bp`.`pkgname`'
- printf ') IN ('
- # shellcheck disable=SC2086
- printf 'from_base64("%s"),' \
- ${force_pkgs} | \
- sed 's/,$/);\n/'
+ if [ -n "${force_pkgs}" ]; then
+ printf ' WHERE CONCAT('
+ printf '`architectures`.`name`,"/",'
+ printf '`repositories`.`name`,"/",'
+ printf '`f_bp`.`pkgname`'
+ printf ') IN ('
+ # shellcheck disable=SC2086
+ printf 'from_base64("%s"),' \
+ ${force_pkgs} | \
+ sed 's/,$/);\n/'
+ else
+ printf ' WHERE CONCAT('
+ printf '`architectures`.`name`,"/",'
+ printf '`repositories`.`name`'
+ printf ') IN ('
+ # shellcheck disable=SC2086
+ printf 'from_base64("%s"),' \
+ ${force_every_pkgs} | \
+ sed 's/,$/);\n/'
+ fi
printf 'DELETE `moveable_bpir`'
printf ' FROM `moveable_bpir`'
printf ' JOIN `binary_packages_in_repositories`'
diff --git a/bin/ii-answer b/bin/ii-answer
index ed333cb..b0f8f11 100755
--- a/bin/ii-answer
+++ b/bin/ii-answer
@@ -42,10 +42,10 @@ find "${irc_dir}" \
sloppy_salutation=''
fi
# answer "why don't you?"
- regex='^\S\+ <\(\S\+\)> '"${prefix}"'!\?why[- ]don'"'"'\?t[- ]you \(build\|stabilize\|unstage\|keep\|stubbornly_keep\) '
+ regex='^\S\+ <\(\S\+\)> '"${prefix}"'!\?why[- ]don'"'"'\?t[- ]you \(build\|stabilize\|unstage\|keep\|stubbornly_keep\) \([^?]*\)?\?$'
if grep -q "${regex}" "${out_file}"; then
sed -i '
- s/'"${regex}"'/\1 \2 /
+ s/'"${regex}"'/\1 \2 \3/
T
w /dev/stdout
d
@@ -201,11 +201,11 @@ find "${irc_dir}" \
fi
if [ -z "${channel%%#*}" ]; then
# answer "Shut up!"
- regex='^\S\+ <\S\+> \(.* \)\?[Ss][Hh][Uu][Tt] \?[Uu][Pp]'
+ regex='^\S\+ <\S\+> \(.* \)\?([Ss][Hh][Uu][Tt] \?[Uu][Pp]\|pss\+t\|[Bb]e \(.* \)\?quiet'
if grep "${regex}" "${out_file}" | \
grep -q "${sloppy_salutation}"; then
sed -i "/${regex}/d" "${out_file}"
- printf 'Sorry, I will do.\n' | \
+ printf 'Sorry, I will be quiet.\n' | \
irc_say "${channel}" 'copy'
printf '%s\n' "$((
$(date '+%s') + 3600
diff --git a/bin/return-assignment b/bin/return-assignment
index 6b64bf4..d1558af 100755
--- a/bin/return-assignment
+++ b/bin/return-assignment
@@ -314,7 +314,10 @@ if [ "$6" = 'ERROR' ]; then
' | \
tr ' ' '\n' | \
sed '
- 1,2 d
+ /^Packages$/ {
+ N
+ d
+ }
/^\s*$/d
p
s/^haskell-//
@@ -373,6 +376,14 @@ if [ "$6" = 'ERROR' ]; then
tr ' ' '\t' > \
"${tmp_dir}/broken-packages-with-version"
+# TODO: We might want to prioritize broken dependencies, which are already
+# on the build-list.
+
+# TODO: We might also want to prioritize the returned package if there
+# were broken dependencies identified, but none of these is still on the
+# build list (e.g. some race condition between this build and its
+# dependencies occured).
+
# now we look if the broken packages have been rebuilt in the meantime
haskell_rebuild_packages=$(
# shellcheck disable=SC2016
diff --git a/bin/update-gpg-keys b/bin/update-gpg-keys
new file mode 100755
index 0000000..fe6dfe3
--- /dev/null
+++ b/bin/update-gpg-keys
@@ -0,0 +1,49 @@
+#!/bin/sh
+
+# shellcheck source=../lib/load-configuration
+. "${0%/*}/../lib/load-configuration"
+
+if [ $# -ne 0 ]; then
+ >&2 echo 'error: No arguments expected, but some were given.'
+ exit 1
+fi
+
+# shellcheck disable=SC2016
+{
+ printf 'SELECT'
+ printf ' `gpg_keys`.`fingerprint`,'
+ printf 'replace(to_base64(`gpg_keys`.`public_key`),"\\n","")'
+ printf ' FROM `gpg_keys`'
+} \
+| mysql_run_query \
+| while read -r fingerprint public_key; do
+ printf '%s\n' "${public_key}" \
+ | base64 -d \
+ | gpg --import \
+ >/dev/null 2>&1
+ gpg --quiet --locate-keys "${fingerprint}" \
+ >/dev/null 2>&1 \
+ || true
+ curl -Ss 'https://archlinux32.org/keys.php?k='"${fingerprint}" \
+ | gpg --import --quiet \
+ >/dev/null 2>&1 \
+ || true
+ printf 'UPDATE `gpg_keys`'
+ printf ' SET `gpg_keys`.`public_key`=from_base64("%s")' \
+ "$(
+ gpg -a --export "${fingerprint}" \
+ | base64 -w0
+ )"
+ printf ' WHERE `gpg_keys`.`fingerprint`="%s";\n' \
+ "${fingerprint}"
+done \
+| mysql_run_query
+
+# shellcheck disable=SC2016
+{
+ printf 'SELECT `gpg_keys`.`fingerprint`'
+ printf ' FROM `gpg_keys`;\n'
+} \
+| mysql_run_query \
+| xargs -r gpg -a --export \
+| curl -T - 'https://archlinux32.org/keys.php'