Use ninja

This commit is contained in:
Tobias Manske 2023-08-21 14:54:26 +02:00
parent d34ea67e9d
commit 4abe3cd155
Signed by: tobias
GPG Key ID: 9164B527694A0709

View File

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
set -eEu [[ ${DEBUG:-} == "true" ]] && set -eEu
set -v [[ ${DEBUG:-} == "true" ]] && set -v
PIPELINE_ID=$RANDOM PIPELINE_ID=$RANDOM
echo ${PIPELINE_ID} echo ${PIPELINE_ID}
@ -11,7 +11,7 @@ sudo pacman-key --init
## Needed so pacman doesnt complain. ## Needed so pacman doesnt complain.
repo-add "/repo/${AUR_REPO_NAME}.db.tar.xz" repo-add "/repo/${AUR_REPO_NAME}.db.tar.xz"
sudo pacman -Syu --noconfirm minio-client pacman-contrib &>/dev/null # Setup tooling sudo pacman -Syu --noconfirm minio-client pacman-contrib ninja &>/dev/null # Setup tooling
mcli alias set s3 https://s3.tobiasmanske.de "${REPO_ACCESS_KEY}" "${REPO_SECRET_KEY}" mcli alias set s3 https://s3.tobiasmanske.de "${REPO_ACCESS_KEY}" "${REPO_SECRET_KEY}"
@ -26,6 +26,8 @@ while [[ "${LOCK}" != "${PIPELINE_ID}" ]]; do
LOCK=$(mcli cat s3/repo/LOCK) LOCK=$(mcli cat s3/repo/LOCK)
if [[ "${LOCK}" == "FREE" ]]; then if [[ "${LOCK}" == "FREE" ]]; then
echo $PIPELINE_ID | mcli pipe s3/repo/LOCK echo $PIPELINE_ID | mcli pipe s3/repo/LOCK
LOCK=$(mcli cat s3/repo/LOCK)
continue
fi fi
echo "Waiting for lock with id $PIPELINE_ID..." echo "Waiting for lock with id $PIPELINE_ID..."
sleep $((RANDOM % 10)) sleep $((RANDOM % 10))
@ -67,6 +69,7 @@ echo "C3FE87CFB8F8D503AE03EC1C033E7F3DC71FE89E:6:" | gpg --import-ownertrust --b
sudo pacman --noconfirm -Syu archlinux-keyring &>/dev/null sudo pacman --noconfirm -Syu archlinux-keyring &>/dev/null
git clone --recursive https://git.tobiasmanske.de/archlinux-repo/package_sources.git packages &>/dev/null git clone --recursive https://git.tobiasmanske.de/archlinux-repo/package_sources.git packages &>/dev/null
cd packages cd packages
touch buildqueue touch buildqueue
@ -113,10 +116,6 @@ done <buildqueue | tee buildfile | aur graph | tee graph | tsort | tac >queue
grep validpgpkeys buildfile | cut -d "=" -f2 | tr -d " " | xargs -n1 gpg --recv-keys grep validpgpkeys buildfile | cut -d "=" -f2 | tr -d " " | xargs -n1 gpg --recv-keys
cat graph cat graph
echo
echo QUEUE
echo
cat queue
if [[ ${DEBUG:-} == "true" ]]; then if [[ ${DEBUG:-} == "true" ]]; then
echo "Debug mode, not building anything." echo "Debug mode, not building anything."
@ -130,7 +129,11 @@ fi
## BUILD ## BUILD
aur build -S --noconfirm -a queue --no-sync --margs -s # aur build -S --noconfirm -a queue --no-sync --margs -s
export AUR_SYNC_USE_NINJA=1
cat graph | aur sync--ninja --keep-going=0 -S -- makepkg -sir | ninja -f /dev/stdin
echo "##################################"
ls -la /repo
## Upload to repo ## Upload to repo
mcli mirror --overwrite /repo s3/repo/x86_64 mcli mirror --overwrite /repo s3/repo/x86_64