Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion tools/distribution-drafts/linux-packages/rpm-rewrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ cp "${IN_ABS}" "${WORK}/in.rpm"
cat > "${WORK}/rewrap-inside.sh" <<'INSIDE_EOF'
#!/bin/bash
set -euo pipefail
# The container runs as root (it installs rpm-build), so everything it writes to
# the bind mount is root-owned on a Linux host. Hand it back to the caller on any
# exit, or the caller's cleanup of WORK fails with Permission denied.
trap 'chown -R "${HOST_UID}:${HOST_GID}" /w' EXIT
dnf -q -y install rpm-build cpio >/dev/null
IN=/w/in.rpm
q() { rpm -qp --qf "$1" "${IN}"; }
Expand Down Expand Up @@ -125,7 +129,7 @@ cp "${OUTRPM}" /w/out.rpm
echo "rpm-rewrap: rebuilt $(basename "${OUTRPM}") (archive ${ARCHIVE} bytes = stream)"
INSIDE_EOF

docker run --rm -v "${WORK}:/w" "${BUILD_IMAGE}" bash /w/rewrap-inside.sh
docker run --rm -e HOST_UID="$(id -u)" -e HOST_GID="$(id -g)" -v "${WORK}:/w" "${BUILD_IMAGE}" bash /w/rewrap-inside.sh

# rpm2cpio | cpio -t must exit 0 on each target rpm version.
for image in ${CHECK_IMAGES}; do
Expand Down
Loading