summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2024-06-21 22:16:53 +0200
committerErich Eckner <git@eckner.net>2024-06-21 22:16:53 +0200
commitd45dec337744ebeb21a08214533e99695af4302b (patch)
tree5313e668b739da565f3c17199d57e1f32218e430
parentfaa7120c60d9a9d2b0a5f0e0f295bac57afca313 (diff)
downloadarchlinuxewe-d45dec337744ebeb21a08214533e99695af4302b.tar.xz
new commands to build with docker
-rwxr-xr-xbuild-all-with-docker10
-rwxr-xr-xsign-and-upload-all110
2 files changed, 120 insertions, 0 deletions
diff --git a/build-all-with-docker b/build-all-with-docker
new file mode 100755
index 000000000..14d9410ab
--- /dev/null
+++ b/build-all-with-docker
@@ -0,0 +1,10 @@
+#!/bin/bash
+
+cd "$(dirname "$(readlink -e "$0")")"
+
+for pkg in */PKGBUILD; do
+ cd "${pkg%/PKGBUILD}"
+ docker run -d -v .:/build arch-build:latest
+ docker run -d -v .:/build artix-build:latest
+ cd ..
+done
diff --git a/sign-and-upload-all b/sign-and-upload-all
new file mode 100755
index 000000000..255ce0620
--- /dev/null
+++ b/sign-and-upload-all
@@ -0,0 +1,110 @@
+#!/bin/bash
+
+cd "$(dirname "$(readlink -e "$0")")"
+
+
+for distro in arch artix; do
+ upkgs=$(
+ ssh ${distro}linuxewe@eckner.net '
+ bsdtar -Oxf os/'"$(pacman-conf Architecture)"'/'"${distro}"'linuxewe.db.tar.gz \
+ | sed -n '"'"'
+ /^%FILENAME%$/ {
+ N
+ s/^.*\n//
+ p
+ }
+ '"'"'
+ '
+ )
+ unset archs
+ declare -A archs
+ for pkg in */${distro}/*.pkg.tar.zst; do
+ [ -f "${pkg}" ] \
+ || continue
+ printf '%s\n' "${pkg##*/}" \
+ | grep -qxF "${upkgs}" \
+ && continue
+ [ -f "${pkg}.sig" ] \
+ || gpg --detach-sign -u 5FDCA472AB93292BC678FD59255A76DB9A12601A "${pkg}" \
+ || exit 1
+ arch="${pkg##*-}"
+ arch="${arch%%.*}"
+ archs["${arch}"]=1
+ done
+
+ for arch in "${!archs[@]}"; do
+ rsync -av --progress --ignore-existing */${distro}/*-${arch}.pkg.tar.zst{,.sig} ${distro}linuxewe@eckner.net:os/${arch}/
+ pkgs=$(
+ printf '%s\n' */${distro}/*-${arch}.pkg.tar.zst \
+ | sed 's@^.*/@@' \
+ | tr '\n' ' '
+ )
+
+ if [ "${arch}" = 'any' ]; then
+ ssh ${distro}linuxewe@eckner.net '
+ cd os
+ for arch in */; do
+ cd ${arch}
+ for pkg in '"${pkgs}"'; do
+ ln -s ../any/${pkg}
+ ln -s ../any/${pkg}.sig
+ done
+ repo-add -s -k 0x3CFB0AD8F60030F8 '"${distro}"'linuxewe.db.tar.gz '"${pkgs}"'
+ find -maxdepth 1 -mindepth 1 -not -type d -printf '"'"'%f\n'"'"' \
+ | grep -vxFf <(
+ ls '"${distro}"'linuxewe.db*
+ bsdtar -Oxf '"${distro}"'linuxewe.db.tar.gz \
+ | sed -n '"'"'
+ /^%FILENAME%$/ {
+ N
+ s/^.*\n//
+ p
+ s/$/.sig/
+ p
+ }
+ '"'"'
+ ) \
+ | xargs -r rm -f
+ cd ..
+ done
+ cd any
+ find -maxdepth 1 -mindepth 1 -not -type d -printf '"'"'%f\n'"'"' \
+ | grep -vxFf <(
+ for db in ../*/'"${distro}"'linuxewe.db.tar.gz; do
+ bsdtar -Oxf "${db}"
+ done \
+ | sed -n '"'"'
+ /^%FILENAME%$/ {
+ N
+ s/^.*\n//
+ p
+ s/$/.sig/
+ p
+ }
+ '"'"'
+ ) \
+ | xargs -r rm -f
+ '
+ else
+ ssh ${distro}linuxewe@eckner.net '
+ cd os/'"${arch}"'
+ repo-add -s -k 0x3CFB0AD8F60030F8 '"${distro}"'linuxewe.db.tar.gz '"${pkgs}"'
+ find -maxdepth 1 -mindepth 1 -not -type d -printf '"'"'%f\n'"'"' \
+ | grep -vxFf <(
+ ls '"${distro}"'linuxewe.db*
+ bsdtar -Oxf '"${distro}"'linuxewe.db.tar.gz \
+ | sed -n '"'"'
+ /^%FILENAME%$/ {
+ N
+ s/^.*\n//
+ p
+ s/$/.sig/
+ p
+ }
+ '"'"'
+ ) \
+ | xargs -r rm -f
+ '
+ fi
+ done
+done