summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbin/build-packages64
-rwxr-xr-xbin/clean-cache31
-rwxr-xr-xbin/local-build-package29
3 files changed, 62 insertions, 62 deletions
diff --git a/bin/build-packages b/bin/build-packages
index f090fa6..3689fa7 100755
--- a/bin/build-packages
+++ b/bin/build-packages
@@ -27,6 +27,8 @@
# TODO: releave some locking conditions - meta goal: be able to run multiple
# build slaves on one host from within one archlinux32/builder repository
+# TODO: remove hard-coded package suffixes
+
# TODO: save build-logs in case of success, too - only the build is
# guaranteed to have been successful, maybe the package is broken.
@@ -486,8 +488,12 @@ while [ "${count}" -ne 0 ] && \
build_command='staging-'"${arch}"'-build'
fi
- find . -maxdepth 1 -type f \
- -regex '.*\.pkg\.\('"${package_compression_suffix_regex}"'\)\(\.sig\)\?' \
+ find . -maxdepth 1 -type f \( \
+ -name '*.pkg.tar.xz' \
+ -o -name '*.pkg.tar.xz.sig' \
+ -o -name '*.pkg.tar.zst' \
+ -o -name '*.pkg.tar.zst.sig' \
+ \) \
-exec rm {} \;
echo 'checking-source' > "${tmp_dir}/.ping-build-master"
@@ -656,7 +662,7 @@ while [ "${count}" -ne 0 ] && \
# build successful
>&2 printf ' ok.\n'
if [ "${build_command}" = 'makepkg' ]; then
- find . -maxdepth 1 -type f -regex '.*\.pkg\.\('"${package_compression_suffix_regex}"'\)' \
+ find . -maxdepth 1 -type f -name '*.pkg.tar.zst' \
-exec sh -c 'namcap "$1" > "$1-namcap.log"' '_' '{}' \;
fi
tar_content_dir=$(mktemp -d "${tmp_dir}/tar-content.XXXXXX")
@@ -664,9 +670,7 @@ while [ "${count}" -ne 0 ] && \
# remove unexpected packages
if [ -n "${expected_packages}" ]; then
{
- find . -maxdepth 1 -type f \
- -regex '.*\.pkg\.\('"${package_compression_suffix_regex}"'\)' \
- -printf '%f\n'
+ find . -maxdepth 1 -type f -name '*.pkg.tar.zst' -printf '%f\n'
printf '%s\n' "${expected_packages}" | \
sed 'p'
} | \
@@ -679,8 +683,7 @@ while [ "${count}" -ne 0 ] && \
done
fi
>&2 printf 'signing package(s)\n'
- find . -maxdepth 1 -type f \
- -regex '.*\.pkg\.\('"${package_compression_suffix_regex}"'\)' \
+ find . -maxdepth 1 -type f -name '*.pkg.tar.zst' \
-execdir gpg --local-user="${package_key}" --detach-sign '{}' \; \
-execdir mv '{}' '{}.sig' '{}-namcap.log' "${tar_content_dir}/" \; \
-printf '%f\n' | \
@@ -689,7 +692,7 @@ while [ "${count}" -ne 0 ] && \
{
pacman -Spdd --print-format '%l' --noconfirm "${pkg_file%-*-*-*}" 2>/dev/null | \
sed '
- s@/[^/]\+\.pkg\.\('"${package_compression_suffix_regex}"'\)$@@
+ s|/[^/]\+\.pkg\.tar\.zst$||
'
# shellcheck disable=SC2016
curl -Ss 'https://www.archlinux.org/mirrorlist/?country=all&protocol=https&tier=1&use_mirror_status=on' | \
@@ -704,9 +707,9 @@ while [ "${count}" -ne 0 ] && \
sed '
s|$|/'"${pkg_file}"'|
s/\.[0-9]\+\(-[^-]\+\)$/\1/
- s/-'"${arch}"'\+\(\.pkg\.\('"${package_compression_suffix_regex}"'\)\)$/-x86_64\1/
+ s/-'"${arch}"'\+\(\.pkg\.tar\.zst\)$/-x86_64\1/
p
- s/\.pkg\.\('"${package_compression_suffix_regex}"'\)$/.pkg.xz/
+ s/\.zst$/.xz/
' | \
shuf -n 100 | \
while read -r url; do
@@ -720,7 +723,7 @@ while [ "${count}" -ne 0 ] && \
done
>&2 printf 'searching for provided libraries\n'
find "${tar_content_dir}" -maxdepth 1 \
- -regex '.*\.pkg\.\('"${package_compression_suffix_regex}"'\)' \
+ -name '*.pkg.tar.zst' \
-printf '%p\n' | \
while read -r pkgfile; do
pacman -Qqlp "${pkgfile}" | \
@@ -739,10 +742,10 @@ while [ "${count}" -ne 0 ] && \
>&2 printf 'searching for required and more provided libraries\n'
package_content_dir=$(mktemp -d "${tmp_dir}/package-content.XXXXXX")
find "${tar_content_dir}" -maxdepth 1 \
- -regex '.*\.pkg\.\('"${package_compression_suffix_regex}"'\)' | \
+ -name '*.pkg.tar.zst' | \
while read -r pkgfile; do
if printf '%s\n' "${pkgfile}" | \
- grep -vq -- '-any\.pkg\.\('"${package_compression_suffix_regex}"'\)$'; then
+ grep -vq -- '-any\.pkg\.tar\.zst$'; then
# we do not check "any" packages for linked libraries
# (why do they have them in the first place?)
mkdir "${package_content_dir}/${pkgfile##*/}"
@@ -892,18 +895,14 @@ while [ "${count}" -ne 0 ] && \
>&2 printf ' ok.\n'
>&2 printf 'smoothen namcap log ...'
# now we generate diffs from the namcap.logs
- find . "${tar_content_dir}/" -maxdepth 1 -type f \
- -regex '.*\.pkg\.\('"${package_compression_suffix_regex}"'\)-namcap\.log' \
- -printf '%p\n' | \
+ find . "${tar_content_dir}/" -maxdepth 1 -type f -name '*.pkg.tar.zst-namcap.log' -printf '%p\n' | \
while read -r log; do
smoothen_namcap_log "${log}"
done
- find "${tar_content_dir}/" -maxdepth 1 -type f \
- -regex '.*\.pkg\.\('"${package_compression_suffix_regex}"'\)-namcap\.log' \
- -printf '%f\n' | \
+ find "${tar_content_dir}/" -maxdepth 1 -type f -name '*.pkg.tar.zst-namcap.log' -printf '%f\n' | \
sed '
- s|\(^.*\)-'"${arch}"'\(\.pkg\.\('"${package_compression_suffix_regex}"'\)-namcap\.log\)$|\0 \1-x86_64\2|
- s|^.*-any\.pkg\.\('"${package_compression_suffix_regex}"'\)-namcap\.log$|\0 \0|
+ s|\(^.*\)-'"${arch}"'\(\.pkg\.tar\.zst-namcap\.log\)$|\0 \1-x86_64\2|
+ s|^.*-any\.pkg\.tar\.zst-namcap\.log$|\0 \0|
' | \
while read -r log x86_64_log; do
if [ -f "${x86_64_log}" ]; then
@@ -921,17 +920,27 @@ while [ "${count}" -ne 0 ] && \
echo 'uploading' > "${tmp_dir}/.ping-build-master"
if ${upload_to_build_master}; then
find "${tar_content_dir}/" -maxdepth 1 \
- -regex '.*\.pkg\.\('"${package_compression_suffix_regex}"'\)\(-namcap\.log\|\.so\.needs\|\.so\.provides\)' \
+ \( \
+ -name '*.pkg.tar.zst-namcap.log' -o \
+ -name '*.pkg.tar.zst.so.needs' -o \
+ -name '*.pkg.tar.zst.so.provides' \
+ \) \
-execdir gzip '{}' \;
else
find "${tar_content_dir}/" -maxdepth 1 \
- -regex '.*\.pkg\.\('"${package_compression_suffix_regex}"'\)-namcap\.log' \
+ -name '*.pkg.tar.zst-namcap.log' \
-execdir grep -HF '' '{}' \;
fi
# shellcheck disable=SC2046
tar -cf 'package.tar' -C "${tar_content_dir}" -- $(
find "${tar_content_dir}/" -maxdepth 1 \
- -regex '.*\.pkg\.\('"${package_compression_suffix_regex}"'\)\(\|\.sig\|-namcap\.log\.gz\|\.so\.needs\.gz\|\.so\.provides\.gz\)' \
+ \( \
+ -name '*.pkg.tar.zst' -o \
+ -name '*.pkg.tar.zst.sig' -o \
+ -name '*.pkg.tar.zst-namcap.log.gz' -o \
+ -name '*.pkg.tar.zst.so.needs.gz' -o \
+ -name '*.pkg.tar.zst.so.provides.gz' \
+ \) \
-printf '%f\n'
) || \
{
@@ -942,7 +951,10 @@ while [ "${count}" -ne 0 ] && \
# shellcheck disable=SC2046
rsync $(
find "${tar_content_dir}/" -maxdepth 1 \
- -regex '.*\.pkg\.\('"${package_compression_suffix_regex}"'\)\(\.sig\)\?' \
+ \( \
+ -name '*.pkg.tar.zst' -o \
+ -name '*.pkg.tar.zst.sig' \
+ \) \
-printf '%p\n'
) "rsync://mirror.archlinux32.org/transfer32/" || true
fi
diff --git a/bin/clean-cache b/bin/clean-cache
index eda926f..8e6fb3c 100755
--- a/bin/clean-cache
+++ b/bin/clean-cache
@@ -5,6 +5,8 @@
# shellcheck source=../lib/load-configuration
. "${0%/*}/../lib/load-configuration"
+# TODO: remove hard-coded package suffixes
+
if [ $# -eq 0 ]; then
dummynator='sudo'
elif [ $# -eq 1 ] && [ "x$1" = 'x-n' ]; then
@@ -51,24 +53,17 @@ find "${tmp_dir}" -type f -name desc \
' | \
sort -k2,2 | \
uniq -uf1 | \
- sed -n '
- h
- '"$(
- # shellcheck disable=SC2016
- {
- printf 'SELECT'
- printf ' CONCAT('
- printf '"g;s@$@-",'
- printf '`architectures`.`name`,'
- printf '".pkg.",'
- printf '`compressions`.`suffix`,'
- printf '"@;p"'
- printf ')'
- printf ' FROM `compressions`'
- printf ' JOIN `architectures`;\n'
- } \
- | mysql_run_query
- )" \
+ while read -r s; do
+ printf '%s%s\n' \
+ "${s}" '-i486.pkg.tar.xz' \
+ "${s}" '-i686.pkg.tar.xz' \
+ "${s}" '-pentium4.pkg.tar.xz' \
+ "${s}" '-any.pkg.tar.xz' \
+ "${s}" '-i486.pkg.tar.zst' \
+ "${s}" '-i686.pkg.tar.zst' \
+ "${s}" '-pentium4.pkg.tar.zst' \
+ "${s}" '-any.pkg.tar.zst'
+ done | \
sha256sum -c --ignore-missing --quiet 2> /dev/null | \
sed -n '
s|: FAILED$||
diff --git a/bin/local-build-package b/bin/local-build-package
index a04cc0d..fd4fdab 100755
--- a/bin/local-build-package
+++ b/bin/local-build-package
@@ -7,6 +7,8 @@
# shellcheck source=../lib/load-configuration
. "${0%/*}/../lib/load-configuration"
+# TODO: remove hard-coded package suffixes
+
# shellcheck disable=SC2016
usage() {
>&2 echo ''
@@ -171,9 +173,9 @@ if ! ${nobuild}; then
extract_source_directory "${git_repo}" "${git_revision}" "${mod_git_revision}" "${tmp_dir}"
- find . -maxdepth 1 -type f \
- -regex '.*\.pkg\.\('"${package_compression_suffix_regex}"'\)\(\.sig\)\?' \
- -delete
+ rm -f \
+ ./*"-${arch}.pkg.tar.xz" ./*"-${arch}.pkg.tar.xz.sig" \
+ ./*"-${arch}.pkg.tar.zst" ./*"-${arch}.pkg.tar.zst.sig"
cd "${tmp_dir}" || exit 1
@@ -190,12 +192,11 @@ else
fi
if ${bootstrap}; then
- find . -maxdepth 1 -type f \
- -regex '.*\.pkg\.\('"${package_compression_suffix_regex}"'\)\.sig' \
- -delete
+ rm -f \
+ ./*"-${arch}.pkg.tar.xz.sig" \
+ ./*"-${arch}.pkg.tar.zst.sig"
- find . -maxdepth 1 -type f \
- -regex '.*\.pkg\.\('"${package_compression_suffix_regex}"'\)' \
+ find . -maxdepth 1 -type f -name "*${arch}.pkg.tar.zst" \
-execdir gpg --local-user="${signkey}" --detach-sign '{}' \;
case "$repository" in
@@ -210,16 +211,8 @@ if ${bootstrap}; then
;;
esac
- # shellcheck disable=SC2046
- scp -P "${bootstrap_port}" -rC $(
- find "${tmp_dir}" -type f \
- -regex '.*\.pkg\.\('"${package_compression_suffix_regex}"'\)\(\.sig\)\?'
- ) "${bootstrap_host}:${bootstrap_dir}/${staging_repo}/."
- ssh -p "${bootstrap_port}" "${bootstrap_host}" bash -l -c "'cd ${bootstrap_dir}/${staging_repo} && repo-add -n bootstrap-${staging_repo}.db.tar.gz $(
- find "${tmp_dir}" -type f \
- -regex '.*\.pkg\.\('"${package_compression_suffix_regex}"'\)' \
- -printf '%f '
- )'"
+ scp -P "${bootstrap_port}" -rC "${tmp_dir}/"*"-${arch}.pkg.tar.zst" "${tmp_dir}/"*"-${arch}.pkg.tar.zst.sig" "${bootstrap_host}:${bootstrap_dir}/${staging_repo}/."
+ ssh -p "${bootstrap_port}" "${bootstrap_host}" bash -l -c "'cd ${bootstrap_dir}/${staging_repo} && repo-add -n bootstrap-${staging_repo}.db.tar.gz *-${arch}.pkg.tar.zst'"
fi
# do not delete build reports, why might actually to want to have a look for things