fix(ublue-builder): dont skip arch when there is no "ExclusiveArch" field on spec (#188)

This commit is contained in:
Tulip Blossom 2025-02-20 14:00:34 -03:00 committed by GitHub
parent 0e24d3f94c
commit e0dae2540a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 3 deletions

View file

@ -25,6 +25,7 @@ build $spec *MOCK_ARGS:
MOCK_DIR="${MOCK_DIRECTORY:-./mock}"
SOURCES_DIR="${SOURCES_DIR:-.}"
sudo podman run --privileged --rm -it \
--pull "newer" \
-v "$CONTAINERS_DIR:/var/lib/containers:z" \
-v "$MOCK_DIR:/var/lib/mock:Z" \
-v "$SOURCES_DIR:/tmp/sources:Z" \

View file

@ -25,9 +25,13 @@ group_start "Generate spec file with rpkg"
OUTDIR="$(mktemp -d)"
SPEC_PATH="$(realpath "$(dirname "$SPEC_FILE")")"
rpkg --path "${SPEC_PATH}" spec --outdir "$OUTDIR"
if ! rpmspec -P "${OUTDIR}"/*.spec | grep "ExclusiveArch:" | grep "$(arch)" ; then
echo "Arch Skipped" | tee /tmp/sources/arch_skipped
exit 0
RPMSPEC_FOR_CHECK="$(mktemp)"
rpmspec -P "${OUTDIR}"/*.spec | tee "${RPMSPEC_FOR_CHECK}"
if grep "ExclusiveArch:" "${RPMSPEC_FOR_CHECK}" ; then
if ! grep "$(arch)" "${RPMSPEC_FOR_CHECK}" ; then
echo "Arch Skipped" | tee /tmp/sources/arch_skipped
exit 0
fi
fi
group_end