Prevent faked from shitting itself

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2023-02-18 16:25:02 +01:00
parent f113760a6f
commit 3a68b88f50
Signed by: luzifer
GPG key ID: D91C3E91E4CAD6F5

View file

@ -6,15 +6,15 @@ tempdir=$(mktemp -d)
# Ensure tempdir is removed on exit
function cleanup() {
rm -rf ${tempdir}
rm -rf ${tempdir}
}
trap cleanup EXIT
# Check input
PKG=${1:-}
[[ -n ${PKG} ]] || {
echo "No package given as first argument" >&2
exit 1
echo "No package given as first argument" >&2
exit 1
}
# Initialize git directory
@ -37,28 +37,29 @@ git branch -u origin/master
# Check for update script
[ -f update_version.sh ] || {
echo "No update_version.sh found, skipping build."
exit 0
echo "No update_version.sh found, skipping build."
exit 0
}
# Execute update script
docker run --rm -i -u $(id -u) \
-v "$(pwd):$(pwd)" -w "$(pwd)" \
luzifer/aur-update \
bash ./update_version.sh
-v "$(pwd):$(pwd)" -w "$(pwd)" \
luzifer/aur-update \
bash ./update_version.sh
# Check for new commits
(git status --porcelain -b | grep -q '^## .*ahead') || {
echo "No update-commits were made."
exit 0
echo "No update-commits were made."
exit 0
}
# Check whether the build is possible
curl -sSfLo pacman.conf "https://github.com/luzifer-aur/scripts/raw/master/pacman.conf"
docker run --rm -i \
-v "$(pwd):/src" \
-v "$(pwd)/pacman.conf:/etc/pacman.conf:ro" \
luzifer/arch-repo-builder:latest
-v "$(pwd):/src" \
-v "$(pwd)/pacman.conf:/etc/pacman.conf:ro" \
--ulimit nofile=262144:262144 \
luzifer/arch-repo-builder:latest
# Push changes including tags to fork
git push origin master