#!/bin/bash
set -euo pipefail

# This script is called very early in the buildah path from build-rootfs
# after inject_yumrepos() to modify the build environment. Example use cases
# are to fast-track fixes or work around bugs.
# Note that any dowloaded packages here needs to be included in lockfiles (the main
# or overrides one).

arch=$(uname -m)
. /etc/os-release

# make sure we have https://github.com/coreos/rpm-ostree/pull/5454
if ! rpm-ostree compose build-chunked-oci -h | grep -q -- --label; then
    sudo dnf update rpm-ostree -y
fi
