Skip to content

Commit 4fc9401

Browse files
committed
Use --replacepkgs when installing local builds
Trying to run tests locally against rawhide was failing, because I have no local modifications and the same package NEVRA already exists in the rhcontainerbot/bootc copr repo which is installed previously. Now if we have the same NEVRA via the local build we'll just re-install the local version as effectively a no-op instead of failing. Signed-off-by: John Eckersberg <jeckersb@redhat.com>
1 parent 61397ca commit 4fc9401

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ ARG boot_type
202202
# Install our bootc package (only needed for the compute-composefs-digest command)
203203
RUN --network=none --mount=type=tmpfs,target=/run --mount=type=tmpfs,target=/tmp \
204204
--mount=type=bind,from=packages,src=/,target=/run/packages \
205-
rpm -Uvh --oldpackage --nosignature /run/packages/bootc-*.rpm
205+
rpm -Uvh --oldpackage --replacepkgs --nosignature /run/packages/bootc-*.rpm
206206
RUN --network=none --mount=type=tmpfs,target=/run --mount=type=tmpfs,target=/tmp \
207207
--mount=type=secret,id=secureboot_key \
208208
--mount=type=secret,id=secureboot_cert \

contrib/packaging/install-rpm-and-setup

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@ set -xeuo pipefail
44

55
RPM_DIR="${1:-/tmp}"
66

7-
# Install the RPM package
8-
# Use rpm -Uvh with --oldpackage to allow replacing with dev version
9-
rpm -Uvh --oldpackage --nosignature "${RPM_DIR}"/*.rpm
7+
# Install the RPM package Use rpm -Uvh with --oldpackage to allow
8+
# replacing with dev version, and --replacepkgs in case the NEVRA from
9+
# our local build already exists in the image which can happen if
10+
# there's no local modifications and it's already been pulled in from
11+
# the rhcontainerbot/bootc copr.
12+
rpm -Uvh --oldpackage --replacepkgs --nosignature "${RPM_DIR}"/*.rpm
1013
# Note: we don't need to clean up the source directory since it's a bind mount
1114

1215
# Regenerate initramfs if we have initramfs-setup

0 commit comments

Comments
 (0)