From: Daan De Meyer Date: Sun, 5 Nov 2023 11:13:51 +0000 (+0100) Subject: Various fixes for building-rpms-from-source.md X-Git-Tag: v19~26^2~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6a04ae6acd85946ba7b65515056c05c8a169bacc;p=thirdparty%2Fmkosi.git Various fixes for building-rpms-from-source.md - Fix quotes in rpms from source doc These statements should not be surrounded by quotes as we don't want them to expand to the empty string if unset. - Use fewer subshells - Don't use line continuations for pipes --- diff --git a/docs/building-rpms-from-source.md b/docs/building-rpms-from-source.md index e9ed88530..afb92cf02 100644 --- a/docs/building-rpms-from-source.md +++ b/docs/building-rpms-from-source.md @@ -62,9 +62,9 @@ mkosi-chroot \ "$DEPS" \ --define "_topdir $CHROOT_SRCDIR/mkosi" \ --define "_sourcedir $CHROOT_SRCDIR/mkosi/rpm" \ - "$CHROOT_SRCDIR/mkosi/rpm/mkosi.spec" \ - | grep -E -v "mkosi" \ - | xargs -d '\n' dnf install --best + "$CHROOT_SRCDIR/mkosi/rpm/mkosi.spec" | + grep -E -v "mkosi" | + xargs -d '\n' dnf install --best if [ "$1" = "build" ]; then until mkosi-chroot \ @@ -128,12 +128,12 @@ cd "$SRCDIR/mkosi" rpmbuild \ -bb \ --build-in-place \ - "$([ "$WITH_TESTS" = "0" ] && echo --nocheck)" \ + $([ "$WITH_TESTS" = "0" ] && echo --nocheck) \ --define "_topdir $SRCDIR/mkosi" \ --define "_sourcedir $SRCDIR/mkosi/rpm" \ --define "_rpmdir $OUTPUTDIR" \ - "$([ -n "$BUILDDIR" ] && echo --define)" \ - "$([ -n "$BUILDDIR" ] && echo "_vpath_builddir $BUILDDIR")" \ + ${BUILDDIR:+--define} \ + ${BUILDDIR:+"_vpath_builddir $BUILDDIR"} \ --define "_build_name_fmt %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm" \ "$SRCDIR/mkosi/rpm/mkosi.spec" ```