builder/makepkg-podman
fbt 0570c6bf8f will have to do cleanup externally
Signed-off-by: fbt <fbt@fleshless.org>
2021-03-01 08:42:34 +03:00

29 lines
578 B
Bash
Executable File

#!/usr/bin/env bash
shopt -s nullglob
did="pkg-build-$$.$SRANDOM"
mkdir "/tmp/$did"
pkg_dest=$1
pkg_url=$2
podman run --rm -v "/tmp/$did:/buildroot" "autobuilder:latest" /build "$pkg_url"
artifacts=( "/tmp/$did/"*.pkg.* )
for i in "${artifacts[@]}"; do
i_name="${i##*/}"
printf 'Found artifact: %s\n' "$i_name"
if [[ -f "$pkg_dest/$i_name" ]]; then
printf '%s/%s already exists, not overwriting.\n' "$pkg_dest" "$i_name"
else
printf 'Copying %s to %s.\n' "$i_name" "$pkg_dest"
cp -vn "$i" "$pkg_dest"
fi
done
# cleanup
#podman rmi "$did"
#rm -rf "/tmp/$did"