2023-11-23 11:55:55 -07:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
# Rebuilds a Manifest file for the provided ebuild.
|
|
|
|
|
|
|
|
ebuild_path="$1"
|
|
|
|
|
|
|
|
if [[ -z "$ebuild_path" ]]; then
|
|
|
|
echo "Error: Missing ebuild path" >&1
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ ! -d "$ebuild_path" ]]; then
|
|
|
|
echo "Error: Invalid ebuild path (must be directory)" >&1
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2025-03-09 16:58:05 -07:00
|
|
|
imageName="git.rgst.io/jaredallard/overlay:updater"
|
2023-11-23 11:58:07 -07:00
|
|
|
|
|
|
|
# Build the image if it doesn't already exist in the cache.
|
2024-02-18 17:52:09 -08:00
|
|
|
if ! docker image inspect "$imageName" >/dev/null; then
|
2023-11-23 11:58:07 -07:00
|
|
|
docker buildx build --load -t "$imageName" .
|
|
|
|
fi
|
|
|
|
|
2024-02-21 21:58:52 -08:00
|
|
|
exec docker run --rm -it -v "$(pwd):/host_mnt" --entrypoint bash "$imageName" -ce 'cd "/host_mnt/$1" && for ebuild in *.ebuild; do ebuild "$ebuild" manifest; done' -- "$ebuild_path"
|