Skip to content

Commit 2519e56

Browse files
authored
Merge pull request #457 from bcressey/dnf5-compat
fixes for dnf5 compatibility
2 parents 22b2516 + 1f7768e commit 2519e56

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

twoliter/embedded/build.Dockerfile

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -294,20 +294,23 @@ RUN --mount=target=/host \
294294
EXTERNAL_KIT_REPOS+=("--repofrompath=${REPO_NAME},${REPO_PATH}" --enablerepo "${REPO_NAME}"); \
295295
done && \
296296
echo "${EXTERNAL_KIT_REPOS[@]}" && \
297+
mkdir -p /local/rpms && \
298+
download_dir_opt="$(dnf install --help | grep -Fwq downloaddir && echo "--downloaddir /local/rpms" ||:)" && \
297299
dnf -y \
298300
--disablerepo '*' \
299301
--repofrompath repo,./rpmbuild/RPMS \
300302
--enablerepo 'repo' \
301303
"${KIT_REPOS[@]}" \
302304
"${EXTERNAL_KIT_REPOS[@]}" \
303305
--nogpgcheck \
304-
--downloadonly \
305-
--downloaddir . \
306306
--forcearch "${ARCH}" \
307-
install $(printf "bottlerocket-%s\n" metadata ${PACKAGES}) && \
308-
mkdir -p /local/rpms && \
309-
mv *.rpm /local/rpms && \
310-
createrepo_c /local/rpms && \
307+
--setopt=cachedir=/local/rpms \
308+
install \
309+
--downloadonly \
310+
${download_dir_opt} \
311+
$(printf "bottlerocket-%s\n" metadata ${PACKAGES}) && \
312+
find /local/rpms -mindepth 2 -type f -name '*.rpm' -exec mv -t /local/rpms {} + && \
313+
find /local/rpms -mindepth 1 ! -name '*.rpm' -delete && \
311314
rm /output && \
312315
rm /bypass && \
313316
echo ${NOCACHE}

twoliter/embedded/rpm2kmodkit

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@ popd >/dev/null
4545

4646
# Merge them together into a unified archive.
4747
pushd "${KIT_DIR}" >/dev/null
48-
tar cf "${OUTPUT_DIR}/${KMOD_KIT_FULL}.tar" "${KMOD_KIT}"
49-
xz -T0 "${OUTPUT_DIR}/${KMOD_KIT_FULL}.tar"
48+
XZ_OPT='-T0' tar cfJ "${OUTPUT_DIR}/${KMOD_KIT_FULL}.tar.xz" "${KMOD_KIT}"
5049
popd >/dev/null
5150

5251
# Create friendly symlinks.

0 commit comments

Comments
 (0)