Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/bin/build-packages
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2020-02-13 20:32:46 +0100
committerErich Eckner <git@eckner.net>2020-02-13 20:32:46 +0100
commit883239ac2f0b8545cb63d899a0725a8b40b78784 (patch)
tree357a7549e1d5f8f8e9c76d268e14fbd5161ae0ad /bin/build-packages
parentbb3c1be9fee3f67b28fa0447345ce80bd0a6deb5 (diff)
revert "remove hard-coded package suffixes" commits where they were unappropriate
Diffstat (limited to 'bin/build-packages')
-rwxr-xr-xbin/build-packages64
1 files changed, 38 insertions, 26 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