mirror of
https://github.com/luzifer-aur/scripts.git
synced 2024-12-20 11:51:20 +00:00
Prevent faked from shitting itself
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
f113760a6f
commit
3a68b88f50
1 changed files with 14 additions and 13 deletions
27
update.sh
27
update.sh
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue